From 4f91fb1ed003e9ba06b657f8be6952667653e52c Mon Sep 17 00:00:00 2001 From: willyogo Date: Fri, 3 Jan 2025 12:17:03 -0600 Subject: [PATCH] implement leaderboard and new homepage --- .DS_Store | Bin 6148 -> 6148 bytes ...rowser-CSTkmtVu.js => browser-BscKjtqc.js} | 2 +- .../{ccip-DpKvcgrn.js => ccip-CPRKQZcO.js} | 2 +- .../{index-XovjLohM.js => index-BR9qPzgi.js} | 273 +++++++++++------- .../{index-BT8BaHCw.js => index-BUZx39Jp.js} | 2 +- .../{index-Cr0fblK2.js => index-BVxaHy8U.js} | 4 +- dist/assets/index-Dkm_JXWU.css | 1 - dist/assets/index-p0NpMmLM.css | 1 + dist/index.html | 4 +- package-lock.json | 39 +++ package.json | 1 + src/.DS_Store | Bin 6148 -> 6148 bytes src/App.tsx | 12 +- src/components/.DS_Store | Bin 6148 -> 6148 bytes src/components/home/HomePage.tsx | 27 ++ src/components/home/PopularRooms.tsx | 102 +++++++ src/components/home/SearchInput.tsx | 41 +++ src/components/room/useSearchParams.ts | 19 +- src/lib/.DS_Store | Bin 8196 -> 8196 bytes src/lib/api/rooms.ts | 34 ++- src/main.tsx | 5 +- .../20250103165636_crystal_stream.sql | 23 -- .../migrations/20250103174908_flat_sun.sql | 52 ++++ 23 files changed, 500 insertions(+), 144 deletions(-) rename dist/assets/{browser-CSTkmtVu.js => browser-BscKjtqc.js} (78%) rename dist/assets/{ccip-DpKvcgrn.js => ccip-CPRKQZcO.js} (97%) rename dist/assets/{index-XovjLohM.js => index-BR9qPzgi.js} (57%) rename dist/assets/{index-BT8BaHCw.js => index-BUZx39Jp.js} (99%) rename dist/assets/{index-Cr0fblK2.js => index-BVxaHy8U.js} (97%) delete mode 100644 dist/assets/index-Dkm_JXWU.css create mode 100644 dist/assets/index-p0NpMmLM.css create mode 100644 src/components/home/HomePage.tsx create mode 100644 src/components/home/PopularRooms.tsx create mode 100644 src/components/home/SearchInput.tsx delete mode 100644 supabase/migrations/20250103165636_crystal_stream.sql create mode 100644 supabase/migrations/20250103174908_flat_sun.sql diff --git a/.DS_Store b/.DS_Store index 6f13e4f5e616e09ddb430b47ec2835e9820f403c..38e88d5a59ae17fa4ded825921b627b4f9c7711b 100644 GIT binary patch delta 216 zcmZoMXffEJ##FzmiGhKEg&~C@lcAWQBsbs1B`GIA2`I(^#OtD_9CJjKPr)l+kYN~{ zoS$0&)Wg7_^8rLM1I;aBNX|(|l3`r*9V#<x~R!JnPlW)wn25En8jkiFxi1w gWHJXcACuA!AX99z9y2dUr!BJ@gc9Fe!`vYP01B!!7ytkO delta 216 zcmZoMXffEJ##EoVnt_3Vg&~C@lcAWQBsbs1B`GIA2`I(^#6e+Gjya;rr{I+@$S@2} z&d)6X>S18eSpXuLf#w!5B` ${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 s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function qf(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 eH={exports:{}},A4={},tH={exports:{}},Rr={};/** +function Che(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 s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Kf(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 wH={exports:{}},k6={},bH={exports:{}},Rr={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function Jfe(t,e){for(var r=0;r>>1,M=O[D];if(0>>1;Di(H,I))eei(Z,H)?(O[D]=Z,O[ee]=I,D=ee):(O[D]=H,O[le]=I,D=le);else if(eei(Z,I))O[D]=Z,O[ee]=I,D=ee;else break e}}return j}function i(O,j){var I=O.sortIndex-j.sortIndex;return I!==0?I:O.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,f=null,h=3,g=!1,m=!1,w=!1,E=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,_=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(O){for(var j=r(c);j!==null;){if(j.callback===null)n(c);else if(j.startTime<=O)n(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=r(c)}}function C(O){if(w=!1,A(O),!m)if(r(l)!==null)m=!0,P(R);else{var j=r(c);j!==null&&L(C,j.startTime-O)}}function R(O,j){m=!1,w&&(w=!1,v(U),U=-1),g=!0;var I=h;try{for(A(j),f=r(l);f!==null&&(!(f.expirationTime>j)||O&&!K());){var D=f.callback;if(typeof D=="function"){f.callback=null,h=f.priorityLevel;var M=D(f.expirationTime<=j);j=t.unstable_now(),typeof M=="function"?f.callback=M:f===r(l)&&n(l),A(j)}else n(l);f=r(l)}if(f!==null)var X=!0;else{var le=r(c);le!==null&&L(C,le.startTime-j),X=!1}return X}finally{f=null,h=I,g=!1}}var B=!1,S=null,U=-1,G=5,oe=-1;function K(){return!(t.unstable_now()-oeO||125D?(O.sortIndex=I,e(c,O),r(l)===null&&O===r(c)&&(w?(v(U),U=-1):w=!0,L(C,I-D))):(O.sortIndex=M,e(l,O),m||g||(m=!0,P(R))),O},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(O){var j=h;return function(){var I=h;h=j;try{return O.apply(this,arguments)}finally{h=I}}}})(hH);fH.exports=hH;var whe=fH.exports;/** + */(function(t){function e(O,j){var T=O.length;O.push(j);e:for(;0>>1,M=O[L];if(0>>1;Li(H,T))eei(Z,H)?(O[L]=Z,O[ee]=T,L=ee):(O[L]=H,O[le]=T,L=le);else if(eei(Z,T))O[L]=Z,O[ee]=T,L=ee;else break e}}return j}function i(O,j){var T=O.sortIndex-j.sortIndex;return T!==0?T:O.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],c=[],u=1,f=null,h=3,g=!1,m=!1,w=!1,E=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,_=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(O){for(var j=r(c);j!==null;){if(j.callback===null)n(c);else if(j.startTime<=O)n(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=r(c)}}function C(O){if(w=!1,A(O),!m)if(r(l)!==null)m=!0,P(R);else{var j=r(c);j!==null&&D(C,j.startTime-O)}}function R(O,j){m=!1,w&&(w=!1,v(U),U=-1),g=!0;var T=h;try{for(A(j),f=r(l);f!==null&&(!(f.expirationTime>j)||O&&!K());){var L=f.callback;if(typeof L=="function"){f.callback=null,h=f.priorityLevel;var M=L(f.expirationTime<=j);j=t.unstable_now(),typeof M=="function"?f.callback=M:f===r(l)&&n(l),A(j)}else n(l);f=r(l)}if(f!==null)var X=!0;else{var le=r(c);le!==null&&D(C,le.startTime-j),X=!1}return X}finally{f=null,h=T,g=!1}}var B=!1,S=null,U=-1,G=5,ae=-1;function K(){return!(t.unstable_now()-aeO||125L?(O.sortIndex=T,e(c,O),r(l)===null&&O===r(c)&&(w?(v(U),U=-1):w=!0,D(C,T-L))):(O.sortIndex=M,e(l,O),m||g||(m=!0,P(R))),O},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(O){var j=h;return function(){var T=h;h=j;try{return O.apply(this,arguments)}finally{h=T}}}})(PH);NH.exports=PH;var Vhe=NH.exports;/** * @license React * react-dom.production.min.js * @@ -30,77 +30,104 @@ function Jfe(t,e){for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qC=Object.prototype.hasOwnProperty,_he=/^[: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]*$/,NM={},PM={};function xhe(t){return qC.call(PM,t)?!0:qC.call(NM,t)?!1:_he.test(t)?PM[t]=!0:(NM[t]=!0,!1)}function Ehe(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 Che(t,e,r,n){if(e===null||typeof e>"u"||Ehe(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 no(t,e,r,n,i,s,o){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=s,this.removeEmptyString=o}var ds={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ds[t]=new no(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ds[e]=new no(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ds[t]=new no(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ds[t]=new no(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){ds[t]=new no(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ds[t]=new no(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ds[t]=new no(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ds[t]=new no(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ds[t]=new no(t,5,!1,t.toLowerCase(),null,!1,!1)});var kT=/[\-:]([a-z])/g;function NT(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(kT,NT);ds[e]=new no(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(kT,NT);ds[e]=new no(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(kT,NT);ds[e]=new no(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ds[t]=new no(t,1,!1,t.toLowerCase(),null,!1,!1)});ds.xlinkHref=new no("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ds[t]=new no(t,1,!1,t.toLowerCase(),null,!0,!0)});function PT(t,e,r,n){var i=ds.hasOwnProperty(e)?ds[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),JC=Object.prototype.hasOwnProperty,Khe=/^[: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]*$/,WM={},zM={};function Yhe(t){return JC.call(zM,t)?!0:JC.call(WM,t)?!1:Khe.test(t)?zM[t]=!0:(WM[t]=!0,!1)}function Zhe(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 Jhe(t,e,r,n){if(e===null||typeof e>"u"||Zhe(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 na(t,e,r,n,i,s,a){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=s,this.removeEmptyString=a}var ds={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ds[t]=new na(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ds[e]=new na(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ds[t]=new na(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ds[t]=new na(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){ds[t]=new na(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ds[t]=new na(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ds[t]=new na(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ds[t]=new na(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ds[t]=new na(t,5,!1,t.toLowerCase(),null,!1,!1)});var LT=/[\-:]([a-z])/g;function DT(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(LT,DT);ds[e]=new na(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(LT,DT);ds[e]=new na(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(LT,DT);ds[e]=new na(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ds[t]=new na(t,1,!1,t.toLowerCase(),null,!1,!1)});ds.xlinkHref=new na("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ds[t]=new na(t,1,!1,t.toLowerCase(),null,!0,!0)});function FT(t,e,r,n){var i=ds.hasOwnProperty(e)?ds[e]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var l=` -`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{Vx=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?py(t):""}function Ahe(t){switch(t.tag){case 5:return py(t.type);case 16:return py("Lazy");case 13:return py("Suspense");case 19:return py("SuspenseList");case 0:case 2:case 15:return t=Gx(t.type,!1),t;case 11:return t=Gx(t.type.render,!1),t;case 1:return t=Gx(t.type,!0),t;default:return""}}function YC(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 n1:return"Fragment";case r1:return"Portal";case VC:return"Profiler";case RT:return"StrictMode";case GC:return"Suspense";case KC:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case mH:return(t.displayName||"Context")+".Consumer";case gH:return(t._context.displayName||"Context")+".Provider";case MT:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case OT:return e=t.displayName||null,e!==null?e:YC(t.type)||"Memo";case tf:e=t._payload,t=t._init;try{return YC(t(e))}catch{}}return null}function She(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 YC(e);case 8:return e===RT?"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 Rf(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vH(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Ihe(t){var e=vH(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,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function U3(t){t._valueTracker||(t._valueTracker=Ihe(t))}function wH(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=vH(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function F5(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 ZC(t,e){var r=e.checked;return Kn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function MM(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Rf(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 bH(t,e){e=e.checked,e!=null&&PT(t,"checked",e,!1)}function JC(t,e){bH(t,e);var r=Rf(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")?QC(t,e.type,r):e.hasOwnProperty("defaultValue")&&QC(t,e.type,Rf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function OM(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 QC(t,e,r){(e!=="number"||F5(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var gy=Array.isArray;function C1(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=B3.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function o2(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var ky={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},The=["Webkit","ms","Moz","O"];Object.keys(ky).forEach(function(t){The.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ky[e]=ky[t]})});function CH(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||ky.hasOwnProperty(t)&&ky[t]?(""+e).trim():e+"px"}function AH(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=CH(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var $he=Kn({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 tA(t,e){if(e){if($he[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(st(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(st(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(st(61))}if(e.style!=null&&typeof e.style!="object")throw Error(st(62))}}function rA(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 nA=null;function jT(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var iA=null,A1=null,S1=null;function LM(t){if(t=xv(t)){if(typeof iA!="function")throw Error(st(280));var e=t.stateNode;e&&(e=k4(e),iA(t.stateNode,t.type,e))}}function SH(t){A1?S1?S1.push(t):S1=[t]:A1=t}function IH(){if(A1){var t=A1,e=S1;if(S1=A1=null,LM(t),e)for(t=0;t>>=0,t===0?32:31-(Uhe(t)/Bhe|0)|0}var W3=64,z3=4194304;function my(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 z5(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=my(a):(s&=o,s!==0&&(n=my(s)))}else o=r&~i,o!==0?n=my(o):s!==0&&(n=my(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&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 bv(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Bl(e),t[e]=r}function qhe(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=Py),GM=" ",KM=!1;function GH(t,e){switch(t){case"keyup":return w0e.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function KH(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var i1=!1;function _0e(t,e){switch(t){case"compositionend":return KH(e);case"keypress":return e.which!==32?null:(KM=!0,GM);case"textInput":return t=e.data,t===GM&&KM?null:t;default:return null}}function x0e(t,e){if(i1)return t==="compositionend"||!HT&&GH(t,e)?(t=qH(),Yb=BT=hf=null,i1=!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=QM(r)}}function QH(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?QH(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function XH(){for(var t=window,e=F5();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=F5(t.document)}return e}function qT(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 N0e(t){var e=XH(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&QH(r.ownerDocument.documentElement,r)){if(n!==null&&qT(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,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=XM(r,s);var o=XM(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.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,s1=null,uA=null,My=null,dA=!1;function eO(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;dA||s1==null||s1!==F5(n)||(n=s1,"selectionStart"in n&&qT(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}),My&&f2(My,n)||(My=n,n=V5(uA,"onSelect"),0l1||(t.current=yA[l1],yA[l1]=null,l1--)}function En(t,e){l1++,yA[l1]=t.current,t.current=e}var Mf={},Os=Gf(Mf),ko=Gf(!1),d0=Mf;function q1(t,e){var r=t.type.contextTypes;if(!r)return Mf;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function No(t){return t=t.childContextTypes,t!=null}function K5(){Pn(ko),Pn(Os)}function aO(t,e,r){if(Os.current!==Mf)throw Error(st(168));En(Os,e),En(ko,r)}function lq(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(st(108,She(t)||"Unknown",i));return Kn({},r,n)}function Y5(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Mf,d0=Os.current,En(Os,t),En(ko,ko.current),!0}function lO(t,e,r){var n=t.stateNode;if(!n)throw Error(st(169));r?(t=lq(t,e,d0),n.__reactInternalMemoizedMergedChildContext=t,Pn(ko),Pn(Os),En(Os,t)):Pn(ko),En(ko,r)}var zu=null,N4=!1,a9=!1;function cq(t){zu===null?zu=[t]:zu.push(t)}function z0e(t){N4=!0,cq(t)}function Kf(){if(!a9&&zu!==null){a9=!0;var t=0,e=an;try{var r=zu;for(an=1;t>=o,i-=o,Xu=1<<32-Bl(e)+i|r<U?(G=S,S=null):G=S.sibling;var oe=h(v,S,A[U],C);if(oe===null){S===null&&(S=G);break}t&&S&&oe.alternate===null&&e(v,S),_=s(oe,_,U),B===null?R=oe:B.sibling=oe,B=oe,S=G}if(U===A.length)return r(v,S),Dn&&kh(v,U),R;if(S===null){for(;UU?(G=S,S=null):G=S.sibling;var K=h(v,S,oe.value,C);if(K===null){S===null&&(S=G);break}t&&S&&K.alternate===null&&e(v,S),_=s(K,_,U),B===null?R=K:B.sibling=K,B=K,S=G}if(oe.done)return r(v,S),Dn&&kh(v,U),R;if(S===null){for(;!oe.done;U++,oe=A.next())oe=f(v,oe.value,C),oe!==null&&(_=s(oe,_,U),B===null?R=oe:B.sibling=oe,B=oe);return Dn&&kh(v,U),R}for(S=n(v,S);!oe.done;U++,oe=A.next())oe=g(S,v,U,oe.value,C),oe!==null&&(t&&oe.alternate!==null&&S.delete(oe.key===null?U:oe.key),_=s(oe,_,U),B===null?R=oe:B.sibling=oe,B=oe);return t&&S.forEach(function(N){return e(v,N)}),Dn&&kh(v,U),R}function E(v,_,A,C){if(typeof A=="object"&&A!==null&&A.type===n1&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case F3:e:{for(var R=A.key,B=_;B!==null;){if(B.key===R){if(R=A.type,R===n1){if(B.tag===7){r(v,B.sibling),_=i(B,A.props.children),_.return=v,v=_;break e}}else if(B.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===tf&&dO(R)===B.type){r(v,B.sibling),_=i(B,A.props),_.ref=Fm(v,B,A),_.return=v,v=_;break e}r(v,B);break}else e(v,B);B=B.sibling}A.type===n1?(_=Qh(A.props.children,v.mode,C,A.key),_.return=v,v=_):(C=n5(A.type,A.key,A.props,null,v.mode,C),C.ref=Fm(v,_,A),C.return=v,v=C)}return o(v);case r1:e:{for(B=A.key;_!==null;){if(_.key===B)if(_.tag===4&&_.stateNode.containerInfo===A.containerInfo&&_.stateNode.implementation===A.implementation){r(v,_.sibling),_=i(_,A.children||[]),_.return=v,v=_;break e}else{r(v,_);break}else e(v,_);_=_.sibling}_=g9(A,v.mode,C),_.return=v,v=_}return o(v);case tf:return B=A._init,E(v,_,B(A._payload),C)}if(gy(A))return m(v,_,A,C);if(Mm(A))return w(v,_,A,C);Z3(v,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,_!==null&&_.tag===6?(r(v,_.sibling),_=i(_,A),_.return=v,v=_):(r(v,_),_=p9(A,v.mode,C),_.return=v,v=_),o(v)):r(v,_)}return E}var G1=hq(!0),pq=hq(!1),Q5=Gf(null),X5=null,d1=null,YT=null;function ZT(){YT=d1=X5=null}function JT(t){var e=Q5.current;Pn(Q5),t._currentValue=e}function bA(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 T1(t,e){X5=t,YT=d1=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(To=!0),t.firstContext=null)}function Xa(t){var e=t._currentValue;if(YT!==t)if(t={context:t,memoizedValue:e,next:null},d1===null){if(X5===null)throw Error(st(308));d1=t,X5.dependencies={lanes:0,firstContext:t}}else d1=d1.next=t;return e}var Hh=null;function QT(t){Hh===null?Hh=[t]:Hh.push(t)}function gq(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,QT(e)):(r.next=i.next,i.next=r),e.interleaved=r,ud(t,n)}function ud(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 rf=!1;function XT(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mq(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 sd(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Af(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Gr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,ud(t,r)}return i=n.interleaved,i===null?(e.next=e,QT(n)):(e.next=i.next,i.next=e),n.interleaved=e,ud(t,r)}function Jb(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,LT(t,r)}}function fO(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 e6(t,e,r,n){var i=t.updateQueue;rf=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,u=c=l=null,a=s;do{var h=a.lane,g=a.eventTime;if((n&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=t,w=a;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=Kn({},f,h);break e;case 2:rf=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=g,l=f):u=u.next=g,o|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=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 o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);p0|=o,t.lanes=o,t.memoizedState=f}}function hO(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=c9.transition;c9.transition={};try{t(!1),e()}finally{an=r,c9.transition=n}}function Rq(){return el().memoizedState}function G0e(t,e,r){var n=If(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Mq(t))Oq(e,r);else if(r=gq(t,e,r,n),r!==null){var i=Qs();Wl(r,t,n,i),jq(r,e,n)}}function K0e(t,e,r){var n=If(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Mq(t))Oq(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Kl(a,o)){var l=e.interleaved;l===null?(i.next=i,QT(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=gq(t,e,i,n),r!==null&&(i=Qs(),Wl(r,t,n,i),jq(r,e,n))}}function Mq(t){var e=t.alternate;return t===Gn||e!==null&&e===Gn}function Oq(t,e){Oy=r6=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function jq(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,LT(t,r)}}var n6={readContext:Xa,useCallback:vs,useContext:vs,useEffect:vs,useImperativeHandle:vs,useInsertionEffect:vs,useLayoutEffect:vs,useMemo:vs,useReducer:vs,useRef:vs,useState:vs,useDebugValue:vs,useDeferredValue:vs,useTransition:vs,useMutableSource:vs,useSyncExternalStore:vs,useId:vs,unstable_isNewReconciler:!1},Y0e={readContext:Xa,useCallback:function(t,e){return Cc().memoizedState=[t,e===void 0?null:e],t},useContext:Xa,useEffect:gO,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Xb(4194308,4,Tq.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Xb(4194308,4,t,e)},useInsertionEffect:function(t,e){return Xb(4,2,t,e)},useMemo:function(t,e){var r=Cc();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Cc();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=G0e.bind(null,Gn,t),[n.memoizedState,t]},useRef:function(t){var e=Cc();return t={current:t},e.memoizedState=t},useState:pO,useDebugValue:a$,useDeferredValue:function(t){return Cc().memoizedState=t},useTransition:function(){var t=pO(!1),e=t[0];return t=V0e.bind(null,t[1]),Cc().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Gn,i=Cc();if(Dn){if(r===void 0)throw Error(st(407));r=r()}else{if(r=e(),Yi===null)throw Error(st(349));h0&30||bq(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,gO(xq.bind(null,n,s,t),[t]),n.flags|=2048,b2(9,_q.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Cc(),e=Yi.identifierPrefix;if(Dn){var r=ed,n=Xu;r=(n&~(1<<32-Bl(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=v2++,0o||i[a]!==s[o]){var l=` +`+i[a].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=a&&0<=o);break}}}finally{Q7=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?my(t):""}function Qhe(t){switch(t.tag){case 5:return my(t.type);case 16:return my("Lazy");case 13:return my("Suspense");case 19:return my("SuspenseList");case 0:case 2:case 15:return t=X7(t.type,!1),t;case 11:return t=X7(t.type.render,!1),t;case 1:return t=X7(t.type,!0),t;default:return""}}function tA(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 s1:return"Fragment";case i1:return"Portal";case QC:return"Profiler";case UT:return"StrictMode";case XC:return"Suspense";case eA:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case OH:return(t.displayName||"Context")+".Consumer";case MH:return(t._context.displayName||"Context")+".Provider";case BT:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case WT:return e=t.displayName||null,e!==null?e:tA(t.type)||"Memo";case nf:e=t._payload,t=t._init;try{return tA(t(e))}catch{}}return null}function Xhe(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 tA(e);case 8:return e===UT?"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 jf(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function LH(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function e0e(t){var e=LH(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,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,s.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function z3(t){t._valueTracker||(t._valueTracker=e0e(t))}function DH(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=LH(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function z5(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 rA(t,e){var r=e.checked;return Kn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function qM(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=jf(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 FH(t,e){e=e.checked,e!=null&&FT(t,"checked",e,!1)}function nA(t,e){FH(t,e);var r=jf(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")?iA(t,e.type,r):e.hasOwnProperty("defaultValue")&&iA(t,e.type,jf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function VM(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 iA(t,e,r){(e!=="number"||z5(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var yy=Array.isArray;function S1(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=H3.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function l2(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},t0e=["Webkit","ms","Moz","O"];Object.keys(Py).forEach(function(t){t0e.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Py[e]=Py[t]})});function zH(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 HH(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=zH(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var r0e=Kn({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 oA(t,e){if(e){if(r0e[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(st(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(st(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(st(61))}if(e.style!=null&&typeof e.style!="object")throw Error(st(62))}}function lA(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 cA=null;function zT(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var uA=null,I1=null,T1=null;function YM(t){if(t=Av(t)){if(typeof uA!="function")throw Error(st(280));var e=t.stateNode;e&&(e=O6(e),uA(t.stateNode,t.type,e))}}function qH(t){I1?T1?T1.push(t):T1=[t]:I1=t}function VH(){if(I1){var t=I1,e=T1;if(T1=I1=null,YM(t),e)for(t=0;t>>=0,t===0?32:31-(h0e(t)/p0e|0)|0}var q3=64,V3=4194304;function vy(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 G5(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,a=r&268435455;if(a!==0){var o=a&~i;o!==0?n=vy(o):(s&=a,s!==0&&(n=vy(s)))}else a=r&~i,a!==0?n=vy(a):s!==0&&(n=vy(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&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 Ev(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Bl(e),t[e]=r}function v0e(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),iO=" ",sO=!1;function fq(t,e){switch(t){case"keyup":return V0e.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hq(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var a1=!1;function K0e(t,e){switch(t){case"compositionend":return hq(e);case"keypress":return e.which!==32?null:(sO=!0,iO);case"textInput":return t=e.data,t===iO&&sO?null:t;default:return null}}function Y0e(t,e){if(a1)return t==="compositionend"||!JT&&fq(t,e)?(t=uq(),Qb=KT=gf=null,a1=!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=cO(r)}}function yq(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?yq(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function vq(){for(var t=window,e=z5();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=z5(t.document)}return e}function QT(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 ipe(t){var e=vq(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&yq(r.ownerDocument.documentElement,r)){if(n!==null&&QT(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,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=uO(r,s);var a=uO(r,n);i&&a&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.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,o1=null,mA=null,jy=null,yA=!1;function dO(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;yA||o1==null||o1!==z5(n)||(n=o1,"selectionStart"in n&&QT(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}),jy&&p2(jy,n)||(jy=n,n=Z5(mA,"onSelect"),0u1||(t.current=EA[u1],EA[u1]=null,u1--)}function En(t,e){u1++,EA[u1]=t.current,t.current=e}var Lf={},Os=Zf(Lf),$a=Zf(!1),p0=Lf;function G1(t,e){var r=t.type.contextTypes;if(!r)return Lf;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ka(t){return t=t.childContextTypes,t!=null}function Q5(){Rn($a),Rn(Os)}function vO(t,e,r){if(Os.current!==Lf)throw Error(st(168));En(Os,e),En($a,r)}function Iq(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(st(108,Xhe(t)||"Unknown",i));return Kn({},r,n)}function X5(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Lf,p0=Os.current,En(Os,t),En($a,$a.current),!0}function wO(t,e,r){var n=t.stateNode;if(!n)throw Error(st(169));r?(t=Iq(t,e,p0),n.__reactInternalMemoizedMergedChildContext=t,Rn($a),Rn(Os),En(Os,t)):Rn($a),En($a,r)}var qu=null,j6=!1,h9=!1;function Tq(t){qu===null?qu=[t]:qu.push(t)}function mpe(t){j6=!0,Tq(t)}function Jf(){if(!h9&&qu!==null){h9=!0;var t=0,e=on;try{var r=qu;for(on=1;t>=a,i-=a,td=1<<32-Bl(e)+i|r<U?(G=S,S=null):G=S.sibling;var ae=h(v,S,A[U],C);if(ae===null){S===null&&(S=G);break}t&&S&&ae.alternate===null&&e(v,S),_=s(ae,_,U),B===null?R=ae:B.sibling=ae,B=ae,S=G}if(U===A.length)return r(v,S),Ln&&Rh(v,U),R;if(S===null){for(;UU?(G=S,S=null):G=S.sibling;var K=h(v,S,ae.value,C);if(K===null){S===null&&(S=G);break}t&&S&&K.alternate===null&&e(v,S),_=s(K,_,U),B===null?R=K:B.sibling=K,B=K,S=G}if(ae.done)return r(v,S),Ln&&Rh(v,U),R;if(S===null){for(;!ae.done;U++,ae=A.next())ae=f(v,ae.value,C),ae!==null&&(_=s(ae,_,U),B===null?R=ae:B.sibling=ae,B=ae);return Ln&&Rh(v,U),R}for(S=n(v,S);!ae.done;U++,ae=A.next())ae=g(S,v,U,ae.value,C),ae!==null&&(t&&ae.alternate!==null&&S.delete(ae.key===null?U:ae.key),_=s(ae,_,U),B===null?R=ae:B.sibling=ae,B=ae);return t&&S.forEach(function(N){return e(v,N)}),Ln&&Rh(v,U),R}function E(v,_,A,C){if(typeof A=="object"&&A!==null&&A.type===s1&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case W3:e:{for(var R=A.key,B=_;B!==null;){if(B.key===R){if(R=A.type,R===s1){if(B.tag===7){r(v,B.sibling),_=i(B,A.props.children),_.return=v,v=_;break e}}else if(B.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===nf&&xO(R)===B.type){r(v,B.sibling),_=i(B,A.props),_.ref=Bm(v,B,A),_.return=v,v=_;break e}r(v,B);break}else e(v,B);B=B.sibling}A.type===s1?(_=r0(A.props.children,v.mode,C,A.key),_.return=v,v=_):(C=a5(A.type,A.key,A.props,null,v.mode,C),C.ref=Bm(v,_,A),C.return=v,v=C)}return a(v);case i1:e:{for(B=A.key;_!==null;){if(_.key===B)if(_.tag===4&&_.stateNode.containerInfo===A.containerInfo&&_.stateNode.implementation===A.implementation){r(v,_.sibling),_=i(_,A.children||[]),_.return=v,v=_;break e}else{r(v,_);break}else e(v,_);_=_.sibling}_=_9(A,v.mode,C),_.return=v,v=_}return a(v);case nf:return B=A._init,E(v,_,B(A._payload),C)}if(yy(A))return m(v,_,A,C);if(jm(A))return w(v,_,A,C);X3(v,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,_!==null&&_.tag===6?(r(v,_.sibling),_=i(_,A),_.return=v,v=_):(r(v,_),_=b9(A,v.mode,C),_.return=v,v=_),a(v)):r(v,_)}return E}var Y1=Pq(!0),Rq=Pq(!1),r4=Zf(null),n4=null,h1=null,r$=null;function n$(){r$=h1=n4=null}function i$(t){var e=r4.current;Rn(r4),t._currentValue=e}function SA(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 k1(t,e){n4=t,r$=h1=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Ia=!0),t.firstContext=null)}function Xo(t){var e=t._currentValue;if(r$!==t)if(t={context:t,memoizedValue:e,next:null},h1===null){if(n4===null)throw Error(st(308));h1=t,n4.dependencies={lanes:0,firstContext:t}}else h1=h1.next=t;return e}var Gh=null;function s$(t){Gh===null?Gh=[t]:Gh.push(t)}function Mq(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,s$(e)):(r.next=i.next,i.next=r),e.interleaved=r,fd(t,n)}function fd(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 sf=!1;function a$(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Oq(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 od(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function If(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Gr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,fd(t,r)}return i=n.interleaved,i===null?(e.next=e,s$(n)):(e.next=i.next,i.next=e),n.interleaved=e,fd(t,r)}function e5(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,qT(t,r)}}function EO(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=a:s=s.next=a,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 i4(t,e,r,n){var i=t.updateQueue;sf=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var u=t.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==a&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;a=0,u=c=l=null,o=s;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=Kn({},f,h);break e;case 2:sf=!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,a|=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 a|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);y0|=a,t.lanes=a,t.memoizedState=f}}function CO(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=g9.transition;g9.transition={};try{t(!1),e()}finally{on=r,g9.transition=n}}function Qq(){return el().memoizedState}function bpe(t,e,r){var n=$f(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Xq(t))eV(e,r);else if(r=Mq(t,e,r,n),r!==null){var i=Qs();Wl(r,t,n,i),tV(r,e,n)}}function _pe(t,e,r){var n=$f(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Xq(t))eV(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var a=e.lastRenderedState,o=s(a,r);if(i.hasEagerState=!0,i.eagerState=o,Kl(o,a)){var l=e.interleaved;l===null?(i.next=i,s$(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=Mq(t,e,i,n),r!==null&&(i=Qs(),Wl(r,t,n,i),tV(r,e,n))}}function Xq(t){var e=t.alternate;return t===Gn||e!==null&&e===Gn}function eV(t,e){Ly=a4=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function tV(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,qT(t,r)}}var o4={readContext:Xo,useCallback:vs,useContext:vs,useEffect:vs,useImperativeHandle:vs,useInsertionEffect:vs,useLayoutEffect:vs,useMemo:vs,useReducer:vs,useRef:vs,useState:vs,useDebugValue:vs,useDeferredValue:vs,useTransition:vs,useMutableSource:vs,useSyncExternalStore:vs,useId:vs,unstable_isNewReconciler:!1},xpe={readContext:Xo,useCallback:function(t,e){return Ac().memoizedState=[t,e===void 0?null:e],t},useContext:Xo,useEffect:SO,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,r5(4194308,4,Gq.bind(null,e,t),r)},useLayoutEffect:function(t,e){return r5(4194308,4,t,e)},useInsertionEffect:function(t,e){return r5(4,2,t,e)},useMemo:function(t,e){var r=Ac();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Ac();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=bpe.bind(null,Gn,t),[n.memoizedState,t]},useRef:function(t){var e=Ac();return t={current:t},e.memoizedState=t},useState:AO,useDebugValue:p$,useDeferredValue:function(t){return Ac().memoizedState=t},useTransition:function(){var t=AO(!1),e=t[0];return t=wpe.bind(null,t[1]),Ac().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Gn,i=Ac();if(Ln){if(r===void 0)throw Error(st(407));r=r()}else{if(r=e(),Yi===null)throw Error(st(349));m0&30||Fq(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,SO(Bq.bind(null,n,s,t),[t]),n.flags|=2048,x2(9,Uq.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Ac(),e=Yi.identifierPrefix;if(Ln){var r=rd,n=td;r=(n&~(1<<32-Bl(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=b2++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Nc]=e,t[g2]=n,Vq(t,e,!1,!1),e.stateNode=t;e:{switch(o=rA(r,n),r){case"dialog":$n("cancel",t),$n("close",t),i=n;break;case"iframe":case"object":case"embed":$n("load",t),i=n;break;case"video":case"audio":for(i=0;iZ1&&(e.flags|=128,n=!0,Um(s,!1),e.lanes=4194304)}else{if(!n)if(t=t6(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Um(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Dn)return ws(e),null}else 2*ci()-s.renderingStartTime>Z1&&r!==1073741824&&(e.flags|=128,n=!0,Um(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ci(),e.sibling=null,r=qn.current,En(qn,n?r&1|2:r&1),e):(ws(e),null);case 22:case 23:return h$(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?na&1073741824&&(ws(e),e.subtreeFlags&6&&(e.flags|=8192)):ws(e),null;case 24:return null;case 25:return null}throw Error(st(156,e.tag))}function npe(t,e){switch(GT(e),e.tag){case 1:return No(e.type)&&K5(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return K1(),Pn(ko),Pn(Os),r$(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return t$(e),null;case 13:if(Pn(qn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(st(340));V1()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Pn(qn),null;case 4:return K1(),null;case 10:return JT(e.type._context),null;case 22:case 23:return h$(),null;case 24:return null;default:return null}}var Q3=!1,As=!1,ipe=typeof WeakSet=="function"?WeakSet:Set,$t=null;function f1(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Xn(t,e,n)}else r.current=null}function $A(t,e,r){try{r()}catch(n){Xn(t,e,n)}}var SO=!1;function spe(t,e){if(fA=H5,t=XH(),qT(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,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var g;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===r&&++c===i&&(a=o),h===s&&++u===n&&(l=o),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(hA={focusedElem:t,selectionRange:r},H5=!1,$t=e;$t!==null;)if(e=$t,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,$t=t;else for(;$t!==null;){e=$t;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,E=m.memoizedState,v=e.stateNode,_=v.getSnapshotBeforeUpdate(e.elementType===e.type?w:kl(e.type,w),E);v.__reactInternalSnapshotBeforeUpdate=_}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(st(163))}}catch(C){Xn(e,e.return,C)}if(t=e.sibling,t!==null){t.return=e.return,$t=t;break}$t=e.return}return m=SO,SO=!1,m}function jy(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 s=i.destroy;i.destroy=void 0,s!==void 0&&$A(e,r,s)}i=i.next}while(i!==n)}}function M4(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 kA(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 Yq(t){var e=t.alternate;e!==null&&(t.alternate=null,Yq(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Nc],delete e[g2],delete e[mA],delete e[B0e],delete e[W0e])),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 Zq(t){return t.tag===5||t.tag===3||t.tag===4}function IO(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Zq(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 NA(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=G5));else if(n!==4&&(t=t.child,t!==null))for(NA(t,e,r),t=t.sibling;t!==null;)NA(t,e,r),t=t.sibling}function PA(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(PA(t,e,r),t=t.sibling;t!==null;)PA(t,e,r),t=t.sibling}var ls=null,Pl=!1;function Hd(t,e,r){for(r=r.child;r!==null;)Jq(t,e,r),r=r.sibling}function Jq(t,e,r){if(Uc&&typeof Uc.onCommitFiberUnmount=="function")try{Uc.onCommitFiberUnmount(S4,r)}catch{}switch(r.tag){case 5:As||f1(r,e);case 6:var n=ls,i=Pl;ls=null,Hd(t,e,r),ls=n,Pl=i,ls!==null&&(Pl?(t=ls,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ls.removeChild(r.stateNode));break;case 18:ls!==null&&(Pl?(t=ls,r=r.stateNode,t.nodeType===8?o9(t.parentNode,r):t.nodeType===1&&o9(t,r),u2(t)):o9(ls,r.stateNode));break;case 4:n=ls,i=Pl,ls=r.stateNode.containerInfo,Pl=!0,Hd(t,e,r),ls=n,Pl=i;break;case 0:case 11:case 14:case 15:if(!As&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&$A(r,e,o),i=i.next}while(i!==n)}Hd(t,e,r);break;case 1:if(!As&&(f1(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Xn(r,e,a)}Hd(t,e,r);break;case 21:Hd(t,e,r);break;case 22:r.mode&1?(As=(n=As)||r.memoizedState!==null,Hd(t,e,r),As=n):Hd(t,e,r);break;default:Hd(t,e,r)}}function TO(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new ipe),e.forEach(function(n){var i=ppe.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function wl(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=ci()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ape(n/1960))-n,10t?16:t,pf===null)var n=!1;else{if(t=pf,pf=null,o6=0,Gr&6)throw Error(st(331));var i=Gr;for(Gr|=4,$t=t.current;$t!==null;){var s=$t,o=s.child;if($t.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lci()-d$?Jh(t,0):u$|=r),Po(t,e)}function sV(t,e){e===0&&(t.mode&1?(e=z3,z3<<=1,!(z3&130023424)&&(z3=4194304)):e=1);var r=Qs();t=ud(t,e),t!==null&&(bv(t,e,r),Po(t,r))}function hpe(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),sV(t,r)}function ppe(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(st(314))}n!==null&&n.delete(e),sV(t,r)}var oV;oV=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ko.current)To=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return To=!1,tpe(t,e,r);To=!!(t.flags&131072)}else To=!1,Dn&&e.flags&1048576&&uq(e,J5,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;e5(t,e),t=e.pendingProps;var i=q1(e,Os.current);T1(e,r),i=i$(null,e,n,t,i,r);var s=s$();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,No(n)?(s=!0,Y5(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,XT(e),i.updater=R4,e.stateNode=i,i._reactInternals=e,xA(e,n,t,r),e=AA(null,e,n,!0,s,r)):(e.tag=0,Dn&&s&&VT(e),zs(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(e5(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=mpe(n),t=kl(n,t),i){case 0:e=CA(null,e,n,t,r);break e;case 1:e=EO(null,e,n,t,r);break e;case 11:e=_O(null,e,n,t,r);break e;case 14:e=xO(null,e,n,kl(n.type,t),r);break e}throw Error(st(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:kl(n,i),CA(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:kl(n,i),EO(t,e,n,i,r);case 3:e:{if(zq(e),t===null)throw Error(st(387));n=e.pendingProps,s=e.memoizedState,i=s.element,mq(t,e),e6(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Y1(Error(st(423)),e),e=CO(t,e,n,r,i);break e}else if(n!==i){i=Y1(Error(st(424)),e),e=CO(t,e,n,r,i);break e}else for(ua=Cf(e.stateNode.containerInfo.firstChild),ha=e,Dn=!0,Ml=null,r=pq(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(V1(),n===i){e=dd(t,e,r);break e}zs(t,e,n,r)}e=e.child}return e;case 5:return yq(e),t===null&&wA(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,pA(n,i)?o=null:s!==null&&pA(n,s)&&(e.flags|=32),Wq(t,e),zs(t,e,o,r),e.child;case 6:return t===null&&wA(e),null;case 13:return Hq(t,e,r);case 4:return e$(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=G1(e,null,n,r):zs(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:kl(n,i),_O(t,e,n,i,r);case 7:return zs(t,e,e.pendingProps,r),e.child;case 8:return zs(t,e,e.pendingProps.children,r),e.child;case 12:return zs(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,En(Q5,n._currentValue),n._currentValue=o,s!==null)if(Kl(s.value,o)){if(s.children===i.children&&!ko.current){e=dd(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=sd(-1,r&-r),l.tag=2;var c=s.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}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),bA(s.return,r,e),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(st(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),bA(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}zs(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,T1(e,r),i=Xa(i),n=n(i),e.flags|=1,zs(t,e,n,r),e.child;case 14:return n=e.type,i=kl(n,e.pendingProps),i=kl(n.type,i),xO(t,e,n,i,r);case 15:return Uq(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:kl(n,i),e5(t,e),e.tag=1,No(n)?(t=!0,Y5(e)):t=!1,T1(e,r),Dq(e,n,i),xA(e,n,i,r),AA(null,e,n,!0,t,r);case 19:return qq(t,e,r);case 22:return Bq(t,e,r)}throw Error(st(156,e.tag))};function aV(t,e){return MH(t,e)}function gpe(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 Ka(t,e,r,n){return new gpe(t,e,r,n)}function g$(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mpe(t){if(typeof t=="function")return g$(t)?1:0;if(t!=null){if(t=t.$$typeof,t===MT)return 11;if(t===OT)return 14}return 2}function Tf(t,e){var r=t.alternate;return r===null?(r=Ka(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 n5(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")g$(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case n1:return Qh(r.children,i,s,e);case RT:o=8,i|=8;break;case VC:return t=Ka(12,r,e,i|2),t.elementType=VC,t.lanes=s,t;case GC:return t=Ka(13,r,e,i),t.elementType=GC,t.lanes=s,t;case KC:return t=Ka(19,r,e,i),t.elementType=KC,t.lanes=s,t;case yH:return j4(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case gH:o=10;break e;case mH:o=9;break e;case MT:o=11;break e;case OT:o=14;break e;case tf:o=16,n=null;break e}throw Error(st(130,t==null?t:typeof t,""))}return e=Ka(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Qh(t,e,r,n){return t=Ka(7,t,n,e),t.lanes=r,t}function j4(t,e,r,n){return t=Ka(22,t,n,e),t.elementType=yH,t.lanes=r,t.stateNode={isHidden:!1},t}function p9(t,e,r){return t=Ka(6,t,null,e),t.lanes=r,t}function g9(t,e,r){return e=Ka(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function ype(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=Yx(0),this.expirationTimes=Yx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yx(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function m$(t,e,r,n,i,s,o,a,l){return t=new ype(t,e,r,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ka(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},XT(s),t}function vpe(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dV)}catch(t){console.error(t)}}dV(),dH.exports=ba;var zl=dH.exports,fV,jO=zl;fV=jO.createRoot,jO.hydrateRoot;const Epe="modulepreload",Cpe=function(t){return"/"+t},DO={},Oo=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(r.map(l=>{if(l=Cpe(l),l in DO)return;DO[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":Epe,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),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 s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},Ape="logger/5.7.0";let LO=!1,FO=!1;const i5={debug:1,default:2,info:2,warning:3,error:4,off:5};let UO=i5.default,m9=null;function Spe(){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 BO=Spe();var DA;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(DA||(DA={}));var xs;(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"})(xs||(xs={}));const WO="0123456789abcdef";class Pe{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();i5[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(UO>i5[n])&&console.log.apply(console,r)}debug(...e){this._log(Pe.levels.DEBUG,e)}info(...e){this._log(Pe.levels.INFO,e)}warn(...e){this._log(Pe.levels.WARNING,e)}makeError(e,r,n){if(FO)return this.makeError("censored error",r,{});r||(r=Pe.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+=WO[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 s=e;let o="";switch(r){case xs.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case xs.CALL_EXCEPTION:case xs.INSUFFICIENT_FUNDS:case xs.MISSING_NEW:case xs.NONCE_EXPIRED:case xs.REPLACEMENT_UNDERPRICED:case xs.TRANSACTION_REPLACED:case xs.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(l){a[l]=n[l]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Pe.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){BO&&this.throwError("platform missing String.prototype.normalize",Pe.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:BO})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Pe.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Pe.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,Pe.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Pe.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",Pe.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Pe.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return m9||(m9=new Pe(Ape)),m9}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Pe.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),LO){if(!e)return;this.globalLogger().throwError("error censorship permanent",Pe.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}FO=!!e,LO=!!r}static setLogLevel(e){const r=i5[e.toLowerCase()];if(r==null){Pe.globalLogger().warn("invalid log level - "+e);return}UO=r}static from(e){return new Pe(e)}}Pe.errors=xs;Pe.levels=DA;const Ipe="bytes/5.7.0",Qn=new Pe(Ipe);function hV(t){return!!t.toHexString}function k1(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return k1(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function b$(t){return Vr(t)&&!(t.length%2)||kg(t)}function zO(t){return typeof t=="number"&&t==t&&t%1===0}function kg(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!zO(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"){Qn.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),k1(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),hV(t)&&(t=t.toHexString()),Vr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Qn.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ier(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),k1(n)}function m0(t){let e=er(t);if(e.length===0)return e;let r=0;for(;re&&Qn.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),k1(r)}function Vr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const y9="0123456789abcdef";function Bt(t,e){if(e||(e={}),typeof t=="number"){Qn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=y9[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),hV(t))return t.toHexString();if(Vr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Qn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(kg(t)){let r="0x";for(let n=0;n>4]+y9[i&15]}return r}return Qn.throwArgumentError("invalid hexlify value","value",t)}function y0(t){if(typeof t!="string")t=Bt(t);else if(!Vr(t)||t.length%2)return null;return(t.length-2)/2}function Es(t,e,r){return typeof t!="string"?t=Bt(t):(!Vr(t)||t.length%2)&&Qn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function So(t){let e="0x";return t.forEach(r=>{e+=Bt(r).substring(2)}),e}function _$(t){const e=$pe(Bt(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function $pe(t){typeof t!="string"&&(t=Bt(t)),Vr(t)||Qn.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&Qn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function B4(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(b$(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]):Qn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Qn.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=Tpe(er(e._vs),32);e._vs=Bt(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Qn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=Bt(i);e.s==null?e.s=o:e.s!==o&&Qn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Qn.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&&Qn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Vr(e.r)?Qn.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ln(e.r,32),e.s==null||!Vr(e.s)?Qn.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ln(e.s,32);const r=er(e.s);r[0]>=128&&Qn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=Bt(r);e._vs&&(Vr(e._vs)||Qn.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ln(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Qn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var x$={exports:{}};const kpe={},Npe=Object.freeze(Object.defineProperty({__proto__:null,default:kpe},Symbol.toStringTag,{value:"Module"})),Ng=qf(Npe);x$.exports;(function(t){(function(e,r){function n(k,b){if(!k)throw new Error(b||"Assertion failed")}function i(k,b){k.super_=b;var x=function(){};x.prototype=b.prototype,k.prototype=new x,k.prototype.constructor=k}function s(k,b,x){if(s.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((b==="le"||b==="be")&&(x=b,b=10),this._init(k||0,b||10,x||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ng.Buffer}catch{}s.isBN=function(b){return b instanceof s?!0:b!==null&&typeof b=="object"&&b.constructor.wordSize===s.wordSize&&Array.isArray(b.words)},s.max=function(b,x){return b.cmp(x)>0?b:x},s.min=function(b,x){return b.cmp(x)<0?b:x},s.prototype._init=function(b,x,P){if(typeof b=="number")return this._initNumber(b,x,P);if(typeof b=="object")return this._initArray(b,x,P);x==="hex"&&(x=16),n(x===(x|0)&&x>=2&&x<=36),b=b.toString().replace(/\s+/g,"");var L=0;b[0]==="-"&&(L++,this.negative=1),L=0;L-=3)j=b[L]|b[L-1]<<8|b[L-2]<<16,this.words[O]|=j<>>26-I&67108863,I+=24,I>=26&&(I-=26,O++);else if(P==="le")for(L=0,O=0;L>>26-I&67108863,I+=24,I>=26&&(I-=26,O++);return this._strip()};function a(k,b){var x=k.charCodeAt(b);if(x>=48&&x<=57)return x-48;if(x>=65&&x<=70)return x-55;if(x>=97&&x<=102)return x-87;n(!1,"Invalid character in "+k)}function l(k,b,x){var P=a(k,x);return x-1>=b&&(P|=a(k,x-1)<<4),P}s.prototype._parseHex=function(b,x,P){this.length=Math.ceil((b.length-x)/6),this.words=new Array(this.length);for(var L=0;L=x;L-=2)I=l(b,x,L)<=18?(O-=18,j+=1,this.words[j]|=I>>>26):O+=8;else{var D=b.length-x;for(L=D%2===0?x+1:x;L=18?(O-=18,j+=1,this.words[j]|=I>>>26):O+=8}this._strip()};function c(k,b,x,P){for(var L=0,O=0,j=Math.min(k.length,x),I=b;I=49?O=D-49+10:D>=17?O=D-17+10:O=D,n(D>=0&&O1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.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];s.prototype.toString=function(b,x){b=b||10,x=x|0||1;var P;if(b===16||b==="hex"){P="";for(var L=0,O=0,j=0;j>>24-L&16777215,L+=2,L>=26&&(L-=26,j--),O!==0||j!==this.length-1?P=h[6-D.length]+D+P:P=D+P}for(O!==0&&(P=O.toString(16)+P);P.length%x!==0;)P="0"+P;return this.negative!==0&&(P="-"+P),P}if(b===(b|0)&&b>=2&&b<=36){var M=g[b],X=m[b];P="";var le=this.clone();for(le.negative=0;!le.isZero();){var H=le.modrn(X).toString(b);le=le.idivn(X),le.isZero()?P=H+P:P=h[M-H.length]+H+P}for(this.isZero()&&(P="0"+P);P.length%x!==0;)P="0"+P;return this.negative!==0&&(P="-"+P),P}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var b=this.words[0];return this.length===2?b+=this.words[1]*67108864:this.length===3&&this.words[2]===1?b+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-b:b},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(b,x){return this.toArrayLike(o,b,x)}),s.prototype.toArray=function(b,x){return this.toArrayLike(Array,b,x)};var w=function(b,x){return b.allocUnsafe?b.allocUnsafe(x):new b(x)};s.prototype.toArrayLike=function(b,x,P){this._strip();var L=this.byteLength(),O=P||Math.max(1,L);n(L<=O,"byte array longer than desired length"),n(O>0,"Requested array length <= 0");var j=w(b,O),I=x==="le"?"LE":"BE";return this["_toArrayLike"+I](j,L),j},s.prototype._toArrayLikeLE=function(b,x){for(var P=0,L=0,O=0,j=0;O>8&255),P>16&255),j===6?(P>24&255),L=0,j=0):(L=I>>>24,j+=2)}if(P=0&&(b[P--]=I>>8&255),P>=0&&(b[P--]=I>>16&255),j===6?(P>=0&&(b[P--]=I>>24&255),L=0,j=0):(L=I>>>24,j+=2)}if(P>=0)for(b[P--]=L;P>=0;)b[P--]=0},Math.clz32?s.prototype._countBits=function(b){return 32-Math.clz32(b)}:s.prototype._countBits=function(b){var x=b,P=0;return x>=4096&&(P+=13,x>>>=13),x>=64&&(P+=7,x>>>=7),x>=8&&(P+=4,x>>>=4),x>=2&&(P+=2,x>>>=2),P+x},s.prototype._zeroBits=function(b){if(b===0)return 26;var x=b,P=0;return x&8191||(P+=13,x>>>=13),x&127||(P+=7,x>>>=7),x&15||(P+=4,x>>>=4),x&3||(P+=2,x>>>=2),x&1||P++,P},s.prototype.bitLength=function(){var b=this.words[this.length-1],x=this._countBits(b);return(this.length-1)*26+x};function E(k){for(var b=new Array(k.bitLength()),x=0;x>>L&1}return b}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var b=0,x=0;xb.length?this.clone().ior(b):b.clone().ior(this)},s.prototype.uor=function(b){return this.length>b.length?this.clone().iuor(b):b.clone().iuor(this)},s.prototype.iuand=function(b){var x;this.length>b.length?x=b:x=this;for(var P=0;Pb.length?this.clone().iand(b):b.clone().iand(this)},s.prototype.uand=function(b){return this.length>b.length?this.clone().iuand(b):b.clone().iuand(this)},s.prototype.iuxor=function(b){var x,P;this.length>b.length?(x=this,P=b):(x=b,P=this);for(var L=0;Lb.length?this.clone().ixor(b):b.clone().ixor(this)},s.prototype.uxor=function(b){return this.length>b.length?this.clone().iuxor(b):b.clone().iuxor(this)},s.prototype.inotn=function(b){n(typeof b=="number"&&b>=0);var x=Math.ceil(b/26)|0,P=b%26;this._expand(x),P>0&&x--;for(var L=0;L0&&(this.words[L]=~this.words[L]&67108863>>26-P),this._strip()},s.prototype.notn=function(b){return this.clone().inotn(b)},s.prototype.setn=function(b,x){n(typeof b=="number"&&b>=0);var P=b/26|0,L=b%26;return this._expand(P+1),x?this.words[P]=this.words[P]|1<b.length?(P=this,L=b):(P=b,L=this);for(var O=0,j=0;j>>26;for(;O!==0&&j>>26;if(this.length=P.length,O!==0)this.words[this.length]=O,this.length++;else if(P!==this)for(;jb.length?this.clone().iadd(b):b.clone().iadd(this)},s.prototype.isub=function(b){if(b.negative!==0){b.negative=0;var x=this.iadd(b);return b.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(b),this.negative=1,this._normSign();var P=this.cmp(b);if(P===0)return this.negative=0,this.length=1,this.words[0]=0,this;var L,O;P>0?(L=this,O=b):(L=b,O=this);for(var j=0,I=0;I>26,this.words[I]=x&67108863;for(;j!==0&&I>26,this.words[I]=x&67108863;if(j===0&&I>>26,le=D&67108863,H=Math.min(M,b.length-1),ee=Math.max(0,M-k.length+1);ee<=H;ee++){var Z=M-ee|0;L=k.words[Z]|0,O=b.words[ee]|0,j=L*O+le,X+=j/67108864|0,le=j&67108863}x.words[M]=le|0,D=X|0}return D!==0?x.words[M]=D|0:x.length--,x._strip()}var _=function(b,x,P){var L=b.words,O=x.words,j=P.words,I=0,D,M,X,le=L[0]|0,H=le&8191,ee=le>>>13,Z=L[1]|0,te=Z&8191,re=Z>>>13,W=L[2]|0,q=W&8191,J=W>>>13,me=L[3]|0,be=me&8191,Ce=me>>>13,Fe=L[4]|0,Ue=Fe&8191,Ye=Fe>>>13,lt=L[5]|0,xe=lt&8191,He=lt>>>13,Ve=L[6]|0,Ie=Ve&8191,Ne=Ve>>>13,Oe=L[7]|0,Me=Oe&8191,Y=Oe>>>13,F=L[8]|0,z=F&8191,ie=F>>>13,pe=L[9]|0,ve=pe&8191,he=pe>>>13,De=O[0]|0,Ze=De&8191,et=De>>>13,it=O[1]|0,ut=it&8191,pt=it>>>13,tr=O[2]|0,Wt=tr&8191,At=tr>>>13,mt=O[3]|0,Ct=mt&8191,dt=mt>>>13,Nt=O[4]|0,jt=Nt&8191,gt=Nt>>>13,Vt=O[5]|0,zt=Vt&8191,at=Vt>>>13,Gt=O[6]|0,Ft=Gt&8191,yt=Gt>>>13,Qe=O[7]|0,Ot=Qe&8191,_t=Qe>>>13,Zt=O[8]|0,Cr=Zt&8191,qt=Zt>>>13,Ar=O[9]|0,cr=Ar&8191,br=Ar>>>13;P.negative=b.negative^x.negative,P.length=19,D=Math.imul(H,Ze),M=Math.imul(H,et),M=M+Math.imul(ee,Ze)|0,X=Math.imul(ee,et);var Q=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(Q>>>26)|0,Q&=67108863,D=Math.imul(te,Ze),M=Math.imul(te,et),M=M+Math.imul(re,Ze)|0,X=Math.imul(re,et),D=D+Math.imul(H,ut)|0,M=M+Math.imul(H,pt)|0,M=M+Math.imul(ee,ut)|0,X=X+Math.imul(ee,pt)|0;var se=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(se>>>26)|0,se&=67108863,D=Math.imul(q,Ze),M=Math.imul(q,et),M=M+Math.imul(J,Ze)|0,X=Math.imul(J,et),D=D+Math.imul(te,ut)|0,M=M+Math.imul(te,pt)|0,M=M+Math.imul(re,ut)|0,X=X+Math.imul(re,pt)|0,D=D+Math.imul(H,Wt)|0,M=M+Math.imul(H,At)|0,M=M+Math.imul(ee,Wt)|0,X=X+Math.imul(ee,At)|0;var de=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(de>>>26)|0,de&=67108863,D=Math.imul(be,Ze),M=Math.imul(be,et),M=M+Math.imul(Ce,Ze)|0,X=Math.imul(Ce,et),D=D+Math.imul(q,ut)|0,M=M+Math.imul(q,pt)|0,M=M+Math.imul(J,ut)|0,X=X+Math.imul(J,pt)|0,D=D+Math.imul(te,Wt)|0,M=M+Math.imul(te,At)|0,M=M+Math.imul(re,Wt)|0,X=X+Math.imul(re,At)|0,D=D+Math.imul(H,Ct)|0,M=M+Math.imul(H,dt)|0,M=M+Math.imul(ee,Ct)|0,X=X+Math.imul(ee,dt)|0;var ue=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(ue>>>26)|0,ue&=67108863,D=Math.imul(Ue,Ze),M=Math.imul(Ue,et),M=M+Math.imul(Ye,Ze)|0,X=Math.imul(Ye,et),D=D+Math.imul(be,ut)|0,M=M+Math.imul(be,pt)|0,M=M+Math.imul(Ce,ut)|0,X=X+Math.imul(Ce,pt)|0,D=D+Math.imul(q,Wt)|0,M=M+Math.imul(q,At)|0,M=M+Math.imul(J,Wt)|0,X=X+Math.imul(J,At)|0,D=D+Math.imul(te,Ct)|0,M=M+Math.imul(te,dt)|0,M=M+Math.imul(re,Ct)|0,X=X+Math.imul(re,dt)|0,D=D+Math.imul(H,jt)|0,M=M+Math.imul(H,gt)|0,M=M+Math.imul(ee,jt)|0,X=X+Math.imul(ee,gt)|0;var we=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(we>>>26)|0,we&=67108863,D=Math.imul(xe,Ze),M=Math.imul(xe,et),M=M+Math.imul(He,Ze)|0,X=Math.imul(He,et),D=D+Math.imul(Ue,ut)|0,M=M+Math.imul(Ue,pt)|0,M=M+Math.imul(Ye,ut)|0,X=X+Math.imul(Ye,pt)|0,D=D+Math.imul(be,Wt)|0,M=M+Math.imul(be,At)|0,M=M+Math.imul(Ce,Wt)|0,X=X+Math.imul(Ce,At)|0,D=D+Math.imul(q,Ct)|0,M=M+Math.imul(q,dt)|0,M=M+Math.imul(J,Ct)|0,X=X+Math.imul(J,dt)|0,D=D+Math.imul(te,jt)|0,M=M+Math.imul(te,gt)|0,M=M+Math.imul(re,jt)|0,X=X+Math.imul(re,gt)|0,D=D+Math.imul(H,zt)|0,M=M+Math.imul(H,at)|0,M=M+Math.imul(ee,zt)|0,X=X+Math.imul(ee,at)|0;var Re=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(Re>>>26)|0,Re&=67108863,D=Math.imul(Ie,Ze),M=Math.imul(Ie,et),M=M+Math.imul(Ne,Ze)|0,X=Math.imul(Ne,et),D=D+Math.imul(xe,ut)|0,M=M+Math.imul(xe,pt)|0,M=M+Math.imul(He,ut)|0,X=X+Math.imul(He,pt)|0,D=D+Math.imul(Ue,Wt)|0,M=M+Math.imul(Ue,At)|0,M=M+Math.imul(Ye,Wt)|0,X=X+Math.imul(Ye,At)|0,D=D+Math.imul(be,Ct)|0,M=M+Math.imul(be,dt)|0,M=M+Math.imul(Ce,Ct)|0,X=X+Math.imul(Ce,dt)|0,D=D+Math.imul(q,jt)|0,M=M+Math.imul(q,gt)|0,M=M+Math.imul(J,jt)|0,X=X+Math.imul(J,gt)|0,D=D+Math.imul(te,zt)|0,M=M+Math.imul(te,at)|0,M=M+Math.imul(re,zt)|0,X=X+Math.imul(re,at)|0,D=D+Math.imul(H,Ft)|0,M=M+Math.imul(H,yt)|0,M=M+Math.imul(ee,Ft)|0,X=X+Math.imul(ee,yt)|0;var qe=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(qe>>>26)|0,qe&=67108863,D=Math.imul(Me,Ze),M=Math.imul(Me,et),M=M+Math.imul(Y,Ze)|0,X=Math.imul(Y,et),D=D+Math.imul(Ie,ut)|0,M=M+Math.imul(Ie,pt)|0,M=M+Math.imul(Ne,ut)|0,X=X+Math.imul(Ne,pt)|0,D=D+Math.imul(xe,Wt)|0,M=M+Math.imul(xe,At)|0,M=M+Math.imul(He,Wt)|0,X=X+Math.imul(He,At)|0,D=D+Math.imul(Ue,Ct)|0,M=M+Math.imul(Ue,dt)|0,M=M+Math.imul(Ye,Ct)|0,X=X+Math.imul(Ye,dt)|0,D=D+Math.imul(be,jt)|0,M=M+Math.imul(be,gt)|0,M=M+Math.imul(Ce,jt)|0,X=X+Math.imul(Ce,gt)|0,D=D+Math.imul(q,zt)|0,M=M+Math.imul(q,at)|0,M=M+Math.imul(J,zt)|0,X=X+Math.imul(J,at)|0,D=D+Math.imul(te,Ft)|0,M=M+Math.imul(te,yt)|0,M=M+Math.imul(re,Ft)|0,X=X+Math.imul(re,yt)|0,D=D+Math.imul(H,Ot)|0,M=M+Math.imul(H,_t)|0,M=M+Math.imul(ee,Ot)|0,X=X+Math.imul(ee,_t)|0;var Be=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(Be>>>26)|0,Be&=67108863,D=Math.imul(z,Ze),M=Math.imul(z,et),M=M+Math.imul(ie,Ze)|0,X=Math.imul(ie,et),D=D+Math.imul(Me,ut)|0,M=M+Math.imul(Me,pt)|0,M=M+Math.imul(Y,ut)|0,X=X+Math.imul(Y,pt)|0,D=D+Math.imul(Ie,Wt)|0,M=M+Math.imul(Ie,At)|0,M=M+Math.imul(Ne,Wt)|0,X=X+Math.imul(Ne,At)|0,D=D+Math.imul(xe,Ct)|0,M=M+Math.imul(xe,dt)|0,M=M+Math.imul(He,Ct)|0,X=X+Math.imul(He,dt)|0,D=D+Math.imul(Ue,jt)|0,M=M+Math.imul(Ue,gt)|0,M=M+Math.imul(Ye,jt)|0,X=X+Math.imul(Ye,gt)|0,D=D+Math.imul(be,zt)|0,M=M+Math.imul(be,at)|0,M=M+Math.imul(Ce,zt)|0,X=X+Math.imul(Ce,at)|0,D=D+Math.imul(q,Ft)|0,M=M+Math.imul(q,yt)|0,M=M+Math.imul(J,Ft)|0,X=X+Math.imul(J,yt)|0,D=D+Math.imul(te,Ot)|0,M=M+Math.imul(te,_t)|0,M=M+Math.imul(re,Ot)|0,X=X+Math.imul(re,_t)|0,D=D+Math.imul(H,Cr)|0,M=M+Math.imul(H,qt)|0,M=M+Math.imul(ee,Cr)|0,X=X+Math.imul(ee,qt)|0;var tt=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(tt>>>26)|0,tt&=67108863,D=Math.imul(ve,Ze),M=Math.imul(ve,et),M=M+Math.imul(he,Ze)|0,X=Math.imul(he,et),D=D+Math.imul(z,ut)|0,M=M+Math.imul(z,pt)|0,M=M+Math.imul(ie,ut)|0,X=X+Math.imul(ie,pt)|0,D=D+Math.imul(Me,Wt)|0,M=M+Math.imul(Me,At)|0,M=M+Math.imul(Y,Wt)|0,X=X+Math.imul(Y,At)|0,D=D+Math.imul(Ie,Ct)|0,M=M+Math.imul(Ie,dt)|0,M=M+Math.imul(Ne,Ct)|0,X=X+Math.imul(Ne,dt)|0,D=D+Math.imul(xe,jt)|0,M=M+Math.imul(xe,gt)|0,M=M+Math.imul(He,jt)|0,X=X+Math.imul(He,gt)|0,D=D+Math.imul(Ue,zt)|0,M=M+Math.imul(Ue,at)|0,M=M+Math.imul(Ye,zt)|0,X=X+Math.imul(Ye,at)|0,D=D+Math.imul(be,Ft)|0,M=M+Math.imul(be,yt)|0,M=M+Math.imul(Ce,Ft)|0,X=X+Math.imul(Ce,yt)|0,D=D+Math.imul(q,Ot)|0,M=M+Math.imul(q,_t)|0,M=M+Math.imul(J,Ot)|0,X=X+Math.imul(J,_t)|0,D=D+Math.imul(te,Cr)|0,M=M+Math.imul(te,qt)|0,M=M+Math.imul(re,Cr)|0,X=X+Math.imul(re,qt)|0,D=D+Math.imul(H,cr)|0,M=M+Math.imul(H,br)|0,M=M+Math.imul(ee,cr)|0,X=X+Math.imul(ee,br)|0;var wt=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(wt>>>26)|0,wt&=67108863,D=Math.imul(ve,ut),M=Math.imul(ve,pt),M=M+Math.imul(he,ut)|0,X=Math.imul(he,pt),D=D+Math.imul(z,Wt)|0,M=M+Math.imul(z,At)|0,M=M+Math.imul(ie,Wt)|0,X=X+Math.imul(ie,At)|0,D=D+Math.imul(Me,Ct)|0,M=M+Math.imul(Me,dt)|0,M=M+Math.imul(Y,Ct)|0,X=X+Math.imul(Y,dt)|0,D=D+Math.imul(Ie,jt)|0,M=M+Math.imul(Ie,gt)|0,M=M+Math.imul(Ne,jt)|0,X=X+Math.imul(Ne,gt)|0,D=D+Math.imul(xe,zt)|0,M=M+Math.imul(xe,at)|0,M=M+Math.imul(He,zt)|0,X=X+Math.imul(He,at)|0,D=D+Math.imul(Ue,Ft)|0,M=M+Math.imul(Ue,yt)|0,M=M+Math.imul(Ye,Ft)|0,X=X+Math.imul(Ye,yt)|0,D=D+Math.imul(be,Ot)|0,M=M+Math.imul(be,_t)|0,M=M+Math.imul(Ce,Ot)|0,X=X+Math.imul(Ce,_t)|0,D=D+Math.imul(q,Cr)|0,M=M+Math.imul(q,qt)|0,M=M+Math.imul(J,Cr)|0,X=X+Math.imul(J,qt)|0,D=D+Math.imul(te,cr)|0,M=M+Math.imul(te,br)|0,M=M+Math.imul(re,cr)|0,X=X+Math.imul(re,br)|0;var Pt=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,D=Math.imul(ve,Wt),M=Math.imul(ve,At),M=M+Math.imul(he,Wt)|0,X=Math.imul(he,At),D=D+Math.imul(z,Ct)|0,M=M+Math.imul(z,dt)|0,M=M+Math.imul(ie,Ct)|0,X=X+Math.imul(ie,dt)|0,D=D+Math.imul(Me,jt)|0,M=M+Math.imul(Me,gt)|0,M=M+Math.imul(Y,jt)|0,X=X+Math.imul(Y,gt)|0,D=D+Math.imul(Ie,zt)|0,M=M+Math.imul(Ie,at)|0,M=M+Math.imul(Ne,zt)|0,X=X+Math.imul(Ne,at)|0,D=D+Math.imul(xe,Ft)|0,M=M+Math.imul(xe,yt)|0,M=M+Math.imul(He,Ft)|0,X=X+Math.imul(He,yt)|0,D=D+Math.imul(Ue,Ot)|0,M=M+Math.imul(Ue,_t)|0,M=M+Math.imul(Ye,Ot)|0,X=X+Math.imul(Ye,_t)|0,D=D+Math.imul(be,Cr)|0,M=M+Math.imul(be,qt)|0,M=M+Math.imul(Ce,Cr)|0,X=X+Math.imul(Ce,qt)|0,D=D+Math.imul(q,cr)|0,M=M+Math.imul(q,br)|0,M=M+Math.imul(J,cr)|0,X=X+Math.imul(J,br)|0;var Et=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(Et>>>26)|0,Et&=67108863,D=Math.imul(ve,Ct),M=Math.imul(ve,dt),M=M+Math.imul(he,Ct)|0,X=Math.imul(he,dt),D=D+Math.imul(z,jt)|0,M=M+Math.imul(z,gt)|0,M=M+Math.imul(ie,jt)|0,X=X+Math.imul(ie,gt)|0,D=D+Math.imul(Me,zt)|0,M=M+Math.imul(Me,at)|0,M=M+Math.imul(Y,zt)|0,X=X+Math.imul(Y,at)|0,D=D+Math.imul(Ie,Ft)|0,M=M+Math.imul(Ie,yt)|0,M=M+Math.imul(Ne,Ft)|0,X=X+Math.imul(Ne,yt)|0,D=D+Math.imul(xe,Ot)|0,M=M+Math.imul(xe,_t)|0,M=M+Math.imul(He,Ot)|0,X=X+Math.imul(He,_t)|0,D=D+Math.imul(Ue,Cr)|0,M=M+Math.imul(Ue,qt)|0,M=M+Math.imul(Ye,Cr)|0,X=X+Math.imul(Ye,qt)|0,D=D+Math.imul(be,cr)|0,M=M+Math.imul(be,br)|0,M=M+Math.imul(Ce,cr)|0,X=X+Math.imul(Ce,br)|0;var ir=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(ir>>>26)|0,ir&=67108863,D=Math.imul(ve,jt),M=Math.imul(ve,gt),M=M+Math.imul(he,jt)|0,X=Math.imul(he,gt),D=D+Math.imul(z,zt)|0,M=M+Math.imul(z,at)|0,M=M+Math.imul(ie,zt)|0,X=X+Math.imul(ie,at)|0,D=D+Math.imul(Me,Ft)|0,M=M+Math.imul(Me,yt)|0,M=M+Math.imul(Y,Ft)|0,X=X+Math.imul(Y,yt)|0,D=D+Math.imul(Ie,Ot)|0,M=M+Math.imul(Ie,_t)|0,M=M+Math.imul(Ne,Ot)|0,X=X+Math.imul(Ne,_t)|0,D=D+Math.imul(xe,Cr)|0,M=M+Math.imul(xe,qt)|0,M=M+Math.imul(He,Cr)|0,X=X+Math.imul(He,qt)|0,D=D+Math.imul(Ue,cr)|0,M=M+Math.imul(Ue,br)|0,M=M+Math.imul(Ye,cr)|0,X=X+Math.imul(Ye,br)|0;var Qt=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,D=Math.imul(ve,zt),M=Math.imul(ve,at),M=M+Math.imul(he,zt)|0,X=Math.imul(he,at),D=D+Math.imul(z,Ft)|0,M=M+Math.imul(z,yt)|0,M=M+Math.imul(ie,Ft)|0,X=X+Math.imul(ie,yt)|0,D=D+Math.imul(Me,Ot)|0,M=M+Math.imul(Me,_t)|0,M=M+Math.imul(Y,Ot)|0,X=X+Math.imul(Y,_t)|0,D=D+Math.imul(Ie,Cr)|0,M=M+Math.imul(Ie,qt)|0,M=M+Math.imul(Ne,Cr)|0,X=X+Math.imul(Ne,qt)|0,D=D+Math.imul(xe,cr)|0,M=M+Math.imul(xe,br)|0,M=M+Math.imul(He,cr)|0,X=X+Math.imul(He,br)|0;var rn=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(rn>>>26)|0,rn&=67108863,D=Math.imul(ve,Ft),M=Math.imul(ve,yt),M=M+Math.imul(he,Ft)|0,X=Math.imul(he,yt),D=D+Math.imul(z,Ot)|0,M=M+Math.imul(z,_t)|0,M=M+Math.imul(ie,Ot)|0,X=X+Math.imul(ie,_t)|0,D=D+Math.imul(Me,Cr)|0,M=M+Math.imul(Me,qt)|0,M=M+Math.imul(Y,Cr)|0,X=X+Math.imul(Y,qt)|0,D=D+Math.imul(Ie,cr)|0,M=M+Math.imul(Ie,br)|0,M=M+Math.imul(Ne,cr)|0,X=X+Math.imul(Ne,br)|0;var Mr=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,D=Math.imul(ve,Ot),M=Math.imul(ve,_t),M=M+Math.imul(he,Ot)|0,X=Math.imul(he,_t),D=D+Math.imul(z,Cr)|0,M=M+Math.imul(z,qt)|0,M=M+Math.imul(ie,Cr)|0,X=X+Math.imul(ie,qt)|0,D=D+Math.imul(Me,cr)|0,M=M+Math.imul(Me,br)|0,M=M+Math.imul(Y,cr)|0,X=X+Math.imul(Y,br)|0;var ln=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(ln>>>26)|0,ln&=67108863,D=Math.imul(ve,Cr),M=Math.imul(ve,qt),M=M+Math.imul(he,Cr)|0,X=Math.imul(he,qt),D=D+Math.imul(z,cr)|0,M=M+Math.imul(z,br)|0,M=M+Math.imul(ie,cr)|0,X=X+Math.imul(ie,br)|0;var Ds=(I+D|0)+((M&8191)<<13)|0;I=(X+(M>>>13)|0)+(Ds>>>26)|0,Ds&=67108863,D=Math.imul(ve,cr),M=Math.imul(ve,br),M=M+Math.imul(he,cr)|0,X=Math.imul(he,br);var co=(I+D|0)+((M&8191)<<13)|0;return I=(X+(M>>>13)|0)+(co>>>26)|0,co&=67108863,j[0]=Q,j[1]=se,j[2]=de,j[3]=ue,j[4]=we,j[5]=Re,j[6]=qe,j[7]=Be,j[8]=tt,j[9]=wt,j[10]=Pt,j[11]=Et,j[12]=ir,j[13]=Qt,j[14]=rn,j[15]=Mr,j[16]=ln,j[17]=Ds,j[18]=co,I!==0&&(j[19]=I,P.length++),P};Math.imul||(_=v);function A(k,b,x){x.negative=b.negative^k.negative,x.length=k.length+b.length;for(var P=0,L=0,O=0;O>>26)|0,L+=j>>>26,j&=67108863}x.words[O]=I,P=j,j=L}return P!==0?x.words[O]=P:x.length--,x._strip()}function C(k,b,x){return A(k,b,x)}s.prototype.mulTo=function(b,x){var P,L=this.length+b.length;return this.length===10&&b.length===10?P=_(this,b,x):L<63?P=v(this,b,x):L<1024?P=A(this,b,x):P=C(this,b,x),P},s.prototype.mul=function(b){var x=new s(null);return x.words=new Array(this.length+b.length),this.mulTo(b,x)},s.prototype.mulf=function(b){var x=new s(null);return x.words=new Array(this.length+b.length),C(this,b,x)},s.prototype.imul=function(b){return this.clone().mulTo(b,this)},s.prototype.imuln=function(b){var x=b<0;x&&(b=-b),n(typeof b=="number"),n(b<67108864);for(var P=0,L=0;L>=26,P+=O/67108864|0,P+=j>>>26,this.words[L]=j&67108863}return P!==0&&(this.words[L]=P,this.length++),x?this.ineg():this},s.prototype.muln=function(b){return this.clone().imuln(b)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(b){var x=E(b);if(x.length===0)return new s(1);for(var P=this,L=0;L=0);var x=b%26,P=(b-x)/26,L=67108863>>>26-x<<26-x,O;if(x!==0){var j=0;for(O=0;O>>26-x}j&&(this.words[O]=j,this.length++)}if(P!==0){for(O=this.length-1;O>=0;O--)this.words[O+P]=this.words[O];for(O=0;O=0);var L;x?L=(x-x%26)/26:L=0;var O=b%26,j=Math.min((b-O)/26,this.length),I=67108863^67108863>>>O<j)for(this.length-=j,M=0;M=0&&(X!==0||M>=L);M--){var le=this.words[M]|0;this.words[M]=X<<26-O|le>>>O,X=le&I}return D&&X!==0&&(D.words[D.length++]=X),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(b,x,P){return n(this.negative===0),this.iushrn(b,x,P)},s.prototype.shln=function(b){return this.clone().ishln(b)},s.prototype.ushln=function(b){return this.clone().iushln(b)},s.prototype.shrn=function(b){return this.clone().ishrn(b)},s.prototype.ushrn=function(b){return this.clone().iushrn(b)},s.prototype.testn=function(b){n(typeof b=="number"&&b>=0);var x=b%26,P=(b-x)/26,L=1<=0);var x=b%26,P=(b-x)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=P)return this;if(x!==0&&P++,this.length=Math.min(P,this.length),x!==0){var L=67108863^67108863>>>x<=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},s.prototype.isubn=function(b){if(n(typeof b=="number"),n(b<67108864),b<0)return this.iaddn(-b);if(this.negative!==0)return this.negative=0,this.iaddn(b),this.negative=1,this;if(this.words[0]-=b,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x>26)-(D/67108864|0),this.words[O+P]=j&67108863}for(;O>26,this.words[O+P]=j&67108863;if(I===0)return this._strip();for(n(I===-1),I=0,O=0;O>26,this.words[O]=j&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(b,x){var P=this.length-b.length,L=this.clone(),O=b,j=O.words[O.length-1]|0,I=this._countBits(j);P=26-I,P!==0&&(O=O.ushln(P),L.iushln(P),j=O.words[O.length-1]|0);var D=L.length-O.length,M;if(x!=="mod"){M=new s(null),M.length=D+1,M.words=new Array(M.length);for(var X=0;X=0;H--){var ee=(L.words[O.length+H]|0)*67108864+(L.words[O.length+H-1]|0);for(ee=Math.min(ee/j|0,67108863),L._ishlnsubmul(O,ee,H);L.negative!==0;)ee--,L.negative=0,L._ishlnsubmul(O,1,H),L.isZero()||(L.negative^=1);M&&(M.words[H]=ee)}return M&&M._strip(),L._strip(),x!=="div"&&P!==0&&L.iushrn(P),{div:M||null,mod:L}},s.prototype.divmod=function(b,x,P){if(n(!b.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var L,O,j;return this.negative!==0&&b.negative===0?(j=this.neg().divmod(b,x),x!=="mod"&&(L=j.div.neg()),x!=="div"&&(O=j.mod.neg(),P&&O.negative!==0&&O.iadd(b)),{div:L,mod:O}):this.negative===0&&b.negative!==0?(j=this.divmod(b.neg(),x),x!=="mod"&&(L=j.div.neg()),{div:L,mod:j.mod}):this.negative&b.negative?(j=this.neg().divmod(b.neg(),x),x!=="div"&&(O=j.mod.neg(),P&&O.negative!==0&&O.isub(b)),{div:j.div,mod:O}):b.length>this.length||this.cmp(b)<0?{div:new s(0),mod:this}:b.length===1?x==="div"?{div:this.divn(b.words[0]),mod:null}:x==="mod"?{div:null,mod:new s(this.modrn(b.words[0]))}:{div:this.divn(b.words[0]),mod:new s(this.modrn(b.words[0]))}:this._wordDiv(b,x)},s.prototype.div=function(b){return this.divmod(b,"div",!1).div},s.prototype.mod=function(b){return this.divmod(b,"mod",!1).mod},s.prototype.umod=function(b){return this.divmod(b,"mod",!0).mod},s.prototype.divRound=function(b){var x=this.divmod(b);if(x.mod.isZero())return x.div;var P=x.div.negative!==0?x.mod.isub(b):x.mod,L=b.ushrn(1),O=b.andln(1),j=P.cmp(L);return j<0||O===1&&j===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},s.prototype.modrn=function(b){var x=b<0;x&&(b=-b),n(b<=67108863);for(var P=(1<<26)%b,L=0,O=this.length-1;O>=0;O--)L=(P*L+(this.words[O]|0))%b;return x?-L:L},s.prototype.modn=function(b){return this.modrn(b)},s.prototype.idivn=function(b){var x=b<0;x&&(b=-b),n(b<=67108863);for(var P=0,L=this.length-1;L>=0;L--){var O=(this.words[L]|0)+P*67108864;this.words[L]=O/b|0,P=O%b}return this._strip(),x?this.ineg():this},s.prototype.divn=function(b){return this.clone().idivn(b)},s.prototype.egcd=function(b){n(b.negative===0),n(!b.isZero());var x=this,P=b.clone();x.negative!==0?x=x.umod(b):x=x.clone();for(var L=new s(1),O=new s(0),j=new s(0),I=new s(1),D=0;x.isEven()&&P.isEven();)x.iushrn(1),P.iushrn(1),++D;for(var M=P.clone(),X=x.clone();!x.isZero();){for(var le=0,H=1;!(x.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(x.iushrn(le);le-- >0;)(L.isOdd()||O.isOdd())&&(L.iadd(M),O.isub(X)),L.iushrn(1),O.iushrn(1);for(var ee=0,Z=1;!(P.words[0]&Z)&&ee<26;++ee,Z<<=1);if(ee>0)for(P.iushrn(ee);ee-- >0;)(j.isOdd()||I.isOdd())&&(j.iadd(M),I.isub(X)),j.iushrn(1),I.iushrn(1);x.cmp(P)>=0?(x.isub(P),L.isub(j),O.isub(I)):(P.isub(x),j.isub(L),I.isub(O))}return{a:j,b:I,gcd:P.iushln(D)}},s.prototype._invmp=function(b){n(b.negative===0),n(!b.isZero());var x=this,P=b.clone();x.negative!==0?x=x.umod(b):x=x.clone();for(var L=new s(1),O=new s(0),j=P.clone();x.cmpn(1)>0&&P.cmpn(1)>0;){for(var I=0,D=1;!(x.words[0]&D)&&I<26;++I,D<<=1);if(I>0)for(x.iushrn(I);I-- >0;)L.isOdd()&&L.iadd(j),L.iushrn(1);for(var M=0,X=1;!(P.words[0]&X)&&M<26;++M,X<<=1);if(M>0)for(P.iushrn(M);M-- >0;)O.isOdd()&&O.iadd(j),O.iushrn(1);x.cmp(P)>=0?(x.isub(P),L.isub(O)):(P.isub(x),O.isub(L))}var le;return x.cmpn(1)===0?le=L:le=O,le.cmpn(0)<0&&le.iadd(b),le},s.prototype.gcd=function(b){if(this.isZero())return b.abs();if(b.isZero())return this.abs();var x=this.clone(),P=b.clone();x.negative=0,P.negative=0;for(var L=0;x.isEven()&&P.isEven();L++)x.iushrn(1),P.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;P.isEven();)P.iushrn(1);var O=x.cmp(P);if(O<0){var j=x;x=P,P=j}else if(O===0||P.cmpn(1)===0)break;x.isub(P)}while(!0);return P.iushln(L)},s.prototype.invm=function(b){return this.egcd(b).a.umod(b)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(b){return this.words[0]&b},s.prototype.bincn=function(b){n(typeof b=="number");var x=b%26,P=(b-x)/26,L=1<>>26,I&=67108863,this.words[j]=I}return O!==0&&(this.words[j]=O,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(b){var x=b<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this._strip();var P;if(this.length>1)P=1;else{x&&(b=-b),n(b<=67108863,"Number is too big");var L=this.words[0]|0;P=L===b?0:Lb.length)return 1;if(this.length=0;P--){var L=this.words[P]|0,O=b.words[P]|0;if(L!==O){LO&&(x=1);break}}return x},s.prototype.gtn=function(b){return this.cmpn(b)===1},s.prototype.gt=function(b){return this.cmp(b)===1},s.prototype.gten=function(b){return this.cmpn(b)>=0},s.prototype.gte=function(b){return this.cmp(b)>=0},s.prototype.ltn=function(b){return this.cmpn(b)===-1},s.prototype.lt=function(b){return this.cmp(b)===-1},s.prototype.lten=function(b){return this.cmpn(b)<=0},s.prototype.lte=function(b){return this.cmp(b)<=0},s.prototype.eqn=function(b){return this.cmpn(b)===0},s.prototype.eq=function(b){return this.cmp(b)===0},s.red=function(b){return new K(b)},s.prototype.toRed=function(b){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),b.convertTo(this)._forceRed(b)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(b){return this.red=b,this},s.prototype.forceRed=function(b){return n(!this.red,"Already a number in reduction context"),this._forceRed(b)},s.prototype.redAdd=function(b){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,b)},s.prototype.redIAdd=function(b){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,b)},s.prototype.redSub=function(b){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,b)},s.prototype.redISub=function(b){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,b)},s.prototype.redShl=function(b){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,b)},s.prototype.redMul=function(b){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.mul(this,b)},s.prototype.redIMul=function(b){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.imul(this,b)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(b){return n(this.red&&!b.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,b)};var R={k256:null,p224:null,p192:null,p25519:null};function B(k,b){this.name=k,this.p=new s(b,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}B.prototype._tmp=function(){var b=new s(null);return b.words=new Array(Math.ceil(this.n/13)),b},B.prototype.ireduce=function(b){var x=b,P;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),P=x.bitLength();while(P>this.n);var L=P0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},B.prototype.split=function(b,x){b.iushrn(this.n,0,x)},B.prototype.imulK=function(b){return b.imul(this.k)};function S(){B.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(S,B),S.prototype.split=function(b,x){for(var P=4194303,L=Math.min(b.length,9),O=0;O>>22,j=I}j>>>=22,b.words[O-10]=j,j===0&&b.length>10?b.length-=10:b.length-=9},S.prototype.imulK=function(b){b.words[b.length]=0,b.words[b.length+1]=0,b.length+=2;for(var x=0,P=0;P>>=26,b.words[P]=O,x=L}return x!==0&&(b.words[b.length++]=x),b},s._prime=function(b){if(R[b])return R[b];var x;if(b==="k256")x=new S;else if(b==="p224")x=new U;else if(b==="p192")x=new G;else if(b==="p25519")x=new oe;else throw new Error("Unknown prime "+b);return R[b]=x,x};function K(k){if(typeof k=="string"){var b=s._prime(k);this.m=b.p,this.prime=b}else n(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}K.prototype._verify1=function(b){n(b.negative===0,"red works only with positives"),n(b.red,"red works only with red numbers")},K.prototype._verify2=function(b,x){n((b.negative|x.negative)===0,"red works only with positives"),n(b.red&&b.red===x.red,"red works only with red numbers")},K.prototype.imod=function(b){return this.prime?this.prime.ireduce(b)._forceRed(this):(u(b,b.umod(this.m)._forceRed(this)),b)},K.prototype.neg=function(b){return b.isZero()?b.clone():this.m.sub(b)._forceRed(this)},K.prototype.add=function(b,x){this._verify2(b,x);var P=b.add(x);return P.cmp(this.m)>=0&&P.isub(this.m),P._forceRed(this)},K.prototype.iadd=function(b,x){this._verify2(b,x);var P=b.iadd(x);return P.cmp(this.m)>=0&&P.isub(this.m),P},K.prototype.sub=function(b,x){this._verify2(b,x);var P=b.sub(x);return P.cmpn(0)<0&&P.iadd(this.m),P._forceRed(this)},K.prototype.isub=function(b,x){this._verify2(b,x);var P=b.isub(x);return P.cmpn(0)<0&&P.iadd(this.m),P},K.prototype.shl=function(b,x){return this._verify1(b),this.imod(b.ushln(x))},K.prototype.imul=function(b,x){return this._verify2(b,x),this.imod(b.imul(x))},K.prototype.mul=function(b,x){return this._verify2(b,x),this.imod(b.mul(x))},K.prototype.isqr=function(b){return this.imul(b,b.clone())},K.prototype.sqr=function(b){return this.mul(b,b)},K.prototype.sqrt=function(b){if(b.isZero())return b.clone();var x=this.m.andln(3);if(n(x%2===1),x===3){var P=this.m.add(new s(1)).iushrn(2);return this.pow(b,P)}for(var L=this.m.subn(1),O=0;!L.isZero()&&L.andln(1)===0;)O++,L.iushrn(1);n(!L.isZero());var j=new s(1).toRed(this),I=j.redNeg(),D=this.m.subn(1).iushrn(1),M=this.m.bitLength();for(M=new s(2*M*M).toRed(this);this.pow(M,D).cmp(I)!==0;)M.redIAdd(I);for(var X=this.pow(M,L),le=this.pow(b,L.addn(1).iushrn(1)),H=this.pow(b,L),ee=O;H.cmp(j)!==0;){for(var Z=H,te=0;Z.cmp(j)!==0;te++)Z=Z.redSqr();n(te=0;O--){for(var X=x.words[O],le=M-1;le>=0;le--){var H=X>>le&1;if(j!==L[0]&&(j=this.sqr(j)),H===0&&I===0){D=0;continue}I<<=1,I|=H,D++,!(D!==P&&(O!==0||le!==0))&&(j=this.mul(j,L[I]),D=0,I=0)}M=26}return j},K.prototype.convertTo=function(b){var x=b.umod(this.m);return x===b?x.clone():x},K.prototype.convertFrom=function(b){var x=b.clone();return x.red=null,x},s.mont=function(b){return new N(b)};function N(k){K.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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,K),N.prototype.convertTo=function(b){return this.imod(b.ushln(this.shift))},N.prototype.convertFrom=function(b){var x=this.imod(b.mul(this.rinv));return x.red=null,x},N.prototype.imul=function(b,x){if(b.isZero()||x.isZero())return b.words[0]=0,b.length=1,b;var P=b.imul(x),L=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=P.isub(L).iushrn(this.shift),j=O;return O.cmp(this.m)>=0?j=O.isub(this.m):O.cmpn(0)<0&&(j=O.iadd(this.m)),j._forceRed(this)},N.prototype.mul=function(b,x){if(b.isZero()||x.isZero())return new s(0)._forceRed(this);var P=b.mul(x),L=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=P.isub(L).iushrn(this.shift),j=O;return O.cmp(this.m)>=0?j=O.isub(this.m):O.cmpn(0)<0&&(j=O.iadd(this.m)),j._forceRed(this)},N.prototype.invm=function(b){var x=this.imod(b._invmp(this.m).mul(this.r2));return x._forceRed(this)}})(t,Xt)})(x$);var Ppe=x$.exports;const yr=wa(Ppe),pV="bignumber/5.7.0";var c6=yr.BN;const Lu=new Pe(pV),v9={},HO=9007199254740991;function Rpe(t){return t!=null&&(nt.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Vr(t)||typeof t=="bigint"||kg(t))}let qO=!1;class nt{constructor(e,r){e!==v9&&Lu.throwError("cannot call constructor directly; use BigNumber.from",Pe.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return mo(jr(this).fromTwos(e))}toTwos(e){return mo(jr(this).toTwos(e))}abs(){return this._hex[0]==="-"?nt.from(this._hex.substring(1)):this}add(e){return mo(jr(this).add(jr(e)))}sub(e){return mo(jr(this).sub(jr(e)))}div(e){return nt.from(e).isZero()&&ja("division-by-zero","div"),mo(jr(this).div(jr(e)))}mul(e){return mo(jr(this).mul(jr(e)))}mod(e){const r=jr(e);return r.isNeg()&&ja("division-by-zero","mod"),mo(jr(this).umod(r))}pow(e){const r=jr(e);return r.isNeg()&&ja("negative-power","pow"),mo(jr(this).pow(r))}and(e){const r=jr(e);return(this.isNegative()||r.isNeg())&&ja("unbound-bitwise-result","and"),mo(jr(this).and(r))}or(e){const r=jr(e);return(this.isNegative()||r.isNeg())&&ja("unbound-bitwise-result","or"),mo(jr(this).or(r))}xor(e){const r=jr(e);return(this.isNegative()||r.isNeg())&&ja("unbound-bitwise-result","xor"),mo(jr(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&ja("negative-width","mask"),mo(jr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ja("negative-width","shl"),mo(jr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ja("negative-width","shr"),mo(jr(this).shrn(e))}eq(e){return jr(this).eq(jr(e))}lt(e){return jr(this).lt(jr(e))}lte(e){return jr(this).lte(jr(e))}gt(e){return jr(this).gt(jr(e))}gte(e){return jr(this).gte(jr(e))}isNegative(){return this._hex[0]==="-"}isZero(){return jr(this).isZero()}toNumber(){try{return jr(this).toNumber()}catch{ja("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Lu.throwError("this platform does not support BigInt",Pe.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?qO||(qO=!0,Lu.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Lu.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Pe.errors.UNEXPECTED_ARGUMENT,{}):Lu.throwError("BigNumber.toString does not accept parameters",Pe.errors.UNEXPECTED_ARGUMENT,{})),jr(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(v9,x2(e)):e.match(/^-?[0-9]+$/)?new nt(v9,x2(new c6(e))):Lu.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&ja("underflow","BigNumber.from",e),(e>=HO||e<=-HO)&&ja("overflow","BigNumber.from",e),nt.from(String(e));const r=e;if(typeof r=="bigint")return nt.from(r.toString());if(kg(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"&&(Vr(n)||n[0]==="-"&&Vr(n.substring(1))))return nt.from(n)}return Lu.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function x2(t){if(typeof t!="string")return x2(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Lu.throwArgumentError("invalid hex","value",t),t=x2(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 mo(t){return nt.from(x2(t))}function jr(t){const e=nt.from(t).toHexString();return e[0]==="-"?new c6("-"+e.substring(3),16):new c6(e.substring(2),16)}function ja(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Lu.throwError(t,Pe.errors.NUMERIC_FAULT,n)}function Mpe(t){return new c6(t,36).toString(16)}const Gs=new Pe(pV),Fy={},gV=nt.from(0),mV=nt.from(-1);function yV(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Gs.throwError(t,Pe.errors.NUMERIC_FAULT,i)}let Uy="0";for(;Uy.length<256;)Uy+=Uy;function E$(t){if(typeof t!="number")try{t=nt.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+Uy.substring(0,t):Gs.throwArgumentError("invalid decimal size","decimals",t)}function s5(t,e){e==null&&(e=0);const r=E$(e);t=nt.from(t);const n=t.lt(gV);n&&(t=t.mul(mV));let i=t.mod(r).toString();for(;i.length2&&Gs.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&yV("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?l:(typeof e[o]!==a&&Gs.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Gs.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Gs.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new N1(Fy,r,n,i)}}class as{constructor(e,r,n,i){e!==Fy&&Gs.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Pe.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&&Gs.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=_c(this._value,this.format.decimals),n=_c(e._value,e.format.decimals);return as.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=_c(this._value,this.format.decimals),n=_c(e._value,e.format.decimals);return as.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=_c(this._value,this.format.decimals),n=_c(e._value,e.format.decimals);return as.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=_c(this._value,this.format.decimals),n=_c(e._value,e.format.decimals);return as.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=as.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(VO.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=as.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(VO.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)&&Gs.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=as.from("1"+Uy.substring(0,e),this.format),i=Ope.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&&Gs.throwArgumentError("invalid byte width","width",e);const r=nt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Ln(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return as.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!Rpe(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),as.fromString(s5(e,r),N1.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=N1.from(r),i=_c(e,n.decimals);!n.signed&&i.lt(gV)&&yV("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=Ln(s,n.width/8));const o=s5(i,n.decimals);return new as(Fy,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=N1.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 s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=s5(i,n.decimals);return new as(Fy,s,o,n)}static from(e,r){if(typeof e=="string")return as.fromString(e,r);if(kg(e))return as.fromBytes(e,r);try{return as.fromValue(e,0,r)}catch(n){if(n.code!==Pe.errors.INVALID_ARGUMENT)throw n}return Gs.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const VO=as.from(1),Ope=as.from("0.5");var vV={exports:{}};/** +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function v9(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function $A(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Ape=typeof WeakMap=="function"?WeakMap:Map;function nV(t,e,r){r=od(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){c4||(c4=!0,FA=n),$A(t,e)},r}function iV(t,e,r){r=od(-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(){$A(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){$A(t,e),typeof n!="function"&&(Tf===null?Tf=new Set([this]):Tf.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),r}function $O(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Ape;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=Fpe.bind(null,t,e,r),e.then(t,t))}function kO(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 NO(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=od(-1,1),e.tag=2,If(r,e,1))),r.lanes|=1),t)}var Spe=$d.ReactCurrentOwner,Ia=!1;function zs(t,e,r,n){e.child=t===null?Rq(e,null,r,n):Y1(e,t.child,r,n)}function PO(t,e,r,n,i){r=r.render;var s=e.ref;return k1(e,i),n=d$(t,e,r,n,s,i),r=f$(),t!==null&&!Ia?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,hd(t,e,i)):(Ln&&r&&XT(e),e.flags|=1,zs(t,e,n,i),e.child)}function RO(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!x$(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,sV(t,e,s,n,i)):(t=a5(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var a=s.memoizedProps;if(r=r.compare,r=r!==null?r:p2,r(a,n)&&t.ref===e.ref)return hd(t,e,i)}return e.flags|=1,t=kf(s,n),t.ref=e.ref,t.return=e,e.child=t}function sV(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(p2(s,n)&&t.ref===e.ref)if(Ia=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(Ia=!0);else return e.lanes=t.lanes,hd(t,e,i)}return kA(t,e,r,n,i)}function aV(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},En(g1,ro),ro|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,En(g1,ro),ro|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,En(g1,ro),ro|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,En(g1,ro),ro|=n;return zs(t,e,i,r),e.child}function oV(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function kA(t,e,r,n,i){var s=ka(r)?p0:Os.current;return s=G1(e,s),k1(e,i),r=d$(t,e,r,n,s,i),n=f$(),t!==null&&!Ia?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,hd(t,e,i)):(Ln&&n&&XT(e),e.flags|=1,zs(t,e,r,i),e.child)}function MO(t,e,r,n,i){if(ka(r)){var s=!0;X5(e)}else s=!1;if(k1(e,i),e.stateNode===null)n5(t,e),rV(e,r,n),TA(e,r,n,i),n=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,c=r.contextType;typeof c=="object"&&c!==null?c=Xo(c):(c=ka(r)?p0:Os.current,c=G1(e,c));var u=r.getDerivedStateFromProps,f=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==n||l!==c)&&TO(e,a,n,c),sf=!1;var h=e.memoizedState;a.state=h,i4(e,n,a,i),l=e.memoizedState,o!==n||h!==l||$a.current||sf?(typeof u=="function"&&(IA(e,r,u,n),l=e.memoizedState),(o=sf||IO(e,r,o,n,h,l,c))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),a.props=n,a.state=l,a.context=c,n=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{a=e.stateNode,Oq(t,e),o=e.memoizedProps,c=e.type===e.elementType?o:kl(e.type,o),a.props=c,f=e.pendingProps,h=a.context,l=r.contextType,typeof l=="object"&&l!==null?l=Xo(l):(l=ka(r)?p0:Os.current,l=G1(e,l));var g=r.getDerivedStateFromProps;(u=typeof g=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||h!==l)&&TO(e,a,n,l),sf=!1,h=e.memoizedState,a.state=h,i4(e,n,a,i);var m=e.memoizedState;o!==f||h!==m||$a.current||sf?(typeof g=="function"&&(IA(e,r,g,n),m=e.memoizedState),(c=sf||IO(e,r,c,n,h,m,l)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,m,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,m,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=m),a.props=n,a.state=m,a.context=l,n=c):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),n=!1)}return NA(t,e,r,n,s,i)}function NA(t,e,r,n,i,s){oV(t,e);var a=(e.flags&128)!==0;if(!n&&!a)return i&&wO(e,r,!1),hd(t,e,s);n=e.stateNode,Spe.current=e;var o=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&a?(e.child=Y1(e,t.child,null,s),e.child=Y1(e,null,o,s)):zs(t,e,o,s),e.memoizedState=n.state,i&&wO(e,r,!0),e.child}function lV(t){var e=t.stateNode;e.pendingContext?vO(t,e.pendingContext,e.pendingContext!==e.context):e.context&&vO(t,e.context,!1),o$(t,e.containerInfo)}function OO(t,e,r,n,i){return K1(),t$(i),e.flags|=256,zs(t,e,r,n),e.child}var PA={dehydrated:null,treeContext:null,retryLane:0};function RA(t){return{baseLanes:t,cachePool:null,transitions:null}}function cV(t,e,r){var n=e.pendingProps,i=qn.current,s=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(i&2)!==0),o?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),En(qn,i&1),t===null)return AA(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):(a=n.children,t=n.fallback,s?(n=e.mode,s=e.child,a={mode:"hidden",children:a},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=B6(a,n,0,null),t=r0(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=RA(r),e.memoizedState=PA,t):g$(e,a));if(i=t.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Ipe(t,e,a,n,o,i,r);if(s){s=n.fallback,a=e.mode,i=t.child,o=i.sibling;var l={mode:"hidden",children:n.children};return!(a&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=kf(i,l),n.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=kf(o,s):(s=r0(s,a,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,a=t.child.memoizedState,a=a===null?RA(r):{baseLanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=t.childLanes&~r,e.memoizedState=PA,n}return s=t.child,t=s.sibling,n=kf(s,{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 g$(t,e){return e=B6({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function eb(t,e,r,n){return n!==null&&t$(n),Y1(e,t.child,null,r),t=g$(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Ipe(t,e,r,n,i,s,a){if(r)return e.flags&256?(e.flags&=-257,n=v9(Error(st(422))),eb(t,e,a,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=B6({mode:"visible",children:n.children},i,0,null),s=r0(s,i,a,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&Y1(e,t.child,null,a),e.child.memoizedState=RA(a),e.memoizedState=PA,s);if(!(e.mode&1))return eb(t,e,a,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var o=n.dgst;return n=o,s=Error(st(419)),n=v9(s,n,void 0),eb(t,e,a,n)}if(o=(a&t.childLanes)!==0,Ia||o){if(n=Yi,n!==null){switch(a&-a){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|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,fd(t,i),Wl(n,t,i,-1))}return _$(),n=v9(Error(st(421))),eb(t,e,a,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=Upe.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,co=Sf(i.nextSibling),ho=e,Ln=!0,Ml=null,t!==null&&(qo[Vo++]=td,qo[Vo++]=rd,qo[Vo++]=g0,td=t.id,rd=t.overflow,g0=e),e=g$(e,n.children),e.flags|=4096,e)}function jO(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),SA(t.return,e,r)}function w9(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function uV(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(zs(t,e,n.children,r),n=qn.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&&jO(t,r,e);else if(t.tag===19)jO(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(En(qn,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&&s4(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),w9(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&s4(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}w9(e,!0,r,null,s);break;case"together":w9(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function n5(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function hd(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),y0|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(st(153));if(e.child!==null){for(t=e.child,r=kf(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=kf(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Tpe(t,e,r){switch(e.tag){case 3:lV(e),K1();break;case 5:jq(e);break;case 1:ka(e.type)&&X5(e);break;case 4:o$(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;En(r4,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(En(qn,qn.current&1),e.flags|=128,null):r&e.child.childLanes?cV(t,e,r):(En(qn,qn.current&1),t=hd(t,e,r),t!==null?t.sibling:null);En(qn,qn.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return uV(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),En(qn,qn.current),n)break;return null;case 22:case 23:return e.lanes=0,aV(t,e,r)}return hd(t,e,r)}var dV,MA,fV,hV;dV=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}};MA=function(){};fV=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,Kh(Wc.current);var s=null;switch(r){case"input":i=rA(t,i),n=rA(t,n),s=[];break;case"select":i=Kn({},i,{value:void 0}),n=Kn({},n,{value:void 0}),s=[];break;case"textarea":i=sA(t,i),n=sA(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=J5)}oA(r,n);var a;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(o2.hasOwnProperty(c)?s||(s=[]):(s=s||[]).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(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(r||(r={}),r[a]=l[a])}else r||(s||(s=[]),s.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(o2.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&kn("scroll",t),s||o===l||(s=[])):(s=s||[]).push(c,l))}r&&(s=s||[]).push("style",r);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};hV=function(t,e,r,n){r!==n&&(e.flags|=4)};function Wm(t,e){if(!Ln)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 ws(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 $pe(t,e,r){var n=e.pendingProps;switch(e$(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ws(e),null;case 1:return ka(e.type)&&Q5(),ws(e),null;case 3:return n=e.stateNode,Z1(),Rn($a),Rn(Os),c$(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Q3(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ml!==null&&(WA(Ml),Ml=null))),MA(t,e),ws(e),null;case 5:l$(e);var i=Kh(w2.current);if(r=e.type,t!==null&&e.stateNode!=null)fV(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(st(166));return ws(e),null}if(t=Kh(Wc.current),Q3(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[Pc]=e,n[y2]=s,t=(e.mode&1)!==0,r){case"dialog":kn("cancel",n),kn("close",n);break;case"iframe":case"object":case"embed":kn("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=a.createElement(r,{is:n.is}):(t=a.createElement(r),r==="select"&&(a=t,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):t=a.createElementNS(t,r),t[Pc]=e,t[y2]=n,dV(t,e,!1,!1),e.stateNode=t;e:{switch(a=lA(r,n),r){case"dialog":kn("cancel",t),kn("close",t),i=n;break;case"iframe":case"object":case"embed":kn("load",t),i=n;break;case"video":case"audio":for(i=0;iQ1&&(e.flags|=128,n=!0,Wm(s,!1),e.lanes=4194304)}else{if(!n)if(t=s4(a),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Wm(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Ln)return ws(e),null}else 2*ci()-s.renderingStartTime>Q1&&r!==1073741824&&(e.flags|=128,n=!0,Wm(s,!1),e.lanes=4194304);s.isBackwards?(a.sibling=e.child,e.child=a):(r=s.last,r!==null?r.sibling=a:e.child=a,s.last=a)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ci(),e.sibling=null,r=qn.current,En(qn,n?r&1|2:r&1),e):(ws(e),null);case 22:case 23:return b$(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ro&1073741824&&(ws(e),e.subtreeFlags&6&&(e.flags|=8192)):ws(e),null;case 24:return null;case 25:return null}throw Error(st(156,e.tag))}function kpe(t,e){switch(e$(e),e.tag){case 1:return ka(e.type)&&Q5(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Z1(),Rn($a),Rn(Os),c$(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return l$(e),null;case 13:if(Rn(qn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(st(340));K1()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Rn(qn),null;case 4:return Z1(),null;case 10:return i$(e.type._context),null;case 22:case 23:return b$(),null;case 24:return null;default:return null}}var tb=!1,As=!1,Npe=typeof WeakSet=="function"?WeakSet:Set,$t=null;function p1(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Xn(t,e,n)}else r.current=null}function OA(t,e,r){try{r()}catch(n){Xn(t,e,n)}}var LO=!1;function Ppe(t,e){if(vA=K5,t=vq(),QT(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,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var a=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=a+i),f!==s||n!==0&&f.nodeType!==3||(l=a+n),f.nodeType===3&&(a+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===r&&++c===i&&(o=a),h===s&&++u===n&&(l=a),(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(wA={focusedElem:t,selectionRange:r},K5=!1,$t=e;$t!==null;)if(e=$t,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,$t=t;else for(;$t!==null;){e=$t;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,E=m.memoizedState,v=e.stateNode,_=v.getSnapshotBeforeUpdate(e.elementType===e.type?w:kl(e.type,w),E);v.__reactInternalSnapshotBeforeUpdate=_}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(st(163))}}catch(C){Xn(e,e.return,C)}if(t=e.sibling,t!==null){t.return=e.return,$t=t;break}$t=e.return}return m=LO,LO=!1,m}function Dy(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 s=i.destroy;i.destroy=void 0,s!==void 0&&OA(e,r,s)}i=i.next}while(i!==n)}}function F6(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 jA(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 pV(t){var e=t.alternate;e!==null&&(t.alternate=null,pV(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Pc],delete e[y2],delete e[xA],delete e[ppe],delete e[gpe])),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 gV(t){return t.tag===5||t.tag===3||t.tag===4}function DO(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gV(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 LA(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=J5));else if(n!==4&&(t=t.child,t!==null))for(LA(t,e,r),t=t.sibling;t!==null;)LA(t,e,r),t=t.sibling}function DA(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(DA(t,e,r),t=t.sibling;t!==null;)DA(t,e,r),t=t.sibling}var ls=null,Pl=!1;function Vd(t,e,r){for(r=r.child;r!==null;)mV(t,e,r),r=r.sibling}function mV(t,e,r){if(Bc&&typeof Bc.onCommitFiberUnmount=="function")try{Bc.onCommitFiberUnmount(N6,r)}catch{}switch(r.tag){case 5:As||p1(r,e);case 6:var n=ls,i=Pl;ls=null,Vd(t,e,r),ls=n,Pl=i,ls!==null&&(Pl?(t=ls,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ls.removeChild(r.stateNode));break;case 18:ls!==null&&(Pl?(t=ls,r=r.stateNode,t.nodeType===8?f9(t.parentNode,r):t.nodeType===1&&f9(t,r),f2(t)):f9(ls,r.stateNode));break;case 4:n=ls,i=Pl,ls=r.stateNode.containerInfo,Pl=!0,Vd(t,e,r),ls=n,Pl=i;break;case 0:case 11:case 14:case 15:if(!As&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&OA(r,e,a),i=i.next}while(i!==n)}Vd(t,e,r);break;case 1:if(!As&&(p1(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){Xn(r,e,o)}Vd(t,e,r);break;case 21:Vd(t,e,r);break;case 22:r.mode&1?(As=(n=As)||r.memoizedState!==null,Vd(t,e,r),As=n):Vd(t,e,r);break;default:Vd(t,e,r)}}function FO(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Npe),e.forEach(function(n){var i=Bpe.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function wl(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=a),n&=~s}if(n=i,n=ci()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Mpe(n/1960))-n,10t?16:t,mf===null)var n=!1;else{if(t=mf,mf=null,u4=0,Gr&6)throw Error(st(331));var i=Gr;for(Gr|=4,$t=t.current;$t!==null;){var s=$t,a=s.child;if($t.flags&16){var o=s.deletions;if(o!==null){for(var l=0;lci()-v$?t0(t,0):y$|=r),Na(t,e)}function CV(t,e){e===0&&(t.mode&1?(e=V3,V3<<=1,!(V3&130023424)&&(V3=4194304)):e=1);var r=Qs();t=fd(t,e),t!==null&&(Ev(t,e,r),Na(t,r))}function Upe(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),CV(t,r)}function Bpe(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(st(314))}n!==null&&n.delete(e),CV(t,r)}var AV;AV=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||$a.current)Ia=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Ia=!1,Tpe(t,e,r);Ia=!!(t.flags&131072)}else Ia=!1,Ln&&e.flags&1048576&&$q(e,t4,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;n5(t,e),t=e.pendingProps;var i=G1(e,Os.current);k1(e,r),i=d$(null,e,n,t,i,r);var s=f$();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,ka(n)?(s=!0,X5(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,a$(e),i.updater=D6,e.stateNode=i,i._reactInternals=e,TA(e,n,t,r),e=NA(null,e,n,!0,s,r)):(e.tag=0,Ln&&s&&XT(e),zs(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(n5(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=zpe(n),t=kl(n,t),i){case 0:e=kA(null,e,n,t,r);break e;case 1:e=MO(null,e,n,t,r);break e;case 11:e=PO(null,e,n,t,r);break e;case 14:e=RO(null,e,n,kl(n.type,t),r);break e}throw Error(st(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:kl(n,i),kA(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:kl(n,i),MO(t,e,n,i,r);case 3:e:{if(lV(e),t===null)throw Error(st(387));n=e.pendingProps,s=e.memoizedState,i=s.element,Oq(t,e),i4(e,n,null,r);var a=e.memoizedState;if(n=a.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=J1(Error(st(423)),e),e=OO(t,e,n,r,i);break e}else if(n!==i){i=J1(Error(st(424)),e),e=OO(t,e,n,r,i);break e}else for(co=Sf(e.stateNode.containerInfo.firstChild),ho=e,Ln=!0,Ml=null,r=Rq(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(K1(),n===i){e=hd(t,e,r);break e}zs(t,e,n,r)}e=e.child}return e;case 5:return jq(e),t===null&&AA(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,a=i.children,bA(n,i)?a=null:s!==null&&bA(n,s)&&(e.flags|=32),oV(t,e),zs(t,e,a,r),e.child;case 6:return t===null&&AA(e),null;case 13:return cV(t,e,r);case 4:return o$(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Y1(e,null,n,r):zs(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:kl(n,i),PO(t,e,n,i,r);case 7:return zs(t,e,e.pendingProps,r),e.child;case 8:return zs(t,e,e.pendingProps.children,r),e.child;case 12:return zs(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,a=i.value,En(r4,n._currentValue),n._currentValue=a,s!==null)if(Kl(s.value,a)){if(s.children===i.children&&!$a.current){e=hd(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=od(-1,r&-r),l.tag=2;var c=s.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}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),SA(s.return,r,e),o.lanes|=r;break}l=l.next}}else if(s.tag===10)a=s.type===e.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(st(341));a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),SA(a,r,e),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}zs(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,k1(e,r),i=Xo(i),n=n(i),e.flags|=1,zs(t,e,n,r),e.child;case 14:return n=e.type,i=kl(n,e.pendingProps),i=kl(n.type,i),RO(t,e,n,i,r);case 15:return sV(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:kl(n,i),n5(t,e),e.tag=1,ka(n)?(t=!0,X5(e)):t=!1,k1(e,r),rV(e,n,i),TA(e,n,i,r),NA(null,e,n,!0,t,r);case 19:return uV(t,e,r);case 22:return aV(t,e,r)}throw Error(st(156,e.tag))};function SV(t,e){return XH(t,e)}function Wpe(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 Ko(t,e,r,n){return new Wpe(t,e,r,n)}function x$(t){return t=t.prototype,!(!t||!t.isReactComponent)}function zpe(t){if(typeof t=="function")return x$(t)?1:0;if(t!=null){if(t=t.$$typeof,t===BT)return 11;if(t===WT)return 14}return 2}function kf(t,e){var r=t.alternate;return r===null?(r=Ko(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 a5(t,e,r,n,i,s){var a=2;if(n=t,typeof t=="function")x$(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case s1:return r0(r.children,i,s,e);case UT:a=8,i|=8;break;case QC:return t=Ko(12,r,e,i|2),t.elementType=QC,t.lanes=s,t;case XC:return t=Ko(13,r,e,i),t.elementType=XC,t.lanes=s,t;case eA:return t=Ko(19,r,e,i),t.elementType=eA,t.lanes=s,t;case jH:return B6(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case MH:a=10;break e;case OH:a=9;break e;case BT:a=11;break e;case WT:a=14;break e;case nf:a=16,n=null;break e}throw Error(st(130,t==null?t:typeof t,""))}return e=Ko(a,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function r0(t,e,r,n){return t=Ko(7,t,n,e),t.lanes=r,t}function B6(t,e,r,n){return t=Ko(22,t,n,e),t.elementType=jH,t.lanes=r,t.stateNode={isHidden:!1},t}function b9(t,e,r){return t=Ko(6,t,null,e),t.lanes=r,t}function _9(t,e,r){return e=Ko(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Hpe(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=t9(0),this.expirationTimes=t9(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=t9(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function E$(t,e,r,n,i,s,a,o,l){return t=new Hpe(t,e,r,o,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ko(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},a$(s),t}function qpe(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kV)}catch(t){console.error(t)}}kV(),kH.exports=bo;var zl=kH.exports,NV,GO=zl;NV=GO.createRoot,GO.hydrateRoot;/** + * @remix-run/router v1.21.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function C2(){return C2=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function Jpe(){return Math.random().toString(36).substr(2,8)}function YO(t,e){return{usr:t.state,key:t.key,idx:e}}function zA(t,e,r,n){return r===void 0&&(r=null),C2({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?V6(e):e,{state:r,key:e&&e.key||n||Jpe()})}function PV(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 V6(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 Qpe(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,a=i.history,o=Yh.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(C2({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function f(){o=Yh.Pop;let E=u(),v=E==null?null:E-c;c=E,l&&l({action:o,location:w.location,delta:v})}function h(E,v){o=Yh.Push;let _=zA(w.location,E,v);c=u()+1;let A=YO(_,c),C=w.createHref(_);try{a.pushState(A,"",C)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;i.location.assign(C)}s&&l&&l({action:o,location:w.location,delta:1})}function g(E,v){o=Yh.Replace;let _=zA(w.location,E,v);c=u();let A=YO(_,c),C=w.createHref(_);a.replaceState(A,"",C),s&&l&&l({action:o,location:w.location,delta:0})}function m(E){let v=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof E=="string"?E:PV(E);return _=_.replace(/ $/,"%20"),zc(v,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,v)}let w={get action(){return o},get location(){return t(i,a)},listen(E){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(KO,f),l=E,()=>{i.removeEventListener(KO,f),l=null}},createHref(E){return e(i,E)},createURL:m,encodeLocation(E){let v=m(E);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:g,go(E){return a.go(E)}};return w}var ZO;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(ZO||(ZO={}));function Xpe(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 e1e(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?V6(t):t;return{pathname:r?r.startsWith("/")?r:t1e(r,e):e,search:a1e(n),hash:o1e(i)}}function t1e(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 x9(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 r1e(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function n1e(t,e){let r=r1e(t);return e?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function i1e(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=V6(t):(i=C2({},t),zc(!i.pathname||!i.pathname.includes("?"),x9("?","pathname","search",i)),zc(!i.pathname||!i.pathname.includes("#"),x9("#","pathname","hash",i)),zc(!i.search||!i.search.includes("#"),x9("#","search","hash",i)));let s=t===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=r;else{let f=e.length-1;if(!n&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}o=f>=0?e[f]:"/"}let l=e1e(i,o),c=a&&a!=="/"&&a.endsWith("/"),u=(s||a===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const s1e=t=>t.join("/").replace(/\/\/+/g,"/"),a1e=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,o1e=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,RV=["post","put","patch","delete"];new Set(RV);const l1e=["get",...RV];new Set(l1e);/** + * React Router v6.28.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function h4(){return h4=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),I.useCallback(function(c,u){if(u===void 0&&(u={}),!o.current)return;if(typeof c=="number"){n.go(c);return}let f=i1e(c,JSON.parse(a),s,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:s1e([e,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[e,n,a,s,t])}var jV=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(jV||{}),LV=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}(LV||{});function f1e(t){let e=I.useContext(MV);return e||zc(!1),e}function h1e(t){let e=I.useContext($$);return e||zc(!1),e}function p1e(t){let e=h1e(),r=e.matches[e.matches.length-1];return r.route.id||zc(!1),r.route.id}function g1e(){let{router:t}=f1e(jV.UseNavigateStable),e=p1e(LV.UseNavigateStable),r=I.useRef(!1);return OV(()=>{r.current=!0}),I.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,h4({fromRouteId:e},s)))},[t,e])}const JO={};function m1e(t,e){JO[e]||(JO[e]=!0,console.warn(e))}const QO=(t,e,r)=>m1e(t,"⚠️ React Router Future Flag Warning: "+e+". "+("You can use the `"+t+"` future flag to opt-in early. ")+("For more information, see "+r+"."));function y1e(t,e){(t==null?void 0:t.v7_startTransition)===void 0&&QO("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&&QO("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function v1e(t){let{basename:e="/",children:r=null,location:n,navigationType:i=Yh.Pop,navigator:s,static:a=!1,future:o}=t;k$()&&zc(!1);let l=e.replace(/^\/*/,"/"),c=I.useMemo(()=>({basename:l,navigator:s,static:a,future:h4({v7_relativeSplatPath:!1},o)}),[l,o,s,a]);typeof n=="string"&&(n=V6(n));let{pathname:u="/",search:f="",hash:h="",state:g=null,key:m="default"}=n,w=I.useMemo(()=>{let E=Xpe(u,l);return E==null?null:{location:{pathname:E,search:f,hash:h,state:g,key:m},navigationType:i}},[l,u,f,h,g,m,i]);return w==null?null:I.createElement(I$.Provider,{value:c},I.createElement(T$.Provider,{children:r,value:w}))}new Promise(()=>{});/** + * React Router DOM v6.28.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */const w1e="6";try{window.__reactRouterVersion=w1e}catch{}const b1e="startTransition",XO=W5[b1e];function _1e(t){let{basename:e,children:r,future:n,window:i}=t,s=I.useRef();s.current==null&&(s.current=Zpe({window:i,v5Compat:!0}));let a=s.current,[o,l]=I.useState({action:a.action,location:a.location}),{v7_startTransition:c}=n||{},u=I.useCallback(f=>{c&&XO?XO(()=>l(f)):l(f)},[l,c]);return I.useLayoutEffect(()=>a.listen(u),[a,u]),I.useEffect(()=>y1e(n),[n]),I.createElement(v1e,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}var ej;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(ej||(ej={}));var tj;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(tj||(tj={}));const x1e="modulepreload",E1e=function(t){return"/"+t},rj={},Ma=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(r.map(l=>{if(l=E1e(l),l in rj)return;rj[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":x1e,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 s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})},C1e="logger/5.7.0";let nj=!1,ij=!1;const o5={debug:1,default:2,info:2,warning:3,error:4,off:5};let sj=o5.default,E9=null;function A1e(){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 aj=A1e();var HA;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(HA||(HA={}));var xs;(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"})(xs||(xs={}));const oj="0123456789abcdef";class Pe{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();o5[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(sj>o5[n])&&console.log.apply(console,r)}debug(...e){this._log(Pe.levels.DEBUG,e)}info(...e){this._log(Pe.levels.INFO,e)}warn(...e){this._log(Pe.levels.WARNING,e)}makeError(e,r,n){if(ij)return this.makeError("censored error",r,{});r||(r=Pe.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+=oj[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 s=e;let a="";switch(r){case xs.NUMERIC_FAULT:{a="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":a+="-"+l;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result";break}break}case xs.CALL_EXCEPTION:case xs.INSUFFICIENT_FUNDS:case xs.MISSING_NEW:case xs.NONCE_EXPIRED:case xs.REPLACEMENT_UNDERPRICED:case xs.TRANSACTION_REPLACED:case xs.UNPREDICTABLE_GAS_LIMIT:a=r;break}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const o=new Error(e);return o.reason=s,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,Pe.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){aj&&this.throwError("platform missing String.prototype.normalize",Pe.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:aj})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Pe.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Pe.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,Pe.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Pe.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",Pe.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Pe.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return E9||(E9=new Pe(C1e)),E9}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Pe.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),nj){if(!e)return;this.globalLogger().throwError("error censorship permanent",Pe.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ij=!!e,nj=!!r}static setLogLevel(e){const r=o5[e.toLowerCase()];if(r==null){Pe.globalLogger().warn("invalid log level - "+e);return}sj=r}static from(e){return new Pe(e)}}Pe.errors=xs;Pe.levels=HA;const S1e="bytes/5.7.0",Qn=new Pe(S1e);function DV(t){return!!t.toHexString}function P1(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return P1(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function N$(t){return Vr(t)&&!(t.length%2)||Pg(t)}function lj(t){return typeof t=="number"&&t==t&&t%1===0}function Pg(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!lj(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"){Qn.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),P1(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),DV(t)&&(t=t.toHexString()),Vr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Qn.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ier(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),P1(n)}function w0(t){let e=er(t);if(e.length===0)return e;let r=0;for(;re&&Qn.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),P1(r)}function Vr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const C9="0123456789abcdef";function Bt(t,e){if(e||(e={}),typeof t=="number"){Qn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=C9[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),DV(t))return t.toHexString();if(Vr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Qn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Pg(t)){let r="0x";for(let n=0;n>4]+C9[i&15]}return r}return Qn.throwArgumentError("invalid hexlify value","value",t)}function b0(t){if(typeof t!="string")t=Bt(t);else if(!Vr(t)||t.length%2)return null;return(t.length-2)/2}function Es(t,e,r){return typeof t!="string"?t=Bt(t):(!Vr(t)||t.length%2)&&Qn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Aa(t){let e="0x";return t.forEach(r=>{e+=Bt(r).substring(2)}),e}function P$(t){const e=T1e(Bt(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function T1e(t){typeof t!="string"&&(t=Bt(t)),Vr(t)||Qn.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&Qn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function G6(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(N$(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]):Qn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Qn.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=I1e(er(e._vs),32);e._vs=Bt(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Qn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const a=Bt(i);e.s==null?e.s=a:e.s!==a&&Qn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Qn.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&&Qn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Vr(e.r)?Qn.throwArgumentError("signature missing or invalid r","signature",t):e.r=Dn(e.r,32),e.s==null||!Vr(e.s)?Qn.throwArgumentError("signature missing or invalid s","signature",t):e.s=Dn(e.s,32);const r=er(e.s);r[0]>=128&&Qn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=Bt(r);e._vs&&(Vr(e._vs)||Qn.throwArgumentError("signature invalid _vs","signature",t),e._vs=Dn(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Qn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var R$={exports:{}};const $1e={},k1e=Object.freeze(Object.defineProperty({__proto__:null,default:$1e},Symbol.toStringTag,{value:"Module"})),Rg=Kf(k1e);R$.exports;(function(t){(function(e,r){function n(k,b){if(!k)throw new Error(b||"Assertion failed")}function i(k,b){k.super_=b;var x=function(){};x.prototype=b.prototype,k.prototype=new x,k.prototype.constructor=k}function s(k,b,x){if(s.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((b==="le"||b==="be")&&(x=b,b=10),this._init(k||0,b||10,x||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=Rg.Buffer}catch{}s.isBN=function(b){return b instanceof s?!0:b!==null&&typeof b=="object"&&b.constructor.wordSize===s.wordSize&&Array.isArray(b.words)},s.max=function(b,x){return b.cmp(x)>0?b:x},s.min=function(b,x){return b.cmp(x)<0?b:x},s.prototype._init=function(b,x,P){if(typeof b=="number")return this._initNumber(b,x,P);if(typeof b=="object")return this._initArray(b,x,P);x==="hex"&&(x=16),n(x===(x|0)&&x>=2&&x<=36),b=b.toString().replace(/\s+/g,"");var D=0;b[0]==="-"&&(D++,this.negative=1),D=0;D-=3)j=b[D]|b[D-1]<<8|b[D-2]<<16,this.words[O]|=j<>>26-T&67108863,T+=24,T>=26&&(T-=26,O++);else if(P==="le")for(D=0,O=0;D>>26-T&67108863,T+=24,T>=26&&(T-=26,O++);return this._strip()};function o(k,b){var x=k.charCodeAt(b);if(x>=48&&x<=57)return x-48;if(x>=65&&x<=70)return x-55;if(x>=97&&x<=102)return x-87;n(!1,"Invalid character in "+k)}function l(k,b,x){var P=o(k,x);return x-1>=b&&(P|=o(k,x-1)<<4),P}s.prototype._parseHex=function(b,x,P){this.length=Math.ceil((b.length-x)/6),this.words=new Array(this.length);for(var D=0;D=x;D-=2)T=l(b,x,D)<=18?(O-=18,j+=1,this.words[j]|=T>>>26):O+=8;else{var L=b.length-x;for(D=L%2===0?x+1:x;D=18?(O-=18,j+=1,this.words[j]|=T>>>26):O+=8}this._strip()};function c(k,b,x,P){for(var D=0,O=0,j=Math.min(k.length,x),T=b;T=49?O=L-49+10:L>=17?O=L-17+10:O=L,n(L>=0&&O1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.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];s.prototype.toString=function(b,x){b=b||10,x=x|0||1;var P;if(b===16||b==="hex"){P="";for(var D=0,O=0,j=0;j>>24-D&16777215,D+=2,D>=26&&(D-=26,j--),O!==0||j!==this.length-1?P=h[6-L.length]+L+P:P=L+P}for(O!==0&&(P=O.toString(16)+P);P.length%x!==0;)P="0"+P;return this.negative!==0&&(P="-"+P),P}if(b===(b|0)&&b>=2&&b<=36){var M=g[b],X=m[b];P="";var le=this.clone();for(le.negative=0;!le.isZero();){var H=le.modrn(X).toString(b);le=le.idivn(X),le.isZero()?P=H+P:P=h[M-H.length]+H+P}for(this.isZero()&&(P="0"+P);P.length%x!==0;)P="0"+P;return this.negative!==0&&(P="-"+P),P}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var b=this.words[0];return this.length===2?b+=this.words[1]*67108864:this.length===3&&this.words[2]===1?b+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-b:b},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(b,x){return this.toArrayLike(a,b,x)}),s.prototype.toArray=function(b,x){return this.toArrayLike(Array,b,x)};var w=function(b,x){return b.allocUnsafe?b.allocUnsafe(x):new b(x)};s.prototype.toArrayLike=function(b,x,P){this._strip();var D=this.byteLength(),O=P||Math.max(1,D);n(D<=O,"byte array longer than desired length"),n(O>0,"Requested array length <= 0");var j=w(b,O),T=x==="le"?"LE":"BE";return this["_toArrayLike"+T](j,D),j},s.prototype._toArrayLikeLE=function(b,x){for(var P=0,D=0,O=0,j=0;O>8&255),P>16&255),j===6?(P>24&255),D=0,j=0):(D=T>>>24,j+=2)}if(P=0&&(b[P--]=T>>8&255),P>=0&&(b[P--]=T>>16&255),j===6?(P>=0&&(b[P--]=T>>24&255),D=0,j=0):(D=T>>>24,j+=2)}if(P>=0)for(b[P--]=D;P>=0;)b[P--]=0},Math.clz32?s.prototype._countBits=function(b){return 32-Math.clz32(b)}:s.prototype._countBits=function(b){var x=b,P=0;return x>=4096&&(P+=13,x>>>=13),x>=64&&(P+=7,x>>>=7),x>=8&&(P+=4,x>>>=4),x>=2&&(P+=2,x>>>=2),P+x},s.prototype._zeroBits=function(b){if(b===0)return 26;var x=b,P=0;return x&8191||(P+=13,x>>>=13),x&127||(P+=7,x>>>=7),x&15||(P+=4,x>>>=4),x&3||(P+=2,x>>>=2),x&1||P++,P},s.prototype.bitLength=function(){var b=this.words[this.length-1],x=this._countBits(b);return(this.length-1)*26+x};function E(k){for(var b=new Array(k.bitLength()),x=0;x>>D&1}return b}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var b=0,x=0;xb.length?this.clone().ior(b):b.clone().ior(this)},s.prototype.uor=function(b){return this.length>b.length?this.clone().iuor(b):b.clone().iuor(this)},s.prototype.iuand=function(b){var x;this.length>b.length?x=b:x=this;for(var P=0;Pb.length?this.clone().iand(b):b.clone().iand(this)},s.prototype.uand=function(b){return this.length>b.length?this.clone().iuand(b):b.clone().iuand(this)},s.prototype.iuxor=function(b){var x,P;this.length>b.length?(x=this,P=b):(x=b,P=this);for(var D=0;Db.length?this.clone().ixor(b):b.clone().ixor(this)},s.prototype.uxor=function(b){return this.length>b.length?this.clone().iuxor(b):b.clone().iuxor(this)},s.prototype.inotn=function(b){n(typeof b=="number"&&b>=0);var x=Math.ceil(b/26)|0,P=b%26;this._expand(x),P>0&&x--;for(var D=0;D0&&(this.words[D]=~this.words[D]&67108863>>26-P),this._strip()},s.prototype.notn=function(b){return this.clone().inotn(b)},s.prototype.setn=function(b,x){n(typeof b=="number"&&b>=0);var P=b/26|0,D=b%26;return this._expand(P+1),x?this.words[P]=this.words[P]|1<b.length?(P=this,D=b):(P=b,D=this);for(var O=0,j=0;j>>26;for(;O!==0&&j>>26;if(this.length=P.length,O!==0)this.words[this.length]=O,this.length++;else if(P!==this)for(;jb.length?this.clone().iadd(b):b.clone().iadd(this)},s.prototype.isub=function(b){if(b.negative!==0){b.negative=0;var x=this.iadd(b);return b.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(b),this.negative=1,this._normSign();var P=this.cmp(b);if(P===0)return this.negative=0,this.length=1,this.words[0]=0,this;var D,O;P>0?(D=this,O=b):(D=b,O=this);for(var j=0,T=0;T>26,this.words[T]=x&67108863;for(;j!==0&&T>26,this.words[T]=x&67108863;if(j===0&&T>>26,le=L&67108863,H=Math.min(M,b.length-1),ee=Math.max(0,M-k.length+1);ee<=H;ee++){var Z=M-ee|0;D=k.words[Z]|0,O=b.words[ee]|0,j=D*O+le,X+=j/67108864|0,le=j&67108863}x.words[M]=le|0,L=X|0}return L!==0?x.words[M]=L|0:x.length--,x._strip()}var _=function(b,x,P){var D=b.words,O=x.words,j=P.words,T=0,L,M,X,le=D[0]|0,H=le&8191,ee=le>>>13,Z=D[1]|0,te=Z&8191,re=Z>>>13,W=D[2]|0,q=W&8191,J=W>>>13,me=D[3]|0,be=me&8191,Ce=me>>>13,Fe=D[4]|0,Ue=Fe&8191,Ye=Fe>>>13,lt=D[5]|0,xe=lt&8191,He=lt>>>13,Ve=D[6]|0,Ie=Ve&8191,Ne=Ve>>>13,Oe=D[7]|0,Me=Oe&8191,Y=Oe>>>13,F=D[8]|0,z=F&8191,ie=F>>>13,pe=D[9]|0,ve=pe&8191,he=pe>>>13,Le=O[0]|0,Ze=Le&8191,et=Le>>>13,it=O[1]|0,ut=it&8191,pt=it>>>13,tr=O[2]|0,Wt=tr&8191,At=tr>>>13,mt=O[3]|0,Ct=mt&8191,dt=mt>>>13,Nt=O[4]|0,jt=Nt&8191,gt=Nt>>>13,Vt=O[5]|0,zt=Vt&8191,ot=Vt>>>13,Gt=O[6]|0,Ft=Gt&8191,yt=Gt>>>13,Qe=O[7]|0,Ot=Qe&8191,_t=Qe>>>13,Zt=O[8]|0,Cr=Zt&8191,qt=Zt>>>13,Ar=O[9]|0,cr=Ar&8191,br=Ar>>>13;P.negative=b.negative^x.negative,P.length=19,L=Math.imul(H,Ze),M=Math.imul(H,et),M=M+Math.imul(ee,Ze)|0,X=Math.imul(ee,et);var Q=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(Q>>>26)|0,Q&=67108863,L=Math.imul(te,Ze),M=Math.imul(te,et),M=M+Math.imul(re,Ze)|0,X=Math.imul(re,et),L=L+Math.imul(H,ut)|0,M=M+Math.imul(H,pt)|0,M=M+Math.imul(ee,ut)|0,X=X+Math.imul(ee,pt)|0;var se=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(se>>>26)|0,se&=67108863,L=Math.imul(q,Ze),M=Math.imul(q,et),M=M+Math.imul(J,Ze)|0,X=Math.imul(J,et),L=L+Math.imul(te,ut)|0,M=M+Math.imul(te,pt)|0,M=M+Math.imul(re,ut)|0,X=X+Math.imul(re,pt)|0,L=L+Math.imul(H,Wt)|0,M=M+Math.imul(H,At)|0,M=M+Math.imul(ee,Wt)|0,X=X+Math.imul(ee,At)|0;var de=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(de>>>26)|0,de&=67108863,L=Math.imul(be,Ze),M=Math.imul(be,et),M=M+Math.imul(Ce,Ze)|0,X=Math.imul(Ce,et),L=L+Math.imul(q,ut)|0,M=M+Math.imul(q,pt)|0,M=M+Math.imul(J,ut)|0,X=X+Math.imul(J,pt)|0,L=L+Math.imul(te,Wt)|0,M=M+Math.imul(te,At)|0,M=M+Math.imul(re,Wt)|0,X=X+Math.imul(re,At)|0,L=L+Math.imul(H,Ct)|0,M=M+Math.imul(H,dt)|0,M=M+Math.imul(ee,Ct)|0,X=X+Math.imul(ee,dt)|0;var ue=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(ue>>>26)|0,ue&=67108863,L=Math.imul(Ue,Ze),M=Math.imul(Ue,et),M=M+Math.imul(Ye,Ze)|0,X=Math.imul(Ye,et),L=L+Math.imul(be,ut)|0,M=M+Math.imul(be,pt)|0,M=M+Math.imul(Ce,ut)|0,X=X+Math.imul(Ce,pt)|0,L=L+Math.imul(q,Wt)|0,M=M+Math.imul(q,At)|0,M=M+Math.imul(J,Wt)|0,X=X+Math.imul(J,At)|0,L=L+Math.imul(te,Ct)|0,M=M+Math.imul(te,dt)|0,M=M+Math.imul(re,Ct)|0,X=X+Math.imul(re,dt)|0,L=L+Math.imul(H,jt)|0,M=M+Math.imul(H,gt)|0,M=M+Math.imul(ee,jt)|0,X=X+Math.imul(ee,gt)|0;var we=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(we>>>26)|0,we&=67108863,L=Math.imul(xe,Ze),M=Math.imul(xe,et),M=M+Math.imul(He,Ze)|0,X=Math.imul(He,et),L=L+Math.imul(Ue,ut)|0,M=M+Math.imul(Ue,pt)|0,M=M+Math.imul(Ye,ut)|0,X=X+Math.imul(Ye,pt)|0,L=L+Math.imul(be,Wt)|0,M=M+Math.imul(be,At)|0,M=M+Math.imul(Ce,Wt)|0,X=X+Math.imul(Ce,At)|0,L=L+Math.imul(q,Ct)|0,M=M+Math.imul(q,dt)|0,M=M+Math.imul(J,Ct)|0,X=X+Math.imul(J,dt)|0,L=L+Math.imul(te,jt)|0,M=M+Math.imul(te,gt)|0,M=M+Math.imul(re,jt)|0,X=X+Math.imul(re,gt)|0,L=L+Math.imul(H,zt)|0,M=M+Math.imul(H,ot)|0,M=M+Math.imul(ee,zt)|0,X=X+Math.imul(ee,ot)|0;var Re=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(Re>>>26)|0,Re&=67108863,L=Math.imul(Ie,Ze),M=Math.imul(Ie,et),M=M+Math.imul(Ne,Ze)|0,X=Math.imul(Ne,et),L=L+Math.imul(xe,ut)|0,M=M+Math.imul(xe,pt)|0,M=M+Math.imul(He,ut)|0,X=X+Math.imul(He,pt)|0,L=L+Math.imul(Ue,Wt)|0,M=M+Math.imul(Ue,At)|0,M=M+Math.imul(Ye,Wt)|0,X=X+Math.imul(Ye,At)|0,L=L+Math.imul(be,Ct)|0,M=M+Math.imul(be,dt)|0,M=M+Math.imul(Ce,Ct)|0,X=X+Math.imul(Ce,dt)|0,L=L+Math.imul(q,jt)|0,M=M+Math.imul(q,gt)|0,M=M+Math.imul(J,jt)|0,X=X+Math.imul(J,gt)|0,L=L+Math.imul(te,zt)|0,M=M+Math.imul(te,ot)|0,M=M+Math.imul(re,zt)|0,X=X+Math.imul(re,ot)|0,L=L+Math.imul(H,Ft)|0,M=M+Math.imul(H,yt)|0,M=M+Math.imul(ee,Ft)|0,X=X+Math.imul(ee,yt)|0;var qe=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(qe>>>26)|0,qe&=67108863,L=Math.imul(Me,Ze),M=Math.imul(Me,et),M=M+Math.imul(Y,Ze)|0,X=Math.imul(Y,et),L=L+Math.imul(Ie,ut)|0,M=M+Math.imul(Ie,pt)|0,M=M+Math.imul(Ne,ut)|0,X=X+Math.imul(Ne,pt)|0,L=L+Math.imul(xe,Wt)|0,M=M+Math.imul(xe,At)|0,M=M+Math.imul(He,Wt)|0,X=X+Math.imul(He,At)|0,L=L+Math.imul(Ue,Ct)|0,M=M+Math.imul(Ue,dt)|0,M=M+Math.imul(Ye,Ct)|0,X=X+Math.imul(Ye,dt)|0,L=L+Math.imul(be,jt)|0,M=M+Math.imul(be,gt)|0,M=M+Math.imul(Ce,jt)|0,X=X+Math.imul(Ce,gt)|0,L=L+Math.imul(q,zt)|0,M=M+Math.imul(q,ot)|0,M=M+Math.imul(J,zt)|0,X=X+Math.imul(J,ot)|0,L=L+Math.imul(te,Ft)|0,M=M+Math.imul(te,yt)|0,M=M+Math.imul(re,Ft)|0,X=X+Math.imul(re,yt)|0,L=L+Math.imul(H,Ot)|0,M=M+Math.imul(H,_t)|0,M=M+Math.imul(ee,Ot)|0,X=X+Math.imul(ee,_t)|0;var Be=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(Be>>>26)|0,Be&=67108863,L=Math.imul(z,Ze),M=Math.imul(z,et),M=M+Math.imul(ie,Ze)|0,X=Math.imul(ie,et),L=L+Math.imul(Me,ut)|0,M=M+Math.imul(Me,pt)|0,M=M+Math.imul(Y,ut)|0,X=X+Math.imul(Y,pt)|0,L=L+Math.imul(Ie,Wt)|0,M=M+Math.imul(Ie,At)|0,M=M+Math.imul(Ne,Wt)|0,X=X+Math.imul(Ne,At)|0,L=L+Math.imul(xe,Ct)|0,M=M+Math.imul(xe,dt)|0,M=M+Math.imul(He,Ct)|0,X=X+Math.imul(He,dt)|0,L=L+Math.imul(Ue,jt)|0,M=M+Math.imul(Ue,gt)|0,M=M+Math.imul(Ye,jt)|0,X=X+Math.imul(Ye,gt)|0,L=L+Math.imul(be,zt)|0,M=M+Math.imul(be,ot)|0,M=M+Math.imul(Ce,zt)|0,X=X+Math.imul(Ce,ot)|0,L=L+Math.imul(q,Ft)|0,M=M+Math.imul(q,yt)|0,M=M+Math.imul(J,Ft)|0,X=X+Math.imul(J,yt)|0,L=L+Math.imul(te,Ot)|0,M=M+Math.imul(te,_t)|0,M=M+Math.imul(re,Ot)|0,X=X+Math.imul(re,_t)|0,L=L+Math.imul(H,Cr)|0,M=M+Math.imul(H,qt)|0,M=M+Math.imul(ee,Cr)|0,X=X+Math.imul(ee,qt)|0;var tt=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(tt>>>26)|0,tt&=67108863,L=Math.imul(ve,Ze),M=Math.imul(ve,et),M=M+Math.imul(he,Ze)|0,X=Math.imul(he,et),L=L+Math.imul(z,ut)|0,M=M+Math.imul(z,pt)|0,M=M+Math.imul(ie,ut)|0,X=X+Math.imul(ie,pt)|0,L=L+Math.imul(Me,Wt)|0,M=M+Math.imul(Me,At)|0,M=M+Math.imul(Y,Wt)|0,X=X+Math.imul(Y,At)|0,L=L+Math.imul(Ie,Ct)|0,M=M+Math.imul(Ie,dt)|0,M=M+Math.imul(Ne,Ct)|0,X=X+Math.imul(Ne,dt)|0,L=L+Math.imul(xe,jt)|0,M=M+Math.imul(xe,gt)|0,M=M+Math.imul(He,jt)|0,X=X+Math.imul(He,gt)|0,L=L+Math.imul(Ue,zt)|0,M=M+Math.imul(Ue,ot)|0,M=M+Math.imul(Ye,zt)|0,X=X+Math.imul(Ye,ot)|0,L=L+Math.imul(be,Ft)|0,M=M+Math.imul(be,yt)|0,M=M+Math.imul(Ce,Ft)|0,X=X+Math.imul(Ce,yt)|0,L=L+Math.imul(q,Ot)|0,M=M+Math.imul(q,_t)|0,M=M+Math.imul(J,Ot)|0,X=X+Math.imul(J,_t)|0,L=L+Math.imul(te,Cr)|0,M=M+Math.imul(te,qt)|0,M=M+Math.imul(re,Cr)|0,X=X+Math.imul(re,qt)|0,L=L+Math.imul(H,cr)|0,M=M+Math.imul(H,br)|0,M=M+Math.imul(ee,cr)|0,X=X+Math.imul(ee,br)|0;var wt=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(wt>>>26)|0,wt&=67108863,L=Math.imul(ve,ut),M=Math.imul(ve,pt),M=M+Math.imul(he,ut)|0,X=Math.imul(he,pt),L=L+Math.imul(z,Wt)|0,M=M+Math.imul(z,At)|0,M=M+Math.imul(ie,Wt)|0,X=X+Math.imul(ie,At)|0,L=L+Math.imul(Me,Ct)|0,M=M+Math.imul(Me,dt)|0,M=M+Math.imul(Y,Ct)|0,X=X+Math.imul(Y,dt)|0,L=L+Math.imul(Ie,jt)|0,M=M+Math.imul(Ie,gt)|0,M=M+Math.imul(Ne,jt)|0,X=X+Math.imul(Ne,gt)|0,L=L+Math.imul(xe,zt)|0,M=M+Math.imul(xe,ot)|0,M=M+Math.imul(He,zt)|0,X=X+Math.imul(He,ot)|0,L=L+Math.imul(Ue,Ft)|0,M=M+Math.imul(Ue,yt)|0,M=M+Math.imul(Ye,Ft)|0,X=X+Math.imul(Ye,yt)|0,L=L+Math.imul(be,Ot)|0,M=M+Math.imul(be,_t)|0,M=M+Math.imul(Ce,Ot)|0,X=X+Math.imul(Ce,_t)|0,L=L+Math.imul(q,Cr)|0,M=M+Math.imul(q,qt)|0,M=M+Math.imul(J,Cr)|0,X=X+Math.imul(J,qt)|0,L=L+Math.imul(te,cr)|0,M=M+Math.imul(te,br)|0,M=M+Math.imul(re,cr)|0,X=X+Math.imul(re,br)|0;var Pt=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,L=Math.imul(ve,Wt),M=Math.imul(ve,At),M=M+Math.imul(he,Wt)|0,X=Math.imul(he,At),L=L+Math.imul(z,Ct)|0,M=M+Math.imul(z,dt)|0,M=M+Math.imul(ie,Ct)|0,X=X+Math.imul(ie,dt)|0,L=L+Math.imul(Me,jt)|0,M=M+Math.imul(Me,gt)|0,M=M+Math.imul(Y,jt)|0,X=X+Math.imul(Y,gt)|0,L=L+Math.imul(Ie,zt)|0,M=M+Math.imul(Ie,ot)|0,M=M+Math.imul(Ne,zt)|0,X=X+Math.imul(Ne,ot)|0,L=L+Math.imul(xe,Ft)|0,M=M+Math.imul(xe,yt)|0,M=M+Math.imul(He,Ft)|0,X=X+Math.imul(He,yt)|0,L=L+Math.imul(Ue,Ot)|0,M=M+Math.imul(Ue,_t)|0,M=M+Math.imul(Ye,Ot)|0,X=X+Math.imul(Ye,_t)|0,L=L+Math.imul(be,Cr)|0,M=M+Math.imul(be,qt)|0,M=M+Math.imul(Ce,Cr)|0,X=X+Math.imul(Ce,qt)|0,L=L+Math.imul(q,cr)|0,M=M+Math.imul(q,br)|0,M=M+Math.imul(J,cr)|0,X=X+Math.imul(J,br)|0;var Et=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(Et>>>26)|0,Et&=67108863,L=Math.imul(ve,Ct),M=Math.imul(ve,dt),M=M+Math.imul(he,Ct)|0,X=Math.imul(he,dt),L=L+Math.imul(z,jt)|0,M=M+Math.imul(z,gt)|0,M=M+Math.imul(ie,jt)|0,X=X+Math.imul(ie,gt)|0,L=L+Math.imul(Me,zt)|0,M=M+Math.imul(Me,ot)|0,M=M+Math.imul(Y,zt)|0,X=X+Math.imul(Y,ot)|0,L=L+Math.imul(Ie,Ft)|0,M=M+Math.imul(Ie,yt)|0,M=M+Math.imul(Ne,Ft)|0,X=X+Math.imul(Ne,yt)|0,L=L+Math.imul(xe,Ot)|0,M=M+Math.imul(xe,_t)|0,M=M+Math.imul(He,Ot)|0,X=X+Math.imul(He,_t)|0,L=L+Math.imul(Ue,Cr)|0,M=M+Math.imul(Ue,qt)|0,M=M+Math.imul(Ye,Cr)|0,X=X+Math.imul(Ye,qt)|0,L=L+Math.imul(be,cr)|0,M=M+Math.imul(be,br)|0,M=M+Math.imul(Ce,cr)|0,X=X+Math.imul(Ce,br)|0;var ir=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(ir>>>26)|0,ir&=67108863,L=Math.imul(ve,jt),M=Math.imul(ve,gt),M=M+Math.imul(he,jt)|0,X=Math.imul(he,gt),L=L+Math.imul(z,zt)|0,M=M+Math.imul(z,ot)|0,M=M+Math.imul(ie,zt)|0,X=X+Math.imul(ie,ot)|0,L=L+Math.imul(Me,Ft)|0,M=M+Math.imul(Me,yt)|0,M=M+Math.imul(Y,Ft)|0,X=X+Math.imul(Y,yt)|0,L=L+Math.imul(Ie,Ot)|0,M=M+Math.imul(Ie,_t)|0,M=M+Math.imul(Ne,Ot)|0,X=X+Math.imul(Ne,_t)|0,L=L+Math.imul(xe,Cr)|0,M=M+Math.imul(xe,qt)|0,M=M+Math.imul(He,Cr)|0,X=X+Math.imul(He,qt)|0,L=L+Math.imul(Ue,cr)|0,M=M+Math.imul(Ue,br)|0,M=M+Math.imul(Ye,cr)|0,X=X+Math.imul(Ye,br)|0;var Qt=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,L=Math.imul(ve,zt),M=Math.imul(ve,ot),M=M+Math.imul(he,zt)|0,X=Math.imul(he,ot),L=L+Math.imul(z,Ft)|0,M=M+Math.imul(z,yt)|0,M=M+Math.imul(ie,Ft)|0,X=X+Math.imul(ie,yt)|0,L=L+Math.imul(Me,Ot)|0,M=M+Math.imul(Me,_t)|0,M=M+Math.imul(Y,Ot)|0,X=X+Math.imul(Y,_t)|0,L=L+Math.imul(Ie,Cr)|0,M=M+Math.imul(Ie,qt)|0,M=M+Math.imul(Ne,Cr)|0,X=X+Math.imul(Ne,qt)|0,L=L+Math.imul(xe,cr)|0,M=M+Math.imul(xe,br)|0,M=M+Math.imul(He,cr)|0,X=X+Math.imul(He,br)|0;var rn=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(rn>>>26)|0,rn&=67108863,L=Math.imul(ve,Ft),M=Math.imul(ve,yt),M=M+Math.imul(he,Ft)|0,X=Math.imul(he,yt),L=L+Math.imul(z,Ot)|0,M=M+Math.imul(z,_t)|0,M=M+Math.imul(ie,Ot)|0,X=X+Math.imul(ie,_t)|0,L=L+Math.imul(Me,Cr)|0,M=M+Math.imul(Me,qt)|0,M=M+Math.imul(Y,Cr)|0,X=X+Math.imul(Y,qt)|0,L=L+Math.imul(Ie,cr)|0,M=M+Math.imul(Ie,br)|0,M=M+Math.imul(Ne,cr)|0,X=X+Math.imul(Ne,br)|0;var Mr=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,L=Math.imul(ve,Ot),M=Math.imul(ve,_t),M=M+Math.imul(he,Ot)|0,X=Math.imul(he,_t),L=L+Math.imul(z,Cr)|0,M=M+Math.imul(z,qt)|0,M=M+Math.imul(ie,Cr)|0,X=X+Math.imul(ie,qt)|0,L=L+Math.imul(Me,cr)|0,M=M+Math.imul(Me,br)|0,M=M+Math.imul(Y,cr)|0,X=X+Math.imul(Y,br)|0;var ln=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(ln>>>26)|0,ln&=67108863,L=Math.imul(ve,Cr),M=Math.imul(ve,qt),M=M+Math.imul(he,Cr)|0,X=Math.imul(he,qt),L=L+Math.imul(z,cr)|0,M=M+Math.imul(z,br)|0,M=M+Math.imul(ie,cr)|0,X=X+Math.imul(ie,br)|0;var Ls=(T+L|0)+((M&8191)<<13)|0;T=(X+(M>>>13)|0)+(Ls>>>26)|0,Ls&=67108863,L=Math.imul(ve,cr),M=Math.imul(ve,br),M=M+Math.imul(he,cr)|0,X=Math.imul(he,br);var ca=(T+L|0)+((M&8191)<<13)|0;return T=(X+(M>>>13)|0)+(ca>>>26)|0,ca&=67108863,j[0]=Q,j[1]=se,j[2]=de,j[3]=ue,j[4]=we,j[5]=Re,j[6]=qe,j[7]=Be,j[8]=tt,j[9]=wt,j[10]=Pt,j[11]=Et,j[12]=ir,j[13]=Qt,j[14]=rn,j[15]=Mr,j[16]=ln,j[17]=Ls,j[18]=ca,T!==0&&(j[19]=T,P.length++),P};Math.imul||(_=v);function A(k,b,x){x.negative=b.negative^k.negative,x.length=k.length+b.length;for(var P=0,D=0,O=0;O>>26)|0,D+=j>>>26,j&=67108863}x.words[O]=T,P=j,j=D}return P!==0?x.words[O]=P:x.length--,x._strip()}function C(k,b,x){return A(k,b,x)}s.prototype.mulTo=function(b,x){var P,D=this.length+b.length;return this.length===10&&b.length===10?P=_(this,b,x):D<63?P=v(this,b,x):D<1024?P=A(this,b,x):P=C(this,b,x),P},s.prototype.mul=function(b){var x=new s(null);return x.words=new Array(this.length+b.length),this.mulTo(b,x)},s.prototype.mulf=function(b){var x=new s(null);return x.words=new Array(this.length+b.length),C(this,b,x)},s.prototype.imul=function(b){return this.clone().mulTo(b,this)},s.prototype.imuln=function(b){var x=b<0;x&&(b=-b),n(typeof b=="number"),n(b<67108864);for(var P=0,D=0;D>=26,P+=O/67108864|0,P+=j>>>26,this.words[D]=j&67108863}return P!==0&&(this.words[D]=P,this.length++),x?this.ineg():this},s.prototype.muln=function(b){return this.clone().imuln(b)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(b){var x=E(b);if(x.length===0)return new s(1);for(var P=this,D=0;D=0);var x=b%26,P=(b-x)/26,D=67108863>>>26-x<<26-x,O;if(x!==0){var j=0;for(O=0;O>>26-x}j&&(this.words[O]=j,this.length++)}if(P!==0){for(O=this.length-1;O>=0;O--)this.words[O+P]=this.words[O];for(O=0;O=0);var D;x?D=(x-x%26)/26:D=0;var O=b%26,j=Math.min((b-O)/26,this.length),T=67108863^67108863>>>O<j)for(this.length-=j,M=0;M=0&&(X!==0||M>=D);M--){var le=this.words[M]|0;this.words[M]=X<<26-O|le>>>O,X=le&T}return L&&X!==0&&(L.words[L.length++]=X),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(b,x,P){return n(this.negative===0),this.iushrn(b,x,P)},s.prototype.shln=function(b){return this.clone().ishln(b)},s.prototype.ushln=function(b){return this.clone().iushln(b)},s.prototype.shrn=function(b){return this.clone().ishrn(b)},s.prototype.ushrn=function(b){return this.clone().iushrn(b)},s.prototype.testn=function(b){n(typeof b=="number"&&b>=0);var x=b%26,P=(b-x)/26,D=1<=0);var x=b%26,P=(b-x)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=P)return this;if(x!==0&&P++,this.length=Math.min(P,this.length),x!==0){var D=67108863^67108863>>>x<=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},s.prototype.isubn=function(b){if(n(typeof b=="number"),n(b<67108864),b<0)return this.iaddn(-b);if(this.negative!==0)return this.negative=0,this.iaddn(b),this.negative=1,this;if(this.words[0]-=b,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x>26)-(L/67108864|0),this.words[O+P]=j&67108863}for(;O>26,this.words[O+P]=j&67108863;if(T===0)return this._strip();for(n(T===-1),T=0,O=0;O>26,this.words[O]=j&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(b,x){var P=this.length-b.length,D=this.clone(),O=b,j=O.words[O.length-1]|0,T=this._countBits(j);P=26-T,P!==0&&(O=O.ushln(P),D.iushln(P),j=O.words[O.length-1]|0);var L=D.length-O.length,M;if(x!=="mod"){M=new s(null),M.length=L+1,M.words=new Array(M.length);for(var X=0;X=0;H--){var ee=(D.words[O.length+H]|0)*67108864+(D.words[O.length+H-1]|0);for(ee=Math.min(ee/j|0,67108863),D._ishlnsubmul(O,ee,H);D.negative!==0;)ee--,D.negative=0,D._ishlnsubmul(O,1,H),D.isZero()||(D.negative^=1);M&&(M.words[H]=ee)}return M&&M._strip(),D._strip(),x!=="div"&&P!==0&&D.iushrn(P),{div:M||null,mod:D}},s.prototype.divmod=function(b,x,P){if(n(!b.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var D,O,j;return this.negative!==0&&b.negative===0?(j=this.neg().divmod(b,x),x!=="mod"&&(D=j.div.neg()),x!=="div"&&(O=j.mod.neg(),P&&O.negative!==0&&O.iadd(b)),{div:D,mod:O}):this.negative===0&&b.negative!==0?(j=this.divmod(b.neg(),x),x!=="mod"&&(D=j.div.neg()),{div:D,mod:j.mod}):this.negative&b.negative?(j=this.neg().divmod(b.neg(),x),x!=="div"&&(O=j.mod.neg(),P&&O.negative!==0&&O.isub(b)),{div:j.div,mod:O}):b.length>this.length||this.cmp(b)<0?{div:new s(0),mod:this}:b.length===1?x==="div"?{div:this.divn(b.words[0]),mod:null}:x==="mod"?{div:null,mod:new s(this.modrn(b.words[0]))}:{div:this.divn(b.words[0]),mod:new s(this.modrn(b.words[0]))}:this._wordDiv(b,x)},s.prototype.div=function(b){return this.divmod(b,"div",!1).div},s.prototype.mod=function(b){return this.divmod(b,"mod",!1).mod},s.prototype.umod=function(b){return this.divmod(b,"mod",!0).mod},s.prototype.divRound=function(b){var x=this.divmod(b);if(x.mod.isZero())return x.div;var P=x.div.negative!==0?x.mod.isub(b):x.mod,D=b.ushrn(1),O=b.andln(1),j=P.cmp(D);return j<0||O===1&&j===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},s.prototype.modrn=function(b){var x=b<0;x&&(b=-b),n(b<=67108863);for(var P=(1<<26)%b,D=0,O=this.length-1;O>=0;O--)D=(P*D+(this.words[O]|0))%b;return x?-D:D},s.prototype.modn=function(b){return this.modrn(b)},s.prototype.idivn=function(b){var x=b<0;x&&(b=-b),n(b<=67108863);for(var P=0,D=this.length-1;D>=0;D--){var O=(this.words[D]|0)+P*67108864;this.words[D]=O/b|0,P=O%b}return this._strip(),x?this.ineg():this},s.prototype.divn=function(b){return this.clone().idivn(b)},s.prototype.egcd=function(b){n(b.negative===0),n(!b.isZero());var x=this,P=b.clone();x.negative!==0?x=x.umod(b):x=x.clone();for(var D=new s(1),O=new s(0),j=new s(0),T=new s(1),L=0;x.isEven()&&P.isEven();)x.iushrn(1),P.iushrn(1),++L;for(var M=P.clone(),X=x.clone();!x.isZero();){for(var le=0,H=1;!(x.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(x.iushrn(le);le-- >0;)(D.isOdd()||O.isOdd())&&(D.iadd(M),O.isub(X)),D.iushrn(1),O.iushrn(1);for(var ee=0,Z=1;!(P.words[0]&Z)&&ee<26;++ee,Z<<=1);if(ee>0)for(P.iushrn(ee);ee-- >0;)(j.isOdd()||T.isOdd())&&(j.iadd(M),T.isub(X)),j.iushrn(1),T.iushrn(1);x.cmp(P)>=0?(x.isub(P),D.isub(j),O.isub(T)):(P.isub(x),j.isub(D),T.isub(O))}return{a:j,b:T,gcd:P.iushln(L)}},s.prototype._invmp=function(b){n(b.negative===0),n(!b.isZero());var x=this,P=b.clone();x.negative!==0?x=x.umod(b):x=x.clone();for(var D=new s(1),O=new s(0),j=P.clone();x.cmpn(1)>0&&P.cmpn(1)>0;){for(var T=0,L=1;!(x.words[0]&L)&&T<26;++T,L<<=1);if(T>0)for(x.iushrn(T);T-- >0;)D.isOdd()&&D.iadd(j),D.iushrn(1);for(var M=0,X=1;!(P.words[0]&X)&&M<26;++M,X<<=1);if(M>0)for(P.iushrn(M);M-- >0;)O.isOdd()&&O.iadd(j),O.iushrn(1);x.cmp(P)>=0?(x.isub(P),D.isub(O)):(P.isub(x),O.isub(D))}var le;return x.cmpn(1)===0?le=D:le=O,le.cmpn(0)<0&&le.iadd(b),le},s.prototype.gcd=function(b){if(this.isZero())return b.abs();if(b.isZero())return this.abs();var x=this.clone(),P=b.clone();x.negative=0,P.negative=0;for(var D=0;x.isEven()&&P.isEven();D++)x.iushrn(1),P.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;P.isEven();)P.iushrn(1);var O=x.cmp(P);if(O<0){var j=x;x=P,P=j}else if(O===0||P.cmpn(1)===0)break;x.isub(P)}while(!0);return P.iushln(D)},s.prototype.invm=function(b){return this.egcd(b).a.umod(b)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(b){return this.words[0]&b},s.prototype.bincn=function(b){n(typeof b=="number");var x=b%26,P=(b-x)/26,D=1<>>26,T&=67108863,this.words[j]=T}return O!==0&&(this.words[j]=O,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(b){var x=b<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this._strip();var P;if(this.length>1)P=1;else{x&&(b=-b),n(b<=67108863,"Number is too big");var D=this.words[0]|0;P=D===b?0:Db.length)return 1;if(this.length=0;P--){var D=this.words[P]|0,O=b.words[P]|0;if(D!==O){DO&&(x=1);break}}return x},s.prototype.gtn=function(b){return this.cmpn(b)===1},s.prototype.gt=function(b){return this.cmp(b)===1},s.prototype.gten=function(b){return this.cmpn(b)>=0},s.prototype.gte=function(b){return this.cmp(b)>=0},s.prototype.ltn=function(b){return this.cmpn(b)===-1},s.prototype.lt=function(b){return this.cmp(b)===-1},s.prototype.lten=function(b){return this.cmpn(b)<=0},s.prototype.lte=function(b){return this.cmp(b)<=0},s.prototype.eqn=function(b){return this.cmpn(b)===0},s.prototype.eq=function(b){return this.cmp(b)===0},s.red=function(b){return new K(b)},s.prototype.toRed=function(b){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),b.convertTo(this)._forceRed(b)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(b){return this.red=b,this},s.prototype.forceRed=function(b){return n(!this.red,"Already a number in reduction context"),this._forceRed(b)},s.prototype.redAdd=function(b){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,b)},s.prototype.redIAdd=function(b){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,b)},s.prototype.redSub=function(b){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,b)},s.prototype.redISub=function(b){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,b)},s.prototype.redShl=function(b){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,b)},s.prototype.redMul=function(b){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.mul(this,b)},s.prototype.redIMul=function(b){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.imul(this,b)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(b){return n(this.red&&!b.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,b)};var R={k256:null,p224:null,p192:null,p25519:null};function B(k,b){this.name=k,this.p=new s(b,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}B.prototype._tmp=function(){var b=new s(null);return b.words=new Array(Math.ceil(this.n/13)),b},B.prototype.ireduce=function(b){var x=b,P;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),P=x.bitLength();while(P>this.n);var D=P0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},B.prototype.split=function(b,x){b.iushrn(this.n,0,x)},B.prototype.imulK=function(b){return b.imul(this.k)};function S(){B.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(S,B),S.prototype.split=function(b,x){for(var P=4194303,D=Math.min(b.length,9),O=0;O>>22,j=T}j>>>=22,b.words[O-10]=j,j===0&&b.length>10?b.length-=10:b.length-=9},S.prototype.imulK=function(b){b.words[b.length]=0,b.words[b.length+1]=0,b.length+=2;for(var x=0,P=0;P>>=26,b.words[P]=O,x=D}return x!==0&&(b.words[b.length++]=x),b},s._prime=function(b){if(R[b])return R[b];var x;if(b==="k256")x=new S;else if(b==="p224")x=new U;else if(b==="p192")x=new G;else if(b==="p25519")x=new ae;else throw new Error("Unknown prime "+b);return R[b]=x,x};function K(k){if(typeof k=="string"){var b=s._prime(k);this.m=b.p,this.prime=b}else n(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}K.prototype._verify1=function(b){n(b.negative===0,"red works only with positives"),n(b.red,"red works only with red numbers")},K.prototype._verify2=function(b,x){n((b.negative|x.negative)===0,"red works only with positives"),n(b.red&&b.red===x.red,"red works only with red numbers")},K.prototype.imod=function(b){return this.prime?this.prime.ireduce(b)._forceRed(this):(u(b,b.umod(this.m)._forceRed(this)),b)},K.prototype.neg=function(b){return b.isZero()?b.clone():this.m.sub(b)._forceRed(this)},K.prototype.add=function(b,x){this._verify2(b,x);var P=b.add(x);return P.cmp(this.m)>=0&&P.isub(this.m),P._forceRed(this)},K.prototype.iadd=function(b,x){this._verify2(b,x);var P=b.iadd(x);return P.cmp(this.m)>=0&&P.isub(this.m),P},K.prototype.sub=function(b,x){this._verify2(b,x);var P=b.sub(x);return P.cmpn(0)<0&&P.iadd(this.m),P._forceRed(this)},K.prototype.isub=function(b,x){this._verify2(b,x);var P=b.isub(x);return P.cmpn(0)<0&&P.iadd(this.m),P},K.prototype.shl=function(b,x){return this._verify1(b),this.imod(b.ushln(x))},K.prototype.imul=function(b,x){return this._verify2(b,x),this.imod(b.imul(x))},K.prototype.mul=function(b,x){return this._verify2(b,x),this.imod(b.mul(x))},K.prototype.isqr=function(b){return this.imul(b,b.clone())},K.prototype.sqr=function(b){return this.mul(b,b)},K.prototype.sqrt=function(b){if(b.isZero())return b.clone();var x=this.m.andln(3);if(n(x%2===1),x===3){var P=this.m.add(new s(1)).iushrn(2);return this.pow(b,P)}for(var D=this.m.subn(1),O=0;!D.isZero()&&D.andln(1)===0;)O++,D.iushrn(1);n(!D.isZero());var j=new s(1).toRed(this),T=j.redNeg(),L=this.m.subn(1).iushrn(1),M=this.m.bitLength();for(M=new s(2*M*M).toRed(this);this.pow(M,L).cmp(T)!==0;)M.redIAdd(T);for(var X=this.pow(M,D),le=this.pow(b,D.addn(1).iushrn(1)),H=this.pow(b,D),ee=O;H.cmp(j)!==0;){for(var Z=H,te=0;Z.cmp(j)!==0;te++)Z=Z.redSqr();n(te=0;O--){for(var X=x.words[O],le=M-1;le>=0;le--){var H=X>>le&1;if(j!==D[0]&&(j=this.sqr(j)),H===0&&T===0){L=0;continue}T<<=1,T|=H,L++,!(L!==P&&(O!==0||le!==0))&&(j=this.mul(j,D[T]),L=0,T=0)}M=26}return j},K.prototype.convertTo=function(b){var x=b.umod(this.m);return x===b?x.clone():x},K.prototype.convertFrom=function(b){var x=b.clone();return x.red=null,x},s.mont=function(b){return new N(b)};function N(k){K.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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,K),N.prototype.convertTo=function(b){return this.imod(b.ushln(this.shift))},N.prototype.convertFrom=function(b){var x=this.imod(b.mul(this.rinv));return x.red=null,x},N.prototype.imul=function(b,x){if(b.isZero()||x.isZero())return b.words[0]=0,b.length=1,b;var P=b.imul(x),D=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=P.isub(D).iushrn(this.shift),j=O;return O.cmp(this.m)>=0?j=O.isub(this.m):O.cmpn(0)<0&&(j=O.iadd(this.m)),j._forceRed(this)},N.prototype.mul=function(b,x){if(b.isZero()||x.isZero())return new s(0)._forceRed(this);var P=b.mul(x),D=P.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),O=P.isub(D).iushrn(this.shift),j=O;return O.cmp(this.m)>=0?j=O.isub(this.m):O.cmpn(0)<0&&(j=O.iadd(this.m)),j._forceRed(this)},N.prototype.invm=function(b){var x=this.imod(b._invmp(this.m).mul(this.r2));return x._forceRed(this)}})(t,Xt)})(R$);var N1e=R$.exports;const yr=wo(N1e),FV="bignumber/5.7.0";var p4=yr.BN;const Uu=new Pe(FV),A9={},cj=9007199254740991;function P1e(t){return t!=null&&(nt.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Vr(t)||typeof t=="bigint"||Pg(t))}let uj=!1;class nt{constructor(e,r){e!==A9&&Uu.throwError("cannot call constructor directly; use BigNumber.from",Pe.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ga(jr(this).fromTwos(e))}toTwos(e){return ga(jr(this).toTwos(e))}abs(){return this._hex[0]==="-"?nt.from(this._hex.substring(1)):this}add(e){return ga(jr(this).add(jr(e)))}sub(e){return ga(jr(this).sub(jr(e)))}div(e){return nt.from(e).isZero()&&jo("division-by-zero","div"),ga(jr(this).div(jr(e)))}mul(e){return ga(jr(this).mul(jr(e)))}mod(e){const r=jr(e);return r.isNeg()&&jo("division-by-zero","mod"),ga(jr(this).umod(r))}pow(e){const r=jr(e);return r.isNeg()&&jo("negative-power","pow"),ga(jr(this).pow(r))}and(e){const r=jr(e);return(this.isNegative()||r.isNeg())&&jo("unbound-bitwise-result","and"),ga(jr(this).and(r))}or(e){const r=jr(e);return(this.isNegative()||r.isNeg())&&jo("unbound-bitwise-result","or"),ga(jr(this).or(r))}xor(e){const r=jr(e);return(this.isNegative()||r.isNeg())&&jo("unbound-bitwise-result","xor"),ga(jr(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&jo("negative-width","mask"),ga(jr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&jo("negative-width","shl"),ga(jr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&jo("negative-width","shr"),ga(jr(this).shrn(e))}eq(e){return jr(this).eq(jr(e))}lt(e){return jr(this).lt(jr(e))}lte(e){return jr(this).lte(jr(e))}gt(e){return jr(this).gt(jr(e))}gte(e){return jr(this).gte(jr(e))}isNegative(){return this._hex[0]==="-"}isZero(){return jr(this).isZero()}toNumber(){try{return jr(this).toNumber()}catch{jo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Uu.throwError("this platform does not support BigInt",Pe.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?uj||(uj=!0,Uu.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Uu.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Pe.errors.UNEXPECTED_ARGUMENT,{}):Uu.throwError("BigNumber.toString does not accept parameters",Pe.errors.UNEXPECTED_ARGUMENT,{})),jr(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(A9,A2(e)):e.match(/^-?[0-9]+$/)?new nt(A9,A2(new p4(e))):Uu.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&jo("underflow","BigNumber.from",e),(e>=cj||e<=-cj)&&jo("overflow","BigNumber.from",e),nt.from(String(e));const r=e;if(typeof r=="bigint")return nt.from(r.toString());if(Pg(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"&&(Vr(n)||n[0]==="-"&&Vr(n.substring(1))))return nt.from(n)}return Uu.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function A2(t){if(typeof t!="string")return A2(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Uu.throwArgumentError("invalid hex","value",t),t=A2(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 ga(t){return nt.from(A2(t))}function jr(t){const e=nt.from(t).toHexString();return e[0]==="-"?new p4("-"+e.substring(3),16):new p4(e.substring(2),16)}function jo(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Uu.throwError(t,Pe.errors.NUMERIC_FAULT,n)}function R1e(t){return new p4(t,36).toString(16)}const Gs=new Pe(FV),By={},UV=nt.from(0),BV=nt.from(-1);function WV(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Gs.throwError(t,Pe.errors.NUMERIC_FAULT,i)}let Wy="0";for(;Wy.length<256;)Wy+=Wy;function M$(t){if(typeof t!="number")try{t=nt.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+Wy.substring(0,t):Gs.throwArgumentError("invalid decimal size","decimals",t)}function l5(t,e){e==null&&(e=0);const r=M$(e);t=nt.from(t);const n=t.lt(UV);n&&(t=t.mul(BV));let i=t.mod(r).toString();for(;i.length2&&Gs.throwArgumentError("too many decimal points","value",t);let s=i[0],a=i[1];for(s||(s="0"),a||(a="0");a[a.length-1]==="0";)a=a.substring(0,a.length-1);for(a.length>r.length-1&&WV("fractional component exceeds decimals","underflow","parseFixed"),a===""&&(a="0");a.lengthe[a]==null?l:(typeof e[a]!==o&&Gs.throwArgumentError("invalid fixed format ("+a+" not "+o+")","format."+a,e[a]),e[a]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Gs.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Gs.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new R1(By,r,n,i)}}class os{constructor(e,r,n,i){e!==By&&Gs.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Pe.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&&Gs.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=xc(this._value,this.format.decimals),n=xc(e._value,e.format.decimals);return os.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=xc(this._value,this.format.decimals),n=xc(e._value,e.format.decimals);return os.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=xc(this._value,this.format.decimals),n=xc(e._value,e.format.decimals);return os.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=xc(this._value,this.format.decimals),n=xc(e._value,e.format.decimals);return os.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=os.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(dj.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=os.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(dj.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)&&Gs.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=os.from("1"+Wy.substring(0,e),this.format),i=M1e.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&&Gs.throwArgumentError("invalid byte width","width",e);const r=nt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Dn(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return os.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!P1e(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),os.fromString(l5(e,r),R1.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=R1.from(r),i=xc(e,n.decimals);!n.signed&&i.lt(UV)&&WV("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=Dn(s,n.width/8));const a=l5(i,n.decimals);return new os(By,s,a,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=R1.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 s=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=l5(i,n.decimals);return new os(By,s,a,n)}static from(e,r){if(typeof e=="string")return os.fromString(e,r);if(Pg(e))return os.fromBytes(e,r);try{return os.fromValue(e,0,r)}catch(n){if(n.code!==Pe.errors.INVALID_ARGUMENT)throw n}return Gs.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const dj=os.from(1),M1e=os.from("0.5");var zV={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 s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=Xt:s&&(i=self);var a=!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],E=[224,256,384,512],v=[128,256],_=["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 C=function(H,ee,Z){return function(te){return new M(H,ee,H).update(te)[Z]()}},R=function(H,ee,Z){return function(te,re){return new M(H,ee,re).update(te)[Z]()}},B=function(H,ee,Z){return function(te,re,W,q){return b["cshake"+H].update(te,re,W,q)[Z]()}},S=function(H,ee,Z){return function(te,re,W,q){return b["kmac"+H].update(te,re,W,q)[Z]()}},U=function(H,ee,Z,te){for(var re=0;re<_.length;++re){var W=_[re];H[W]=ee(Z,te,W)}return H},G=function(H,ee){var Z=C(H,ee,"hex");return Z.create=function(){return new M(H,ee,H)},Z.update=function(te){return Z.create().update(te)},U(Z,C,H,ee)},oe=function(H,ee){var Z=R(H,ee,"hex");return Z.create=function(te){return new M(H,ee,te)},Z.update=function(te,re){return Z.create(re).update(te)},U(Z,R,H,ee)},K=function(H,ee){var Z=A[H],te=B(H,ee,"hex");return te.create=function(re,W,q){return!W&&!q?b["shake"+H].create(re):new M(H,ee,re).bytepad([W,q],Z)},te.update=function(re,W,q,J){return te.create(W,q,J).update(re)},U(te,B,H,ee)},N=function(H,ee){var Z=A[H],te=S(H,ee,"hex");return te.create=function(re,W,q){return new X(H,ee,W).bytepad(["KMAC",q],Z).bytepad([re],Z)},te.update=function(re,W,q,J){return te.create(re,q,J).update(W)},U(te,S,H,ee)},k=[{name:"keccak",padding:h,bits:E,createMethod:G},{name:"sha3",padding:g,bits:E,createMethod:G},{name:"shake",padding:u,bits:v,createMethod:oe},{name:"cshake",padding:f,bits:v,createMethod:K},{name:"kmac",padding:f,bits:v,createMethod:N}],b={},x=[],P=0;P>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Z>>5,this.extraBytes=(Z&31)>>3;for(var te=0;te<50;++te)this.s[te]=0}M.prototype.update=function(H){if(this.finalized)throw new Error(r);var ee,Z=typeof H;if(Z!=="string"){if(Z==="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,W=H.length,q=this.blockCount,J=0,me=this.s,be,Ce;J>2]|=H[J]<>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[q],be=0;be>8,Z=H&255;Z>0;)re.unshift(Z),H=H>>8,Z=H&255,++te;return ee?re.push(te):re.unshift(te),this.update(re),re.length},M.prototype.encodeString=function(H){var ee,Z=typeof H;if(Z!=="string"){if(Z==="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 W=0;W=57344?te+=3:(q=65536+((q&1023)<<10|H.charCodeAt(++W)&1023),te+=4)}return te+=this.encode(te*8),this.update(H),te},M.prototype.bytepad=function(H,ee){for(var Z=this.encode(ee),te=0;te>2]|=this.padding[ee&3],this.lastByteIndex===this.byteCount)for(H[0]=H[Z],ee=1;ee>4&15]+c[J&15]+c[J>>12&15]+c[J>>8&15]+c[J>>20&15]+c[J>>16&15]+c[J>>28&15]+c[J>>24&15];W%H===0&&(le(ee),re=0)}return te&&(J=ee[re],q+=c[J>>4&15]+c[J&15],te>1&&(q+=c[J>>12&15]+c[J>>8&15]),te>2&&(q+=c[J>>20&15]+c[J>>16&15])),q},M.prototype.arrayBuffer=function(){this.finalize();var H=this.blockCount,ee=this.s,Z=this.outputBlocks,te=this.extraBytes,re=0,W=0,q=this.outputBits>>3,J;te?J=new ArrayBuffer(Z+1<<2):J=new ArrayBuffer(q);for(var me=new Uint32Array(J);W>8&255,q[J+2]=me>>16&255,q[J+3]=me>>24&255;W%H===0&&le(ee)}return te&&(J=W<<2,me=ee[re],q[J]=me&255,te>1&&(q[J+1]=me>>8&255),te>2&&(q[J+2]=me>>16&255)),q};function X(H,ee,Z){M.call(this,H,ee,Z)}X.prototype=new M,X.prototype.finalize=function(){return this.encode(this.outputBits,!0),M.prototype.finalize.call(this)};var le=function(H){var ee,Z,te,re,W,q,J,me,be,Ce,Fe,Ue,Ye,lt,xe,He,Ve,Ie,Ne,Oe,Me,Y,F,z,ie,pe,ve,he,De,Ze,et,it,ut,pt,tr,Wt,At,mt,Ct,dt,Nt,jt,gt,Vt,zt,at,Gt,Ft,yt,Qe,Ot,_t,Zt,Cr,qt,Ar,cr,br,Q,se,de,ue,we;for(te=0;te<48;te+=2)re=H[0]^H[10]^H[20]^H[30]^H[40],W=H[1]^H[11]^H[21]^H[31]^H[41],q=H[2]^H[12]^H[22]^H[32]^H[42],J=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],Ye=H[9]^H[19]^H[29]^H[39]^H[49],ee=Ue^(q<<1|J>>>31),Z=Ye^(J<<1|q>>>31),H[0]^=ee,H[1]^=Z,H[10]^=ee,H[11]^=Z,H[20]^=ee,H[21]^=Z,H[30]^=ee,H[31]^=Z,H[40]^=ee,H[41]^=Z,ee=re^(me<<1|be>>>31),Z=W^(be<<1|me>>>31),H[2]^=ee,H[3]^=Z,H[12]^=ee,H[13]^=Z,H[22]^=ee,H[23]^=Z,H[32]^=ee,H[33]^=Z,H[42]^=ee,H[43]^=Z,ee=q^(Ce<<1|Fe>>>31),Z=J^(Fe<<1|Ce>>>31),H[4]^=ee,H[5]^=Z,H[14]^=ee,H[15]^=Z,H[24]^=ee,H[25]^=Z,H[34]^=ee,H[35]^=Z,H[44]^=ee,H[45]^=Z,ee=me^(Ue<<1|Ye>>>31),Z=be^(Ye<<1|Ue>>>31),H[6]^=ee,H[7]^=Z,H[16]^=ee,H[17]^=Z,H[26]^=ee,H[27]^=Z,H[36]^=ee,H[37]^=Z,H[46]^=ee,H[47]^=Z,ee=Ce^(re<<1|W>>>31),Z=Fe^(W<<1|re>>>31),H[8]^=ee,H[9]^=Z,H[18]^=ee,H[19]^=Z,H[28]^=ee,H[29]^=Z,H[38]^=ee,H[39]^=Z,H[48]^=ee,H[49]^=Z,lt=H[0],xe=H[1],at=H[11]<<4|H[10]>>>28,Gt=H[10]<<4|H[11]>>>28,he=H[20]<<3|H[21]>>>29,De=H[21]<<3|H[20]>>>29,se=H[31]<<9|H[30]>>>23,de=H[30]<<9|H[31]>>>23,jt=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,Ve=H[12]<<12|H[13]>>>20,Ft=H[22]<<10|H[23]>>>22,yt=H[23]<<10|H[22]>>>22,Ze=H[33]<<13|H[32]>>>19,et=H[32]<<13|H[33]>>>19,ue=H[42]<<2|H[43]>>>30,we=H[43]<<2|H[42]>>>30,Cr=H[5]<<30|H[4]>>>2,qt=H[4]<<30|H[5]>>>2,Wt=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,Ot=H[35]<<15|H[34]>>>17,it=H[45]<<29|H[44]>>>3,ut=H[44]<<29|H[45]>>>3,z=H[6]<<28|H[7]>>>4,ie=H[7]<<28|H[6]>>>4,Ar=H[17]<<23|H[16]>>>9,cr=H[16]<<23|H[17]>>>9,mt=H[26]<<25|H[27]>>>7,Ct=H[27]<<25|H[26]>>>7,Oe=H[36]<<21|H[37]>>>11,Me=H[37]<<21|H[36]>>>11,_t=H[47]<<24|H[46]>>>8,Zt=H[46]<<24|H[47]>>>8,Vt=H[8]<<27|H[9]>>>5,zt=H[9]<<27|H[8]>>>5,pe=H[18]<<20|H[19]>>>12,ve=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,Y=H[48]<<14|H[49]>>>18,F=H[49]<<14|H[48]>>>18,H[0]=lt^~He&Ie,H[1]=xe^~Ve&Ne,H[10]=z^~pe&he,H[11]=ie^~ve&De,H[20]=pt^~Wt&mt,H[21]=tr^~At&Ct,H[30]=Vt^~at&Ft,H[31]=zt^~Gt&yt,H[40]=Cr^~Ar&br,H[41]=qt^~cr&Q,H[2]=He^~Ie&Oe,H[3]=Ve^~Ne&Me,H[12]=pe^~he&Ze,H[13]=ve^~De&et,H[22]=Wt^~mt&dt,H[23]=At^~Ct&Nt,H[32]=at^~Ft&Qe,H[33]=Gt^~yt&Ot,H[42]=Ar^~br&se,H[43]=cr^~Q&de,H[4]=Ie^~Oe&Y,H[5]=Ne^~Me&F,H[14]=he^~Ze&it,H[15]=De^~et&ut,H[24]=mt^~dt&jt,H[25]=Ct^~Nt>,H[34]=Ft^~Qe&_t,H[35]=yt^~Ot&Zt,H[44]=br^~se&ue,H[45]=Q^~de&we,H[6]=Oe^~Y<,H[7]=Me^~F&xe,H[16]=Ze^~it&z,H[17]=et^~ut&ie,H[26]=dt^~jt&pt,H[27]=Nt^~gt&tr,H[36]=Qe^~_t&Vt,H[37]=Ot^~Zt&zt,H[46]=se^~ue&Cr,H[47]=de^~we&qt,H[8]=Y^~lt&He,H[9]=F^~xe&Ve,H[18]=it^~z&pe,H[19]=ut^~ie&ve,H[28]=jt^~pt&Wt,H[29]=gt^~tr&At,H[38]=_t^~Vt&at,H[39]=Zt^~zt&Gt,H[48]=ue^~Cr&Ar,H[49]=we^~qt&cr,H[0]^=w[te],H[1]^=w[te+1]};if(a)t.exports=b;else for(P=0;P>=8;return e}function KO(t,e,r){let n=0;for(let i=0;ie+1+n&&Tc.throwError("child data too short",Pe.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function bV(t,e){if(t.length===0&&Tc.throwError("data too short",Pe.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Tc.throwError("data short segment too short",Pe.errors.BUFFER_OVERRUN,{});const n=KO(t,e+1,r);return e+1+r+n>t.length&&Tc.throwError("data long segment too short",Pe.errors.BUFFER_OVERRUN,{}),YO(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Tc.throwError("data array too short",Pe.errors.BUFFER_OVERRUN,{}),YO(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Tc.throwError("data array too short",Pe.errors.BUFFER_OVERRUN,{});const n=KO(t,e+1,r);e+1+r+n>t.length&&Tc.throwError("data array too short",Pe.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&&Tc.throwError("data too short",Pe.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 C$(t){const e=er(t),r=bV(e,0);return r.consumed!==e.length&&Tc.throwArgumentError("invalid rlp data","data",t),r.result}const Fpe="address/5.7.0",p1=new Pe(Fpe);function ZO(t){Vr(t,20)||p1.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(yi(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 Upe=9007199254740991;function Bpe(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const A$={};for(let t=0;t<10;t++)A$[String(t)]=String(t);for(let t=0;t<26;t++)A$[String.fromCharCode(65+t)]=String(10+t);const JO=Math.floor(Bpe(Upe));function Wpe(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>A$[n]).join("");for(;e.length>=JO;){let n=e.substring(0,JO);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"&&p1.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=ZO(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&p1.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)!==Wpe(t)&&p1.throwArgumentError("bad icap checksum","address",t),e=Mpe(t.substring(4));e.length<40;)e="0"+e;e=ZO("0x"+e)}else p1.throwArgumentError("invalid address","address",t);return e}function zpe(t){try{return Ir(t),!0}catch{}return!1}function _V(t){let e=null;try{e=Ir(t.from)}catch{p1.throwArgumentError("missing from address","transaction",t)}const r=m0(er(nt.from(t.nonce).toHexString()));return Ir(Es(yi(Cv([e,r])),12))}const Hpe="properties/5.7.0";var qpe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const u6=new Pe(Hpe);function ot(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Dc(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 hi(t){return qpe(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function xV(t,e){(!t||typeof t!="object")&&u6.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||u6.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Ti(t){const e={};for(const r in t)e[r]=t[r];return e}const Vpe={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function EV(t){if(t==null||Vpe[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;rfd(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&ot(e,r,fd(n))}return e}return u6.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function fd(t){return Gpe(t)}class Av{constructor(e){for(const r in e)this[r]=fd(e[r])}}const Kpe="abstract-provider/5.7.0";var Ype=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Zpe=new Pe(Kpe);class Jpe extends Av{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class W4{constructor(){Zpe.checkAbstract(new.target,W4),ot(this,"_isProvider",!0)}getFeeData(){return Ype(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield hi({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=nt.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,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 Qpe="networks/5.7.1",QO=new Pe(Qpe);function Xpe(t){return t&&typeof t.renetwork=="function"}function Hu(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 s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return Hu(r)},e}function d6(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return d6(t,n)},r}const XO={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Hu("homestead")},ej={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Hu("ropsten")},tj={chainId:63,name:"classicMordor",_defaultProvider:d6("https://www.ethercluster.com/mordor","classicMordor")},tb={unspecified:{chainId:0,name:"unspecified"},homestead:XO,mainnet:XO,morden:{chainId:2,name:"morden"},ropsten:ej,testnet:ej,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Hu("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Hu("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Hu("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Hu("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:d6("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:tj,classicTestnet:tj,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:d6("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Hu("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Hu("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 e1e(t){if(t==null)return null;if(typeof t=="number"){for(const n in tb){const i=tb[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=tb[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=tb[t.name];if(!e)return typeof t.chainId!="number"&&QO.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&QO.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(Xpe(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 CV(t){t=atob(t);const e=[];for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];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(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>6===2;o++)s++;return s}return t===sa.OVERRUN?r.length-e-1:0}function l1e(t,e,r,n,i){return t===sa.OVERLONG?(n.push(i),0):(n.push(65533),$V(t,e,r))}const c1e=Object.freeze({error:a1e,ignore:$V,replace:l1e});function kV(t,e){e==null&&(e=c1e.error),t=er(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(sa.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(sa.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(sa.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let l=0;l1114111){n+=e(sa.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(sa.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(sa.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function pa(t,e=E2.current){e!=E2.current&&(TV.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 s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return er(r)}function u1e(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Pg(t,e){return u1e(kV(t,e))}function d1e(t,e=E2.current){return kV(pa(t,e))}function g1(t){return yi(pa(t))}const NV="hash/5.7.0";function PV(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(s,o){n.call(s,function(a){o>0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function f1e(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 E=0;for(let R=0;R1;){let oe=B+S>>>1;R>>1|u(),U=U<<1^g,G=(G^g)<<1|g|1;_=U,A=1+G-U}let C=n-4;return v.map(R=>{switch(R-C){case 3:return C+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return C+256+(t[a++]<<8|t[a++]);case 1:return C+t[a++];default:return R-1}})}function p1e(t){let e=0;return()=>t[e++]}function g1e(t){return p1e(h1e(t))}function m1e(t){return t&1?~t>>1:t>>1}function y1e(t,e){let r=Array(t);for(let n=0;ne[o]):r}function w1e(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(_1e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(x1e(r,t))}return f1e(PV(e))}function b1e(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function RV(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function _1e(t,e){let r=1+e(),n=e(),i=b1e(e),s=RV(i.length,1+t,e);return PV(s.map((o,a)=>{const l=o[0],c=o.slice(1);return Array(i[a]).fill(void 0).map((u,f)=>{let h=f*n;return[l+f*r,c.map(g=>g+h)]})}))}function x1e(t,e){let r=1+e();return RV(r,1+t,e).map(i=>[i[0],i.slice(1)])}function E1e(t){let e=f6(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let c=f6(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(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,l=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:l}}}function C1e(){return g1e(CV("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 z4=C1e(),A1e=new Set(f6(z4)),S1e=new Set(f6(z4)),I1e=w1e(z4),T1e=E1e(z4),nj=45,ij=95;function MV(t){return d1e(t)}function $1e(t){return t.filter(e=>e!=65039)}function OV(t){for(let e of t.split(".")){let r=MV(e);try{for(let n=r.lastIndexOf(ij)-1;n>=0;n--)if(r[n]!==ij)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===nj&&r[3]===nj)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function k1e(t){return OV(N1e(t,$1e))}function N1e(t,e){let r=MV(t).reverse(),n=[];for(;r.length;){let i=R1e(r);if(i){n.push(...e(i));continue}let s=r.pop();if(A1e.has(s)){n.push(s);continue}if(S1e.has(s))continue;let o=I1e[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return OV(P1e(String.fromCodePoint(...n)))}function P1e(t){return t.normalize("NFC")}function R1e(t,e){var r;let n=T1e,i,s,o=[],a=t.length;for(;a;){let l=t[--a];if(n=(r=n.branches.find(c=>c.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=l;else if(n.check&&l===s)break;o.push(l),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),t.length=a)}return i}const M1e=new Pe(NV),jV=new Uint8Array(32);jV.fill(0);function sj(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function DV(t){const e=pa(k1e(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(sj(e.slice(n))),r}function o5(t){typeof t!="string"&&M1e.throwArgumentError("invalid ENS name; not a string","name",t);let e=jV;const r=DV(t);for(;r.length;)e=yi($o([e,yi(r.pop())]));return Bt(e)}function O1e(t){return Bt($o(DV(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 j1e=`Ethereum Signed Message: -`;function LV(t){return typeof t=="string"&&(t=pa(t)),yi($o([pa(j1e),pa(String(t.length)),t]))}var D1e=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const zn=new Pe(NV),FV=new Uint8Array(32);FV.fill(0);const L1e=nt.from(-1),UV=nt.from(0),BV=nt.from(1),F1e=nt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function U1e(t){const e=er(t),r=e.length%32;return r?So([e,FV.slice(r)]):Bt(e)}const B1e=Ln(BV.toHexString(),32),W1e=Ln(UV.toHexString(),32),oj={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},w9=["name","version","chainId","verifyingContract","salt"];function aj(t){return function(e){return typeof e!="string"&&zn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const z1e={name:aj("name"),version:aj("version"),chainId:function(t){try{return nt.from(t).toString()}catch{}return zn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ir(t).toLowerCase()}catch{}return zn.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 zn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function b9(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))&&zn.throwArgumentError("invalid numeric width","type",t);const i=F1e.mask(r?n-1:n),s=r?i.add(BV).mul(L1e):UV;return function(o){const a=nt.from(o);return(a.lt(s)||a.gt(i))&&zn.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),Ln(a.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))&&zn.throwArgumentError("invalid bytes width","type",t),function(n){return er(n).length!==r&&zn.throwArgumentError(`invalid length for ${t}`,"value",n),U1e(n)}}}switch(t){case"address":return function(e){return Ln(Ir(e),32)};case"bool":return function(e){return e?B1e:W1e};case"bytes":return function(e){return yi(e)};case"string":return function(e){return g1(e)}}return null}function lj(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class ta{constructor(e){ot(this,"types",Object.freeze(fd(e))),ot(this,"_encoderCache",{}),ot(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const l={};e[a].forEach(c=>{l[c.name]&&zn.throwArgumentError(`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(a)}`,"types",e),l[c.name]=!0;const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===a&&zn.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!b9(u)&&(n[u]||zn.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(a),r[a][u]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?zn.throwArgumentError("missing primary type","types",e):s.length>1&&zn.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),ot(this,"primaryType",s[0]);function o(a,l){l[a]&&zn.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),l[a]=!0,Object.keys(r[a]).forEach(c=>{n[c]&&(o(c,l),Object.keys(l).forEach(u=>{i[u][c]=!0}))}),delete l[a]}o(this.primaryType,{});for(const a in i){const l=Object.keys(i[a]);l.sort(),this._types[a]=lj(a,e[a])+l.map(c=>lj(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=b9(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&zn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let l=a.map(s);return this._types[i]&&(l=l.map(yi)),yi(So(l))}}const n=this.types[e];if(n){const i=g1(this._types[e]);return s=>{const o=n.map(({name:a,type:l})=>{const c=this.getEncoder(l)(s[a]);return this._types[l]?yi(c):c});return o.unshift(i),So(o)}}return zn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||zn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return yi(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(b9(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&zn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(o,l,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:l})=>(o[a]=this._visit(l,r[a],n),o),{}):zn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new ta(e)}static getPrimaryType(e){return ta.from(e).primaryType}static hashStruct(e,r,n){return ta.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=oj[n];i||zn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>w9.indexOf(n.name)-w9.indexOf(i.name)),ta.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return So(["0x1901",ta.hashDomain(e),ta.from(r).hash(n)])}static hash(e,r,n){return yi(ta.encode(e,r,n))}static resolveNames(e,r,n,i){return D1e(this,void 0,void 0,function*(){e=Ti(e);const s={};e.verifyingContract&&!Vr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=ta.from(r);o.visit(n,(a,l)=>(a==="address"&&!Vr(l,20)&&(s[l]="0x"),l));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,l)=>a==="address"&&s[l]?s[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){ta.hashDomain(e);const i={},s=[];w9.forEach(l=>{const c=e[l];c!=null&&(i[l]=z1e[l](c),s.push({name:l,type:oj[l]}))});const o=ta.from(r),a=Ti(r);return a.EIP712Domain?zn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.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"&&zn.throwArgumentError("invalid string","value",c),c}return zn.throwArgumentError("unsupported type","type",l)})}}}var Sv={},Dr={},W0=WV;function WV(t,e){if(!t)throw new Error(e||"Assertion failed")}WV.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var FA={exports:{}};typeof Object.create=="function"?FA.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:FA.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 io=FA.exports,H1e=W0,q1e=io;Dr.inherits=q1e;function V1e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function G1e(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++]=s&63|128):V1e(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Dr.htonl=zV;function Y1e(t,e){for(var r="",n=0;n>>0}return s}Dr.join32=Z1e;function J1e(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}Dr.split32=J1e;function Q1e(t,e){return t>>>e|t<<32-e}Dr.rotr32=Q1e;function X1e(t,e){return t<>>32-e}Dr.rotl32=X1e;function ege(t,e){return t+e>>>0}Dr.sum32=ege;function tge(t,e,r){return t+e+r>>>0}Dr.sum32_3=tge;function rge(t,e,r,n){return t+e+r+n>>>0}Dr.sum32_4=rge;function nge(t,e,r,n,i){return t+e+r+n+i>>>0}Dr.sum32_5=nge;function ige(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Dr.sum64=ige;function sge(t,e,r,n){var i=e+n>>>0,s=(i>>0}Dr.sum64_hi=sge;function oge(t,e,r,n){var i=e+n;return i>>>0}Dr.sum64_lo=oge;function age(t,e,r,n,i,s,o,a){var l=0,c=e;c=c+n>>>0,l+=c>>0,l+=c>>0,l+=c>>0}Dr.sum64_4_hi=age;function lge(t,e,r,n,i,s,o,a){var l=e+n+s+a;return l>>>0}Dr.sum64_4_lo=lge;function cge(t,e,r,n,i,s,o,a,l,c){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}Dr.sum64_5_hi=cge;function uge(t,e,r,n,i,s,o,a,l,c){var u=e+n+s+a+c;return u>>>0}Dr.sum64_5_lo=uge;function dge(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Dr.rotr64_hi=dge;function fge(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Dr.rotr64_lo=fge;function hge(t,e,r){return t>>>r}Dr.shr64_hi=hge;function pge(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Dr.shr64_lo=pge;var Rg={},cj=Dr,gge=W0;function H4(){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}Rg.BlockHash=H4;H4.prototype.update=function(e,r){if(e=cj.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=cj.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}lu.g0_256=bge;function _ge(t){return Wc(t,17)^Wc(t,19)^t>>>10}lu.g1_256=_ge;var J1=Dr,xge=Rg,Ege=lu,_9=J1.rotl32,Wm=J1.sum32,Cge=J1.sum32_5,Age=Ege.ft_1,YV=xge.BlockHash,Sge=[1518500249,1859775393,2400959708,3395469782];function eu(){if(!(this instanceof eu))return new eu;YV.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}J1.inherits(eu,YV);var Ige=eu;eu.blockSize=512;eu.outSize=160;eu.hmacStrength=80;eu.padLength=64;eu.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()),pme(e.length<=this.blockSize);for(var r=e.length;r{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:er(new Uint8Array(i))}})}var wme=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Sl=new Pe(mme);function pj(t){return new Promise(e=>{setTimeout(e,t)})}function Vd(t,e){if(t==null)return null;if(typeof t=="string")return t;if(b$(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return Pg(t)}catch{}return Bt(t)}return t}function bme(t){return pa(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function _me(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;Sl.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;Sl.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};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)&&Sl.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)a[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&&Sl.throwError("basic authentication requires a secure https url",Pe.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const v=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+AV(pa(v))}}t.skipFetchSetup!=null&&(c.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(c.fetchOptions=Ti(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]?CV(g[3]):bme(g[3])};let _=v.body;return r&&(_=r(v.body,v)),Promise.resolve(_)}catch(v){Sl.throwError("processing response error",Pe.errors.SERVER_ERROR,{body:Vd(g[1],g[2]),error:v,requestBody:null,requestMethod:"GET",url:l})}e&&(c.method="POST",c.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const m={};Object.keys(a).forEach(v=>{const _=a[v];m[_.key]=_.value}),c.headers=m;const w=function(){let v=null;return{promise:new Promise(function(C,R){f&&(v=setTimeout(()=>{v!=null&&(v=null,R(Sl.makeError("timeout",Pe.errors.TIMEOUT,{requestBody:Vd(c.body,m["content-type"]),requestMethod:c.method,timeout:f,url:l})))},f))}),cancel:function(){v!=null&&(clearTimeout(v),v=null)}}}(),E=function(){return wme(this,void 0,void 0,function*(){for(let v=0;v=300)&&(w.cancel(),Sl.throwError("bad response",Pe.errors.SERVER_ERROR,{status:_.statusCode,headers:_.headers,body:Vd(A,_.headers?_.headers["content-type"]:null),requestBody:Vd(c.body,m["content-type"]),requestMethod:c.method,url:l})),r)try{const C=yield r(A,_);return w.cancel(),C}catch(C){if(C.throttleRetry&&v{let a=null;if(s!=null)try{a=JSON.parse(Pg(s))}catch(l){Sl.throwError("invalid JSON",Pe.errors.SERVER_ERROR,{body:s,error:l})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=pa(e);const s=typeof t=="string"?{url:t}:Ti(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=Ti(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return _me(t,i,n)}function vy(t,e){return e||(e={}),e=Ti(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,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let l=0;function c(){return t().then(function(u){if(u!==void 0)o()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",c);else if(e.onceBlock)e.onceBlock.once("block",c);else if(!s){if(l++,l>a){o()&&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){o()&&n(u)})}c()})}var h6="qpzry9x8gf2tvdw0s3jn54khce6mua7l",WA={};for(var nb=0;nb>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 oG(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=P1(e)^n>>5}for(e=P1(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=oG(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=P1(n)^o,i+=h6.charAt(o)}for(s=0;s<6;++s)n=P1(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=h6.charAt(a)}return i}function aG(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 s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=oG(s);if(typeof a=="string")return a;for(var l=[],c=0;c=o.length)&&l.push(f)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function Eme(){var t=aG.apply(null,arguments);if(typeof t=="object")return t}function Cme(t){var e=aG.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function q4(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.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(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",l=0;l(h>>1)-1?w=(h>>1)-E:w=E,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 E;m&1?(g=l.andln(7)+f&7,(g===3||g===5)&&w===2?E=-m:E=m):E=0,u[0].push(E);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===E+1&&(f=1-f),2*h===v+1&&(h=1-h),l.iushrn(1),c.iushrn(1)}return u}r.getJSF=i;function s(l,c,u){var f="_"+c;l.prototype[c]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function a(l){return new yr(l,"hex","le")}r.intFromLE=a}),p6=xa.getNAF,Nme=xa.getJSF,g6=xa.assert;function Yf(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 z0=Yf;Yf.prototype.point=function(){throw new Error("Not implemented")};Yf.prototype.validate=function(){throw new Error("Not implemented")};Yf.prototype._fixedNafMul=function(e,r){g6(e.precomputed);var n=e._getDoubles(),i=p6(r,1,this._bitLength),s=(1<=a;c--)l=(l<<1)+i[c];o.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=s;h>0;h--){for(a=0;a=0;l--){for(var c=0;l>=0&&o[l]===0;l--)c++;if(l>=0&&c++,a=a.dblp(c),l<0)break;var u=o[l];g6(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};Yf.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,l=this._wnafT3,c=0,u,f,h;for(u=0;u=1;u-=2){var m=u-1,w=u;if(o[m]!==1||o[w]!==1){l[m]=p6(n[m],o[m],this._bitLength),l[w]=p6(n[w],o[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var E=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(E[1]=r[m].add(r[w]),E[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(E[1]=r[m].toJ().mixedAdd(r[w]),E[2]=r[m].add(r[w].neg())):(E[1]=r[m].toJ().mixedAdd(r[w]),E[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],_=Nme(n[m],n[w]);for(c=Math.max(_[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var S=0;u>=0;){var U=!0;for(f=0;f=0&&S++,R=R.dblp(S),u<0)break;for(f=0;f0?h=a[f][G-1>>1]:G<0&&(h=a[f][-G-1>>1].neg()),h.type==="affine"?R=R.mixedAdd(h):R=R.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};sl.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=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}]};ol.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),l=o.mul(i.a),c=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};ol.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 s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};ol.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};ol.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};rs.prototype.isInfinity=function(){return this.inf};rs.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)};rs.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(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};rs.prototype.getX=function(){return this.x.fromRed()};rs.prototype.getY=function(){return this.y.fromRed()};rs.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)};rs.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};rs.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};rs.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)};rs.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(s){return s.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};rs.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 fs(t,e,r,n){z0.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}T$(fs,z0.BasePoint);ol.prototype.jpoint=function(e,r,n){return new fs(this,e,r,n)};fs.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)};fs.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};fs.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),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),c=o.redSub(a);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(o.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};fs.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),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=s.redSub(o);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=n.redMul(c),h=l.redSqr().redIAdd(u).redISub(f).redISub(f),g=l.redMul(f.redISub(h)).redISub(s.redMul(u)),m=this.z.redMul(a);return this.curve.jpoint(h,g,m)};fs.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(s),this.x.cmp(n)===0)return!0}};fs.prototype.inspect=function(){return this.isInfinity()?"":""};fs.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var a5=jg(function(t,e){var r=e;r.base=z0,r.short=Rme,r.mont=null,r.edwards=null}),l5=jg(function(t,e){var r=e,n=xa.assert;function i(a){a.type==="short"?this.curve=new a5.short(a):a.type==="edwards"?this.curve=new a5.edwards(a):this.curve=new a5.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,l){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var c=new i(l);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:c}),c}})}s("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:Ac.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:Ac.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:Ac.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:Ac.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"]}),s("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:Ac.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ac.sha256,gRed:!1,g:["9"]}),s("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:Ac.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("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:Ac.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Of(t){if(!(this instanceof Of))return new Of(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=Ll.toArray(t.entropy,t.entropyEnc||"hex"),r=Ll.toArray(t.nonce,t.nonceEnc||"hex"),n=Ll.toArray(t.pers,t.persEnc||"hex");I$(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var cG=Of;Of.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 s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Of.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=Ll.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var Mme=xa.assert;function V4(t,e){if(t instanceof V4)return t;this._importDER(t,e)||(Mme(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 G4=V4;function Ome(){this.place=0}function A9(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,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function mj(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)}V4.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=mj(r),n=mj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];S9(i,r.length),i=i.concat(r),i.push(2),S9(i,n.length);var s=i.concat(n),o=[48];return S9(o,s.length),o=o.concat(s),xa.encode(o,e)};var jme=function(){throw new Error("unsupported")},uG=xa.assert;function tl(t){if(!(this instanceof tl))return new tl(t);typeof t=="string"&&(uG(Object.prototype.hasOwnProperty.call(l5,t),"Unknown curve "+t),t=l5[t]),t instanceof l5.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 Dme=tl;tl.prototype.keyPair=function(e){return new $$(this,e)};tl.prototype.keyFromPrivate=function(e,r){return $$.fromPrivate(this,e,r)};tl.prototype.keyFromPublic=function(e,r){return $$.fromPublic(this,e,r)};tl.prototype.genKeyPair=function(e){e||(e={});for(var r=new cG({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||jme(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 s=new yr(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};tl.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};tl.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 s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),l=new cG({hash:this.hash,entropy:o,nonce:a,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 E=(h.getY().isOdd()?1:0)|(g.cmp(m)!==0?2:0);return i.canonical&&w.cmp(this.nh)>0&&(w=this.n.sub(w),E^=1),new G4({r:m,s:w,recoveryParam:E})}}}}}};tl.prototype.verify=function(e,r,n,i){e=this._truncateToN(new yr(e,16)),n=this.keyFromPublic(n,i),r=new G4(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 a=o.invm(this.n),l=a.mul(e).umod(this.n),c=a.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)};tl.prototype.recoverPubKey=function(t,e,r,n){uG((3&r)===r,"The recovery param is more than two bits"),e=new G4(e,n);var i=this.n,s=new yr(t),o=e.r,a=e.s,l=r&1,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),h=a.mul(u).umod(i);return this.g.mulAdd(f,o,h)};tl.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new G4(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Lme=jg(function(t,e){var r=e;r.version="6.5.4",r.utils=xa,r.rand=function(){throw new Error("unsupported")},r.curve=a5,r.curves=l5,r.ec=Dme,r.eddsa=null}),Fme=Lme.ec;const Ume="signing-key/5.7.0",HA=new Pe(Ume);let I9=null;function nf(){return I9||(I9=new Fme("secp256k1")),I9}class Bme{constructor(e){ot(this,"curve","secp256k1"),ot(this,"privateKey",Bt(e)),y0(this.privateKey)!==32&&HA.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=nf().keyFromPrivate(er(this.privateKey));ot(this,"publicKey","0x"+r.getPublic(!1,"hex")),ot(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),ot(this,"_isSigningKey",!0)}_addPoint(e){const r=nf().keyFromPublic(er(this.publicKey)),n=nf().keyFromPublic(er(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=nf().keyFromPrivate(er(this.privateKey)),n=er(e);n.length!==32&&HA.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return B4({recoveryParam:i.recoveryParam,r:Ln("0x"+i.r.toString(16),32),s:Ln("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=nf().keyFromPrivate(er(this.privateKey)),n=nf().keyFromPublic(er(dG(e)));return Ln("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function Wme(t,e){const r=B4(e),n={r:er(r.r),s:er(r.s)};return"0x"+nf().recoverPubKey(er(t),n,r.recoveryParam).encode("hex",!1)}function dG(t,e){const r=er(t);return r.length===32?new Bme(r).publicKey:r.length===33?"0x"+nf().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?Bt(r):HA.throwArgumentError("invalid public or private key","key","[REDACTED]")}const zme="transactions/5.7.0",Ro=new Pe(zme);var yj;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(yj||(yj={}));function k$(t){return t==="0x"?null:Ir(t)}function Ss(t){return t==="0x"?IV:nt.from(t)}const Hme=[{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"}],qme={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Vme(t){const e=dG(t);return Ir(Es(yi(Es(e,1)),12))}function N$(t,e){return Vme(Wme(er(t),e))}function oa(t,e){const r=m0(nt.from(t).toHexString());return r.length>32&&Ro.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function T9(t,e){return{address:Ir(t),storageKeys:(e||[]).map((r,n)=>(y0(r)!==32&&Ro.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function Dg(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Ro.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),T9(r[0],r[1])):T9(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return T9(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function fG(t){return Dg(t).map(e=>[e.address,e.storageKeys])}function hG(t,e){if(t.gasPrice!=null){const n=nt.from(t.gasPrice),i=nt.from(t.maxFeePerGas||0);n.eq(i)||Ro.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[oa(t.chainId||0,"chainId"),oa(t.nonce||0,"nonce"),oa(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),oa(t.maxFeePerGas||0,"maxFeePerGas"),oa(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",oa(t.value||0,"value"),t.data||"0x",fG(t.accessList||[])];if(e){const n=B4(e);r.push(oa(n.recoveryParam,"recoveryParam")),r.push(m0(n.r)),r.push(m0(n.s))}return So(["0x02",Cv(r)])}function pG(t,e){const r=[oa(t.chainId||0,"chainId"),oa(t.nonce||0,"nonce"),oa(t.gasPrice||0,"gasPrice"),oa(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",oa(t.value||0,"value"),t.data||"0x",fG(t.accessList||[])];if(e){const n=B4(e);r.push(oa(n.recoveryParam,"recoveryParam")),r.push(m0(n.r)),r.push(m0(n.s))}return So(["0x01",Cv(r)])}function Gme(t,e){xV(t,qme);const r=[];Hme.forEach(function(i){let s=t[i.name]||[];const o={};i.numeric&&(o.hexPad="left"),s=er(Bt(s,o)),i.length&&s.length!==i.length&&s.length>0&&Ro.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,s),i.maxLength&&(s=m0(s),s.length>i.maxLength&&Ro.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,s)),r.push(Bt(s))});let n=0;return t.chainId!=null&&(n=t.chainId,typeof n!="number"&&Ro.throwArgumentError("invalid transaction.chainId","transaction",t)),n!==0&&(r.push(Bt(n)),r.push("0x"),r.push("0x")),Cv(r)}function Kme(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&Ro.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),Gme(t);switch(t.type){case 1:return pG(t,e);case 2:return hG(t,e)}return Ro.throwError(`unsupported transaction type: ${t.type}`,Pe.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function gG(t,e,r){try{const n=Ss(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Ro.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Ln(e[1],32),t.s=Ln(e[2],32);try{const n=yi(r(t));t.from=N$(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function Yme(t){const e=C$(t.slice(1));e.length!==9&&e.length!==12&&Ro.throwArgumentError("invalid component count for transaction type: 2","payload",Bt(t));const r=Ss(e[2]),n=Ss(e[3]),i={type:2,chainId:Ss(e[0]).toNumber(),nonce:Ss(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ss(e[4]),to:k$(e[5]),value:Ss(e[6]),data:e[7],accessList:Dg(e[8])};return e.length===9||(i.hash=yi(t),gG(i,e.slice(9),hG)),i}function Zme(t){const e=C$(t.slice(1));e.length!==8&&e.length!==11&&Ro.throwArgumentError("invalid component count for transaction type: 1","payload",Bt(t));const r={type:1,chainId:Ss(e[0]).toNumber(),nonce:Ss(e[1]).toNumber(),gasPrice:Ss(e[2]),gasLimit:Ss(e[3]),to:k$(e[4]),value:Ss(e[5]),data:e[6],accessList:Dg(e[7])};return e.length===8||(r.hash=yi(t),gG(r,e.slice(8),pG)),r}function Jme(t){const e=C$(t);e.length!==9&&e.length!==6&&Ro.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Ss(e[0]).toNumber(),gasPrice:Ss(e[1]),gasLimit:Ss(e[2]),to:k$(e[3]),value:Ss(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=Ln(e[7],32),r.s=Ln(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 s=yi(Cv(i));try{r.from=N$(s,{r:Bt(r.r),s:Bt(r.s),recoveryParam:n})}catch{}r.hash=yi(t)}return r.type=null,r}function Qme(t){const e=er(t);if(e[0]>127)return Jme(e);switch(e[0]){case 1:return Zme(e);case 2:return Yme(e)}return Ro.throwError(`unsupported transaction type: ${e[0]}`,Pe.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const Hm=new Pe(Iv);class Rt{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),s=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),l=this.number.bind(this),c=this.type.bind(this),u=f=>this.data(f,!0);return e.transaction={hash:o,type:c,accessList:Rt.allowNull(this.accessList.bind(this),null),blockHash:Rt.allowNull(o,null),blockNumber:Rt.allowNull(l,null),transactionIndex:Rt.allowNull(l,null),confirmations:Rt.allowNull(l,null),from:r,gasPrice:Rt.allowNull(n),maxPriorityFeePerGas:Rt.allowNull(n),maxFeePerGas:Rt.allowNull(n),gasLimit:n,to:Rt.allowNull(r,null),value:n,nonce:l,data:s,r:Rt.allowNull(this.uint256),s:Rt.allowNull(this.uint256),v:Rt.allowNull(l),creates:Rt.allowNull(r,null),raw:Rt.allowNull(s)},e.transactionRequest={from:Rt.allowNull(r),nonce:Rt.allowNull(l),gasLimit:Rt.allowNull(n),gasPrice:Rt.allowNull(n),maxPriorityFeePerGas:Rt.allowNull(n),maxFeePerGas:Rt.allowNull(n),to:Rt.allowNull(r),value:Rt.allowNull(n),data:Rt.allowNull(u),type:Rt.allowNull(l),accessList:Rt.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:Rt.arrayOf(o),data:s,logIndex:l,blockHash:o},e.receipt={to:Rt.allowNull(this.address,null),from:Rt.allowNull(this.address,null),contractAddress:Rt.allowNull(r,null),transactionIndex:l,root:Rt.allowNull(a),gasUsed:n,logsBloom:Rt.allowNull(s),blockHash:o,transactionHash:o,logs:Rt.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:Rt.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:Rt.allowNull(n),status:Rt.allowNull(l),type:c},e.block={hash:Rt.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:Rt.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Rt.allowNull(r),extraData:s,transactions:Rt.allowNull(Rt.arrayOf(o)),baseFeePerGas:Rt.allowNull(n)},e.blockWithTransactions=Ti(e.block),e.blockWithTransactions.transactions=Rt.allowNull(Rt.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Rt.allowNull(i,void 0),toBlock:Rt.allowNull(i,void 0),blockHash:Rt.allowNull(o,void 0),address:Rt.allowNull(r,void 0),topics:Rt.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Rt.allowNull(l),blockHash:Rt.allowNull(o),transactionIndex:l,removed:Rt.allowNull(this.boolean.bind(this)),address:r,data:Rt.allowFalsish(s,"0x"),topics:Rt.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return Dg(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),Vr(e))?e.toLowerCase():Hm.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(!Vr(e,32))return null;const r=Ir(Es(e,12));return r===t1e?null:r}contractAddress(e){return _V(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"||Vr(e))return _$(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return y0(n)!==32?Hm.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(!Vr(e))throw new Error("invalid uint256");return Ln(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=Rt.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 Rt.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=Rt.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;Vr(n)&&(n=nt.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),Vr(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 Qme(e)}receiptLog(e){return Rt.check(this.formats.receiptLog,e)}receipt(e){const r=Rt.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&&Hm.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):Hm.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&Hm.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 Rt.check(this.formats.filter,e)}filterLog(e){return Rt.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}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(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Tr=new Pe(Iv),Xme=10;function vj(t){return t==null?"null":(y0(t)!==32&&Tr.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function wj(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[vj(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return vj(e)}).join("&")}function eye(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 Pp(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:*:"+wj(t);if(Jpe.isForkEvent(t))throw Tr.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+wj(t.topics||[])}throw new Error("invalid event - "+t)}function qm(){return new Date().getTime()}function bj(t){return new Promise(e=>{setTimeout(e,t)})}const tye=["block","network","pending","poll"];let rye=class{constructor(e,r,n){ot(this,"tag",e),ot(this,"listener",r),ot(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=eye(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||tye.indexOf(this.tag)>=0}};const nye={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 $9(t){return Ln(nt.from(t).toHexString(),32)}function _j(t){return LA.encode($o([t,Es(hj(hj(t)),0,4)]))}const mG=new RegExp("^(ipfs)://(.*)$","i"),xj=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),mG,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function c5(t,e){try{return Pg(C2(t,e))}catch{}return null}function C2(t,e){if(t==="0x")return null;const r=nt.from(Es(t,e,e+32)).toNumber(),n=nt.from(Es(t,r,r+32)).toNumber();return Es(t,r+32,r+32+n)}function k9(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Tr.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Ej(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 iye(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function yG(t){const e=[];let r=0;for(let n=0;nnt.from(e).eq(1)).catch(e=>{if(e.code===Pe.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:So([e,o5(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=So(["0x9061b923",yG([O1e(this.name),n.data])]));try{let s=yield this.provider.call(n);return er(s).length%32===4&&Tr.throwError("resolver threw error",Pe.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=C2(s,0)),s}catch(s){if(s.code===Pe.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return hr(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?C2(n,0):null})}_getAddress(e,r){const n=nye[String(e)];if(n==null&&Tr.throwError(`unsupported coin type: ${e}`,Pe.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=er(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return _j($o([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return _j($o([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=gj.toWords(i.slice(2));return a.unshift(o),gj.encode(n.prefix,a)}}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===s1e?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===Pe.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",$9(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Tr.throwError("invalid or unsupported coin data",Pe.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;no[l])}return Tr.throwError("invalid or unsupported content hash data",Pe.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return hr(this,void 0,void 0,function*(){let r=pa(e);r=$o([$9(64),$9(r.length),r]),r.length%32!==0&&(r=$o([r,Ln("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Bt(r));return n==null||n==="0x"?null:Pg(n)})}}let N9=null,sye=1;class oye extends W4{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ot(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=Dc(new.target,"getNetwork")(e);r?(ot(this,"_network",r),this.emit("network",r,null)):Tr.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||Tr.throwError("no network detected",Pe.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:ot(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return vy(()=>this._ready().then(e=>e,e=>{if(!(e.code===Pe.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return N9==null&&(N9=new Rt),N9}static getNetwork(e){return e1e(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(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),f=yield S$({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 Tr.throwError(`response not found during CCIP fetch: ${h}`,Pe.errors.SERVER_ERROR,{url:l,errorMessage:h});o.push(h)}return Tr.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,Pe.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_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 s=yield i;if(qm()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=qm(),n=hi({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=qm();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=sye++,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)Tr.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Tr.makeError("network block skew detected",Pe.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 s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).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(s,c)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(a)}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 Tr.throwError("provider does not support network detection",Pe.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 bj(0),this._network;const n=Tr.makeError("underlying network changed",Pe.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=qm();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 s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{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 bj(1e3),this.getTransactionCount(i.from).then(E=>hr(this,void 0,void 0,function*(){if(!c){if(E<=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()||a(Tr.makeError("timeout exceeded",Pe.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 Tr.throwError("bad result from backend",Pe.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 hi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return nt.from(i)}catch(s){return Tr.throwError("bad result from backend",Pe.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield hi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return nt.from(i).toNumber()}catch(s){return Tr.throwError("bad result from backend",Pe.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield hi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Bt(i)}catch(s){return Tr.throwError("bad result from backend",Pe.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield hi({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>_$(o))}),s=yield this.perform("getStorageAt",i);try{return Bt(s)}catch(o){return Tr.throwError("bad result from backend",Pe.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_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&&Tr.throwError("Transaction hash mismatch from Provider.sendTransaction.",Pe.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>hr(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,s,o,a);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Tr.throwError("transaction failed",Pe.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(s=>Bt(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_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(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?nt.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?Bt(s):null))}),this.formatter.transactionRequest(yield hi(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 hi(r))})}_call(e,r,n){return hr(this,void 0,void 0,function*(){n>=Xme&&Tr.throwError("CCIP read exceeded maximum redirections",Pe.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&y0(s)%32===4)try{const o=Es(s,4),a=Es(o,0,32);nt.from(a).eq(i)||Tr.throwError("CCIP Read sender did not match",Pe.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],c=nt.from(Es(o,32,64)).toNumber(),u=nt.from(Es(o,c,c+32)).toNumber(),f=Es(o,c+32);for(let v=0;vhr(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;lthis._wrapTransaction(l)),a}return this.formatter.block(s)}),{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 vy(()=>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 o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}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 vy(()=>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 o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield hi({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),Rt.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&&Tr.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 Cj(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||Tr.throwError("network does not support ENS",Pe.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+o5(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(Vr(e))throw n}typeof e!="string"&&Tr.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=c5(yield this.call({to:n,data:"0x691f3431"+o5(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(Vr(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new Cj(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==Pe.errors.CALL_EXCEPTION)throw a}try{const a=c5(yield this.call({to:o,data:"0x691f3431"+o5(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==Pe.errors.CALL_EXCEPTION)throw a;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 Tr.throwError(e+" not implemented",Pe.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 rye(Pp(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=[],s=Pp(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Pp(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Pp(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,s=Pp(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Pp(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}const aye="abstract-signer/5.7.0";var _l=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const Ua=new Pe(aye),lye=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],cye=[Pe.errors.INSUFFICIENT_FUNDS,Pe.errors.NONCE_EXPIRED,Pe.errors.REPLACEMENT_UNDERPRICED];class Tv{constructor(){Ua.checkAbstract(new.target,Tv),ot(this,"_isSigner",!0)}getBalance(e){return _l(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return _l(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return _l(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield hi(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return _l(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield hi(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return _l(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 _l(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return _l(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return _l(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return _l(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)lye.indexOf(n)===-1&&Ua.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Ti(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()&&Ua.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return _l(this,void 0,void 0,function*(){const r=yield hi(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>_l(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Ua.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Ua.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Ua.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 s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Ua.throwError("network does not support EIP-1559",Pe.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Ua.throwError("failed to get consistent fee data",Pe.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(cye.indexOf(i.code)>=0)throw i;return Ua.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Pe.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]&&Ua.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield hi(r)})}_checkProvider(e){this.provider||Ua.throwError("missing provider",Pe.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class K4 extends Tv{constructor(e,r){super(),ot(this,"address",e),ot(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Ua.throwError(e,Pe.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 K4(this.address,e)}}var Fu=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const pi=new Pe(Iv),uye=["call","estimateGas"];function By(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=Vr(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=By(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return By(JSON.parse(t),e)}catch{}return null}function vG(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=By(e,!0);if(s)return s.data;pi.throwError("missing revert data in call exception; Transaction reverted without a reason string",Pe.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=By(e.body,!1);s==null&&(s=By(e,!1)),s&&pi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Pe.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===Pe.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)&&pi.throwError("insufficient funds for intrinsic transaction cost",Pe.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&pi.throwError("nonce has already been used",Pe.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&pi.throwError("replacement fee too low",Pe.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&pi.throwError("legacy pre-eip-155 transactions not supported",Pe.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),uye.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&pi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Pe.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Aj(t){return new Promise(function(e){setTimeout(e,t)})}function dye(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 Vm(t){return t&&t.toLowerCase()}const qA={};class wG extends Tv{constructor(e,r,n){if(super(),e!==qA)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ot(this,"provider",r),n==null&&(n=0),typeof n=="string"?(ot(this,"_address",this.provider.formatter.address(n)),ot(this,"_index",null)):typeof n=="number"?(ot(this,"_index",n),ot(this,"_address",null)):pi.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return pi.throwError("cannot alter JSON-RPC Signer connection",Pe.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new fye(qA,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&&pi.throwError("unknown account #"+this._index,Pe.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Ti(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Ti(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Fu(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&pi.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),hi({tx:hi(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&pi.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&pi.throwError("user rejected transaction",Pe.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),vG("sendTransaction",o,s)))})}signTransaction(e){return pi.throwError("signing transactions is unsupported",Pe.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Fu(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 vy(()=>Fu(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 Fu(this,void 0,void 0,function*(){const r=typeof e=="string"?pa(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)&&pi.throwError("user rejected signing",Pe.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Fu(this,void 0,void 0,function*(){const r=typeof e=="string"?pa(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)&&pi.throwError("user rejected signing",Pe.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Fu(this,void 0,void 0,function*(){const i=yield ta.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(ta.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&pi.throwError("user rejected signing",Pe.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return Fu(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class fye extends wG{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 hye={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class bG extends oye{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Dc(this.constructor,"defaultUrl")()),typeof e=="string"?ot(this,"connection",Object.freeze({url:e})):ot(this,"connection",Object.freeze(Ti(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 Fu(this,void 0,void 0,function*(){yield Aj(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=Dc(this.constructor,"getNetwork");try{return r(nt.from(e).toNumber())}catch(n){return pi.throwError("could not detect network",Pe.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return pi.throwError("could not detect network",Pe.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new wG(qA,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:fd(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=S$(this.connection,JSON.stringify(n),dye).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Vm(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Vm(r.address),r.blockTag]];case"getCode":return["eth_getCode",[Vm(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Vm(r.address),Ln(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",[Dc(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Dc(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=Vm(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Fu(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 s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Ti(r),r.transaction=Ti(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&pi.throwError(e+" not implemented",Pe.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return vG(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(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(l){return e.emit("pending",l),null})})}),o.then(function(){return Aj(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}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=Ti(hye);if(r)for(const s in r)r[s]&&(n[s]=!0);xV(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=_$(nt.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=Bt(e[s]))}),e.accessList&&(i.accessList=Dg(e.accessList)),i}}var pye=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const gye=new Pe(Iv);class mye extends bG{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return pye(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||gye.throwError("no network detected",Pe.errors.UNKNOWN_ERROR,{}),this._network==null&&(ot(this,"_network",r),this.emit("network",r,null))),r})}}const Sj=new Pe(Iv);let yye=1;function Ij(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:yye++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:fd(s),provider:this}),e(s,(l,c)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:s,provider:this}),a(l);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:c,provider:this}),c.error){const u=new Error(c.error.message);return u.code=c.error.code,u.data=c.error.data,a(u)}o(c.result)})})}}function vye(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:fd(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 m6 extends bG{constructor(e,r){e==null&&Sj.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=vye(e)):e.sendAsync?i=Ij(e,e.sendAsync.bind(e)):e.send?i=Ij(e,e.send.bind(e)):Sj.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),ot(this,"jsonRpcFetchFunc",i),ot(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}function wye(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 bye(){const t=new Set;let e=[];const r=()=>wye(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(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(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n==null||n(),n=r()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}var kt={},VA={exports:{}};(function(t,e){(function(r,n){var i="1.0.40",s="",o="?",a="function",l="undefined",c="object",u="string",f="major",h="model",g="name",m="type",w="vendor",E="version",v="architecture",_="console",A="mobile",C="tablet",R="smarttv",B="wearable",S="embedded",U=500,G="Amazon",oe="Apple",K="ASUS",N="BlackBerry",k="Browser",b="Chrome",x="Edge",P="Firefox",L="Google",O="Huawei",j="LG",I="Microsoft",D="Motorola",M="Opera",X="Samsung",le="Sharp",H="Sony",ee="Xiaomi",Z="Zebra",te="Facebook",re="Chromium OS",W="Mac OS",q=" Browser",J=function(Me,Y){var F={};for(var z in Me)Y[z]&&Y[z].length%2===0?F[z]=Y[z].concat(Me[z]):F[z]=Me[z];return F},me=function(Me){for(var Y={},F=0;F0?ve.length===2?typeof ve[1]==a?this[ve[0]]=ve[1].call(this,De):this[ve[0]]=ve[1]:ve.length===3?typeof ve[1]===a&&!(ve[1].exec&&ve[1].test)?this[ve[0]]=De?ve[1].call(this,De,ve[2]):n:this[ve[0]]=De?De.replace(ve[1],ve[2]):n:ve.length===4&&(this[ve[0]]=De?ve[3].call(this,De.replace(ve[1],ve[2])):n):this[ve]=De||n;F+=2}},lt=function(Me,Y){for(var F in Y)if(typeof Y[F]===c&&Y[F].length>0){for(var z=0;z2&&(he[h]="iPad",he[m]=C),he},this.getEngine=function(){var he={};return he[g]=n,he[E]=n,Ye.call(he,z,pe.engine),he},this.getOS=function(){var he={};return he[g]=n,he[E]=n,Ye.call(he,z,pe.os),ve&&!he[g]&&ie&&ie.platform&&ie.platform!="Unknown"&&(he[g]=ie.platform.replace(/chrome os/i,re).replace(/macos/i,W)),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 z},this.setUA=function(he){return z=typeof he===u&&he.length>U?Ue(he,U):he,this},this.setUA(z),this};Ie.VERSION=i,Ie.BROWSER=me([g,E,f]),Ie.CPU=me([v]),Ie.DEVICE=me([h,w,m,_,A,R,C,B,S]),Ie.ENGINE=Ie.OS=me([g,E]),t.exports&&(e=t.exports=Ie),e.UAParser=Ie;var Ne=typeof r!==l&&(r.jQuery||r.Zepto);if(Ne&&!Ne.ua){var Oe=new Ie;Ne.ua=Oe.getResult(),Ne.ua.get=function(){return Oe.getUA()},Ne.ua.set=function(Me){Oe.setUA(Me);var Y=Oe.getResult();for(var F in Y)Ne.ua[F]=Y[F]}}})(typeof window=="object"?window:Xt)})(VA,VA.exports);var _ye=VA.exports;Object.defineProperty(kt,"__esModule",{value:!0});function xye(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Rs=T,An=xye(Rs),_G=_ye,Zf=new _G,js=Zf.getBrowser(),Eye=Zf.getCPU(),Ea=Zf.getDevice(),P$=Zf.getEngine(),Jf=Zf.getOS(),$v=Zf.getUA(),xG=function(e){return Zf.setUA(e)},kv=function(e){if(!e){console.error("No userAgent string was provided");return}var r=new _G(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)}}},EG=Object.freeze({ClientUAInstance:Zf,browser:js,cpu:Eye,device:Ea,engine:P$,os:Jf,ua:$v,setUa:xG,parseUserAgent:kv});function Tj(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 Cye(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function al(t,e){if(t==null)return{};var r=kye(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function u5(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Nye(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 u5(t)}function Pye(t,e){return Rye(t)||Mye(t,e)||Oye(t,e)||jye()}function Rye(t){if(Array.isArray(t))return t}function Mye(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,o,a;try{for(r=r.call(t);!(i=(o=r.next()).done)&&(n.push(o.value),!(e&&n.length===e));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw a}}return n}}function Oye(t,e){if(t){if(typeof t=="string")return $j(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 $j(t,e)}}function $j(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},R$=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},M$=function(e){var r=R$();return r&&r.platform&&(r.platform.indexOf(e)!==-1||r.platform==="MacIntel"&&r.maxTouchPoints>1&&!window.MSStream)},Uye=function(e,r,n,i,s){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(s)}},kj=function(e,r,n,i){return Cye({},e,{vendor:dr(r.vendor),model:dr(r.model),os:dr(n.name),osVersion:dr(n.version),ua:dr(i)})},Bye=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)}},Wye=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)}},zye=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)}},Hye=function(e,r,n,i,s){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(s)}};function qye(t){var e=t?kv(t):EG,r=e.device,n=e.browser,i=e.engine,s=e.os,o=e.ua,a=Lye(r.type),l=a.isBrowser,c=a.isMobile,u=a.isTablet,f=a.isSmartTV,h=a.isConsole,g=a.isWearable,m=a.isEmbedded;if(l)return Uye(l,n,i,s,o);if(f)return Bye(f,i,s,o);if(h)return Wye(h,i,s,o);if(c||u)return kj(a,r,s,o);if(g)return zye(g,i,s,o);if(m)return Hye(m,r,i,s,o)}var CG=function(e){var r=e.type;return r===Cs.Mobile},AG=function(e){var r=e.type;return r===Cs.Tablet},SG=function(e){var r=e.type;return r===Cs.Mobile||r===Cs.Tablet},IG=function(e){var r=e.type;return r===Cs.SmartTv},y6=function(e){var r=e.type;return r===Cs.Browser},TG=function(e){var r=e.type;return r===Cs.Wearable},$G=function(e){var r=e.type;return r===Cs.Console},kG=function(e){var r=e.type;return r===Cs.Embedded},NG=function(e){var r=e.vendor;return dr(r)},PG=function(e){var r=e.model;return dr(r)},RG=function(e){var r=e.type;return dr(r,"browser")},MG=function(e){var r=e.name;return r===Lg.Android},OG=function(e){var r=e.name;return r===Lg.Windows},jG=function(e){var r=e.name;return r===Lg.MAC_OS},DG=function(e){var r=e.name;return r===Lg.WindowsPhone},LG=function(e){var r=e.name;return r===Lg.IOS},FG=function(e){var r=e.version;return dr(r)},UG=function(e){var r=e.name;return dr(r)},BG=function(e){var r=e.name;return r===Do.Chrome},WG=function(e){var r=e.name;return r===Do.Firefox},zG=function(e){var r=e.name;return r===Do.Chromium},v6=function(e){var r=e.name;return r===Do.Edge},HG=function(e){var r=e.name;return r===Do.Yandex},qG=function(e){var r=e.name;return r===Do.Safari||r===Do.MobileSafari},VG=function(e){var r=e.name;return r===Do.MobileSafari},GG=function(e){var r=e.name;return r===Do.Opera},KG=function(e){var r=e.name;return r===Do.InternetExplorer||r===Do.Ie},YG=function(e){var r=e.name;return r===Do.MIUI},ZG=function(e){var r=e.name;return r===Do.SamsungBrowser},JG=function(e){var r=e.version;return dr(r)},QG=function(e){var r=e.major;return dr(r)},XG=function(e){var r=e.name;return dr(r)},eK=function(e){var r=e.name;return dr(r)},tK=function(e){var r=e.version;return dr(r)},rK=function(){var e=R$(),r=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof r=="string"?/electron/.test(r):!1},R1=function(e){return typeof e=="string"&&e.indexOf("Edg/")!==-1},nK=function(){var e=R$();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform==="MacIntel"&&e.maxTouchPoints>1)&&!window.MSStream},Pc=function(){return M$("iPad")},iK=function(){return M$("iPhone")},sK=function(){return M$("iPod")},oK=function(e){return dr(e)};function aK(t){var e=t||EG,r=e.device,n=e.browser,i=e.os,s=e.engine,o=e.ua;return{isSmartTV:IG(r),isConsole:$G(r),isWearable:TG(r),isEmbedded:kG(r),isMobileSafari:VG(n)||Pc(),isChromium:zG(n),isMobile:SG(r)||Pc(),isMobileOnly:CG(r),isTablet:AG(r)||Pc(),isBrowser:y6(r),isDesktop:y6(r),isAndroid:MG(i),isWinPhone:DG(i),isIOS:LG(i)||Pc(),isChrome:BG(n),isFirefox:WG(n),isSafari:qG(n),isOpera:GG(n),isIE:KG(n),osVersion:FG(i),osName:UG(i),fullBrowserVersion:JG(n),browserVersion:QG(n),browserName:XG(n),mobileVendor:NG(r),mobileModel:PG(r),engineName:eK(s),engineVersion:tK(s),getUA:oK(o),isEdge:v6(n)||R1(o),isYandex:HG(n),deviceType:RG(r),isIOS13:nK(),isIPad13:Pc(),isIPhone13:iK(),isIPod13:sK(),isElectron:rK(),isEdgeChromium:R1(o),isLegacyEdge:v6(n)&&!R1(o),isWindows:OG(i),isMacOs:jG(i),isMIUI:YG(n),isSamsungBrowser:ZG(n)}}var lK=IG(Ea),cK=$G(Ea),uK=TG(Ea),Vye=kG(Ea),Gye=VG(js)||Pc(),Kye=zG(js),Y4=SG(Ea)||Pc(),dK=CG(Ea),fK=AG(Ea)||Pc(),hK=y6(Ea),Yye=y6(Ea),pK=MG(Jf),gK=DG(Jf),mK=LG(Jf)||Pc(),Zye=BG(js),Jye=WG(js),Qye=qG(js),Xye=GG(js),yK=KG(js),e2e=FG(Jf),t2e=UG(Jf),r2e=JG(js),n2e=QG(js),i2e=XG(js),s2e=NG(Ea),o2e=PG(Ea),a2e=eK(P$),l2e=tK(P$),c2e=oK($v),u2e=v6(js)||R1($v),d2e=HG(js),f2e=RG(Ea),h2e=nK(),p2e=Pc(),g2e=iK(),m2e=sK(),y2e=rK(),v2e=R1($v),w2e=v6(js)&&!R1($v),b2e=OG(Jf),_2e=jG(Jf),x2e=YG(js),E2e=ZG(js),C2e=function(e){if(!e||typeof e!="string"){console.error("No valid user agent string was provided");return}var r=kv(e),n=r.device,i=r.browser,s=r.os,o=r.engine,a=r.ua;return aK({device:n,browser:i,os:s,engine:o,ua:a})},A2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return pK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},S2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return hK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},I2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return yK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},T2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return mK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},$2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return Y4?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},k2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return fK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},N2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return gK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},P2e=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=al(e,["renderWithFragment","children","viewClassName","style"]);return dK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},R2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return lK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},M2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return cK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},O2e=function(e){var r=e.renderWithFragment,n=e.children,i=al(e,["renderWithFragment","children"]);return uK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},j2e=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=e.condition,s=al(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",s,n):null};function D2e(t){return function(e){$ye(r,e);function r(n){var i;return Aye(this,r),i=Nye(this,KA(r).call(this,n)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(u5(i)),i.onOrientationChange=i.onOrientationChange.bind(u5(i)),i.onPageLoad=i.onPageLoad.bind(u5(i)),i.state={isLandscape:!1,isPortrait:!1},i}return Iye(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":Wy(window))!==void 0&&Y4&&(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 An.createElement(t,GA({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),r}(An.Component)}function L2e(){var t=Rs.useState(function(){var s=window.innerWidth>window.innerHeight?90:0;return{isPortrait:s===0,isLandscape:s===90,orientation:s===0?"portrait":"landscape"}}),e=Pye(t,2),r=e[0],n=e[1],i=Rs.useCallback(function(){var s=window.innerWidth>window.innerHeight?90:0,o={isPortrait:s===0,isLandscape:s===90,orientation:s===0?"portrait":"landscape"};r.orientation!==o.orientation&&n(o)},[r.orientation]);return Rs.useEffect(function(){return(typeof window>"u"?"undefined":Wy(window))!==void 0&&Y4&&(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 vK(t){var e=t||window.navigator.userAgent;return kv(e)}function F2e(t){var e=t||window.navigator.userAgent,r=vK(e),n=aK(r);return[n,r]}kt.AndroidView=A2e;kt.BrowserTypes=Do;kt.BrowserView=S2e;kt.ConsoleView=M2e;kt.CustomView=j2e;kt.IEView=I2e;kt.IOSView=T2e;kt.MobileOnlyView=P2e;kt.MobileView=$2e;kt.OsTypes=Lg;kt.SmartTVView=R2e;kt.TabletView=k2e;kt.WearableView=O2e;kt.WinPhoneView=N2e;kt.browserName=i2e;kt.browserVersion=n2e;kt.deviceDetect=qye;kt.deviceType=f2e;kt.engineName=a2e;kt.engineVersion=l2e;kt.fullBrowserVersion=r2e;kt.getSelectorsByUserAgent=C2e;kt.getUA=c2e;var U2e=kt.isAndroid=pK;kt.isBrowser=hK;kt.isChrome=Zye;kt.isChromium=Kye;kt.isConsole=cK;kt.isDesktop=Yye;kt.isEdge=u2e;kt.isEdgeChromium=v2e;kt.isElectron=y2e;kt.isEmbedded=Vye;var B2e=kt.isFirefox=Jye;kt.isIE=yK;var O$=kt.isIOS=mK;kt.isIOS13=h2e;kt.isIPad13=p2e;kt.isIPhone13=g2e;kt.isIPod13=m2e;kt.isLegacyEdge=w2e;kt.isMIUI=x2e;kt.isMacOs=_2e;var cs=kt.isMobile=Y4;kt.isMobileOnly=dK;kt.isMobileSafari=Gye;kt.isOpera=Xye;var W2e=kt.isSafari=Qye;kt.isSamsungBrowser=E2e;kt.isSmartTV=lK;kt.isTablet=fK;kt.isWearable=uK;kt.isWinPhone=gK;kt.isWindows=b2e;kt.isYandex=d2e;kt.mobileModel=o2e;kt.mobileVendor=s2e;kt.osName=t2e;kt.osVersion=e2e;kt.parseUserAgent=kv;kt.setUserAgent=Fye;kt.useDeviceData=vK;kt.useDeviceSelectors=F2e;kt.useMobileOrientation=L2e;kt.withOrientationChange=D2e;const Nv="abi/5.7.0",Br=new Pe(Nv),w0={};let Nj={calldata:!0,memory:!0,storage:!0},z2e={calldata:!0,memory:!0};function ib(t,e){if(t==="bytes"||t==="string"){if(Nj[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&z2e[e])return!0;return(Nj[e]||e==="payable")&&Br.throwArgumentError("invalid modifier","name",e),!1}function H2e(t,e){let r=t;function n(a){Br.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let l={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(l.indexed=!1),l}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.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!==Yr.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===Yr.full?", ":",")+")"):r+=this.type,e!==Yr.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Yr.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?zi.fromString(e,r):zi.fromObject(e)}static fromObject(e){return zi.isParamType(e)?e:new zi(w0,{name:e.name||null,type:Zp(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(zi.fromObject):null})}static fromString(e,r){function n(i){return zi.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(H2e(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function A2(t,e){return G2e(t).map(r=>zi.fromString(r,e))}class td{constructor(e,r){e!==w0&&Br.throwError("use a static from method",Pe.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),d5(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return td.isFragment(e)?e:typeof e=="string"?td.fromString(e):td.fromObject(e)}static fromObject(e){if(td.isFragment(e))return e;switch(e.type){case"function":return Mc.fromObject(e);case"event":return Ju.fromObject(e);case"constructor":return Rc.fromObject(e);case"error":return cf.fromObject(e);case"fallback":case"receive":return null}return Br.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"?Ju.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Mc.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Rc.fromString(e.trim()):e.split(" ")[0]==="error"?cf.fromString(e.substring(5).trim()):Br.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Ju extends td{format(e){if(e||(e=Yr.sighash),Yr[e]||Br.throwArgumentError("invalid format type","format",e),e===Yr.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!==Yr.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Yr.full?", ":",")+") ",e!==Yr.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Ju.fromString(e):Ju.fromObject(e)}static fromObject(e){if(Ju.isEventFragment(e))return e;e.type!=="event"&&Br.throwArgumentError("invalid event object","value",e);const r={name:S2(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(zi.fromObject):[],type:"event"};return new Ju(w0,r)}static fromString(e){let r=e.match(I2);r||Br.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:Br.warn("unknown modifier: "+i)}}),Ju.fromObject({name:r[1].trim(),anonymous:n,inputs:A2(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function wK(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Br.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Br.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=nt.from(r[1]),r[0]):t}function bK(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 _K(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&&Br.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Br.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"&&Br.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&&Br.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"&&Br.throwArgumentError("unable to determine stateMutability","value",t),e}class Rc extends td{format(e){if(e||(e=Yr.sighash),Yr[e]||Br.throwArgumentError("invalid format type","format",e),e===Yr.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===Yr.sighash&&Br.throwError("cannot format a constructor for sighash",Pe.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===Yr.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Rc.fromString(e):Rc.fromObject(e)}static fromObject(e){if(Rc.isConstructorFragment(e))return e;e.type!=="constructor"&&Br.throwArgumentError("invalid constructor object","value",e);let r=_K(e);r.constant&&Br.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(zi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new Rc(w0,n)}static fromString(e){let r={type:"constructor"};e=wK(e,r);let n=e.match(I2);return(!n||n[1].trim()!=="constructor")&&Br.throwArgumentError("invalid constructor string","value",e),r.inputs=A2(n[2].trim(),!1),bK(n[3].trim(),r),Rc.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Mc extends Rc{format(e){if(e||(e=Yr.sighash),Yr[e]||Br.throwArgumentError("invalid format type","format",e),e===Yr.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!==Yr.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Yr.full?", ":",")+") ",e!==Yr.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"?Mc.fromString(e):Mc.fromObject(e)}static fromObject(e){if(Mc.isFunctionFragment(e))return e;e.type!=="function"&&Br.throwArgumentError("invalid function object","value",e);let r=_K(e);const n={type:e.type,name:S2(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(zi.fromObject):[],outputs:e.outputs?e.outputs.map(zi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new Mc(w0,n)}static fromString(e){let r={type:"function"};e=wK(e,r);let n=e.split(" returns ");n.length>2&&Br.throwArgumentError("invalid function string","value",e);let i=n[0].match(I2);if(i||Br.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&S2(r.name),r.inputs=A2(i[2],!1),bK(i[3].trim(),r),n.length>1){let s=n[1].match(I2);(s[1].trim()!=""||s[3].trim()!="")&&Br.throwArgumentError("unexpected tokens","value",e),r.outputs=A2(s[2],!1)}else r.outputs=[];return Mc.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function Pj(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Br.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class cf extends td{format(e){if(e||(e=Yr.sighash),Yr[e]||Br.throwArgumentError("invalid format type","format",e),e===Yr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Yr.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Yr.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?cf.fromString(e):cf.fromObject(e)}static fromObject(e){if(cf.isErrorFragment(e))return e;e.type!=="error"&&Br.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:S2(e.name),inputs:e.inputs?e.inputs.map(zi.fromObject):[]};return Pj(new cf(w0,r))}static fromString(e){let r={type:"error"},n=e.match(I2);return n||Br.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&S2(r.name),r.inputs=A2(n[2],!1),Pj(cf.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Zp(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const V2e=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function S2(t){return(!t||!t.match(V2e))&&Br.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const I2=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function G2e(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&j$.throwError("value out-of-bounds",Pe.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=$o([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 w6{constructor(e,r,n,i){ot(this,"_data",er(e)),ot(this,"wordSize",r||32),ot(this,"_coerceFunc",n),ot(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):w6.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:j$.throwError("data out-of-bounds",Pe.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new w6(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 Y2e extends Td{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(Ln(e.readValue().toHexString(),20))}}class Z2e extends Td{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 m1=new Pe(Nv);function xK(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||m1.throwError("cannot encode object for signature with missing names",Pe.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]&&m1.throwError("cannot encode object for signature with duplicate names",Pe.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]=!0,r[u]})}else m1.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&m1.throwArgumentError("types/value length mismatch","tuple",r);let i=new ZA(t.wordSize),s=new ZA(t.wordSize),o=[];e.forEach((l,c)=>{let u=n[c];if(l.dynamic){let f=s.length;l.encode(s,u);let h=i.writeUpdatableValue();o.push(g=>{h(g+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function EK(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),l=n.subReader(a.toNumber());try{o=s.decode(l)}catch(c){if(c.code===Pe.errors.BUFFER_OVERRUN)throw c;o=c,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===Pe.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw l}}):r[a]=l});for(let s=0;s{throw o}})}return Object.freeze(r)}class J2e extends Td{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&m1.throwError("insufficient data length",Pe.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return xK(e,this.coders,r)}decode(e){return e.coerce(this.name,EK(e,this.coders))}}const ob=new Pe(Nv),ive=new RegExp(/^bytes([0-9]*)$/),sve=new RegExp(/^(u?int)([0-9]*)$/);class ove{constructor(e){ot(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Y2e(e.name);case"bool":return new Q2e(e.name);case"string":return new nve(e.name);case"bytes":return new X2e(e.name);case"array":return new J2e(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new sb((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new tve(e.name)}let r=e.type.match(sve);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&ob.throwArgumentError("invalid "+r[1]+" bit length","param",e),new rve(n/8,r[1]==="int",e.name)}if(r=e.type.match(ive),r){let n=parseInt(r[1]);return(n===0||n>32)&&ob.throwArgumentError("invalid bytes length","param",e),new eve(n,e.name)}return ob.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new w6(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new ZA(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(zi.from(i)));return new sb(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&ob.throwError("types/values length mismatch",Pe.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(zi.from(o))),i=new sb(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(zi.from(o)));return new sb(i,"_").decode(this._getReader(er(r),n))}}const ave=new ove,Bn=new Pe(Nv);class lve extends Av{}class cve extends Av{}class uve extends Av{}class JA extends Av{static isIndexed(e){return!!(e&&e._isIndexed)}}const dve={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Rj(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class Mj{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ot(this,"fragments",r.map(n=>td.from(n)).filter(n=>n!=null)),ot(this,"_abiCoder",Dc(new.target,"getAbiCoder")()),ot(this,"functions",{}),ot(this,"errors",{}),ot(this,"events",{}),ot(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Bn.warn("duplicate definition - constructor");return}ot(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 s=n.format();if(i[s]){Bn.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||ot(this,"deploy",Rc.from({payable:!1,type:"constructor"})),ot(this,"_isInterface",!0)}format(e){e||(e=Yr.full),e===Yr.sighash&&Bn.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===Yr.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return ave}static getAddress(e){return Ir(e)}static getSighash(e){return Es(g1(e.format()),0,4)}static getEventTopic(e){return g1(e.format())}getFunction(e){if(Vr(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Bn.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?Bn.throwArgumentError("no matching function","name",n):i.length>1&&Bn.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Mc.fromString(e).format()];return r||Bn.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(Vr(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Bn.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?Bn.throwArgumentError("no matching event","name",n):i.length>1&&Bn.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Ju.fromString(e).format()];return r||Bn.throwArgumentError("no matching event","signature",e),r}getError(e){if(Vr(e)){const n=Dc(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}Bn.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?Bn.throwArgumentError("no matching error","name",n):i.length>1&&Bn.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Mc.fromString(e).format()];return r||Bn.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 Dc(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Dc(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)&&Bn.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($o([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)&&Bn.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($o([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=er(r),i=null,s="",o=null,a=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=dve[c];if(u)o=this._abiCoder.decode(u.inputs,n.slice(4)),a=u.name,l=u.signature,u.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const f=this.getError(c);o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,l=f.format()}catch{}break}}return Bn.throwError("call revert exception"+s,Pe.errors.CALL_EXCEPTION,{method:e.format(),data:Bt(r),errorArgs:o,errorName:a,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&&Bn.throwError("too many arguments for "+e.format(),Pe.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?g1(o):s.type==="bytes"?yi(Bt(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=nt.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),Ln(Bt(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&Bn.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?Bn.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(l=>i(a,l))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Bn.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const l=r[a];if(o.indexed)if(o.type==="string")n.push(g1(l));else if(o.type==="bytes")n.push(yi(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[l]))}else i.push(o),s.push(l)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let h=this.getEventTopic(e);(!Vr(n[0],32)||n[0].toLowerCase()!==h)&&Bn.throwError("fragment/topic mismatch",Pe.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:h,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((h,g)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(i.push(zi.fromObject({type:"bytes32",name:h.name})),o.push(!0)):(i.push(h),o.push(!1)):(s.push(h),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,$o(n)):null,l=this._abiCoder.decode(s,r,!0),c=[],u=0,f=0;e.inputs.forEach((h,g)=>{if(h.indexed)if(a==null)c[g]=new JA({_isIndexed:!0,hash:null});else if(o[g])c[g]=new JA({_isIndexed:!0,hash:a[f++]});else try{c[g]=a[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 Rj(`property ${JSON.stringify(h.name)}`,m)}}):c[h.name]=m}});for(let h=0;h{throw Rj(`index ${h}`,g)}})}return Object.freeze(c)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new cve({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 lve({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 uve({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 fve="contracts/5.7.0";var b0=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})};const ai=new Pe(fve);function b6(t,e){return b0(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&ai.throwArgumentError("invalid address or ENS name","name",r);try{return Ir(r)}catch{}t||ai.throwError("a provider or signer is needed to resolve ENS names",Pe.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&ai.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function f5(t,e,r){return b0(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>f5(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield b6(t,e):r.type==="tuple"?yield f5(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>f5(t,n,r.arrayChildren))):Promise.reject(ai.makeError("invalid value for array",Pe.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Z4(t,e,r){return b0(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Ti(r.pop())),ai.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=hi({override:b6(t.signer,n.from),signer:t.signer.getAddress()}).then(c=>b0(this,void 0,void 0,function*(){return Ir(c.signer)!==c.override&&ai.throwError("Contract with a Signer cannot override from",Pe.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),c.override})):n.from=t.signer.getAddress():n.from&&(n.from=b6(t.provider,n.from));const i=yield hi({args:f5(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:hi(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=nt.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=nt.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=nt.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=nt.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=nt.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=Dg(a.accessList)),o.gasLimit==null&&e.gas!=null){let c=21e3;const u=er(s);for(let f=0;fn[c]!=null);return l.length&&ai.throwError(`cannot override ${l.map(c=>JSON.stringify(c)).join(",")}`,Pe.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),o})}function hve(t,e){return function(...r){return Z4(t,e,r)}}function pve(t,e){const r=t.signer||t.provider;return function(...n){return b0(this,void 0,void 0,function*(){r||ai.throwError("estimate require a provider or signer",Pe.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Z4(t,e,n);return yield r.estimateGas(i)})}}function gve(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=fd(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(l,c)=>t.interface.decodeEventLog(a.eventFragment,l,c),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function AK(t,e,r){const n=t.signer||t.provider;return function(...i){return b0(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=Ti(i.pop());l.blockTag!=null&&(s=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield Z4(t,e,i),a=yield n.call(o,s);try{let l=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===Pe.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=o),l}})}}function mve(t,e){return function(...r){return b0(this,void 0,void 0,function*(){t.signer||ai.throwError("sending a transaction requires a signer",Pe.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Z4(t,e,r),i=yield t.signer.sendTransaction(n);return gve(t,i),i})}}function Oj(t,e,r){return e.constant?AK(t,e,r):mve(t,e)}function SK(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 T2{constructor(e,r){ot(this,"tag",e),ot(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 yve extends T2{constructor(){super("error",null)}}class jj extends T2{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&ai.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(SK(s),s),ot(this,"address",e),ot(this,"interface",r),ot(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=K2e(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class Dj extends T2{constructor(e,r){super("*",{address:e}),ot(this,"address",e),ot(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 vve{constructor(e,r,n){ot(this,"interface",Dc(new.target,"getInterface")(r)),n==null?(ot(this,"provider",null),ot(this,"signer",null)):Tv.isSigner(n)?(ot(this,"provider",n.provider||null),ot(this,"signer",n)):W4.isProvider(n)?(ot(this,"provider",n),ot(this,"signer",null)):ai.throwArgumentError("invalid signer or provider","signerOrProvider",n),ot(this,"callStatic",{}),ot(this,"estimateGas",{}),ot(this,"functions",{}),ot(this,"populateTransaction",{}),ot(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const l=this.interface.events[a];ot(this.filters,a,(...c)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,c)})),o[l.name]||(o[l.name]=[]),o[l.name].push(a)}),Object.keys(o).forEach(a=>{const l=o[a];l.length===1?ot(this.filters,a,this.filters[l[0]]):ai.warn(`Duplicate definition of ${a} (${l.join(", ")})`)})}if(ot(this,"_runningEvents",{}),ot(this,"_wrappedEmits",{}),e==null&&ai.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ot(this,"address",e),this.provider)ot(this,"resolvedAddress",b6(this.provider,e));else try{ot(this,"resolvedAddress",Promise.resolve(Ir(e)))}catch{ai.throwError("provider is required to use ENS name as contract address",Pe.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){ai.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const l=a.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(o)}this[o]==null&&ot(this,o,Oj(this,a,!0)),this.functions[o]==null&&ot(this.functions,o,Oj(this,a,!1)),this.callStatic[o]==null&&ot(this.callStatic,o,AK(this,a,!0)),this.populateTransaction[o]==null&&ot(this.populateTransaction,o,hve(this,a)),this.estimateGas[o]==null&&ot(this.estimateGas,o,pve(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const l=a[0];try{this[o]==null&&ot(this,o,this[l])}catch{}this.functions[o]==null&&ot(this.functions,o,this.functions[l]),this.callStatic[o]==null&&ot(this.callStatic,o,this.callStatic[l]),this.populateTransaction[o]==null&&ot(this.populateTransaction,o,this.populateTransaction[l]),this.estimateGas[o]==null&&ot(this.estimateGas,o,this.estimateGas[l])})}static getContractAddress(e){return _V(e)}static getInterface(e){return Mj.isInterface(e)?e:new Mj(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"&&ai.throwError("contract not deployed",Pe.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||ai.throwError("sending a transactions require a signer",Pe.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Ti(e||{});return["from","to"].forEach(function(n){r[n]!=null&&ai.throwError("cannot override "+n,Pe.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new K4(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ot(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return JA.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 yve);if(e==="event")return this._normalizeRunningEvent(new T2("event",null));if(e==="*")return this._normalizeRunningEvent(new Dj(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new jj(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 jj(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new T2(SK(r),r))}return this._normalizeRunningEvent(new Dj(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=fd(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||ai.throwError("events require a provider or a signer with a provider",Pe.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=Ti(i.filter);return typeof r=="string"&&Vr(r,32)?(n!=null&&ai.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,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 wve extends vve{}const bve="units/5.7.0",_ve=new Pe(bve),xve=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Eve(t,e){return s5(t,e)}function Lj(t,e){if(typeof t!="string"&&_ve.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=xve.indexOf(e);r!==-1&&(e=3*r)}return _c(t,e??18)}function IK(t){return Eve(t,18)}function QA(t){"@babel/helpers - typeof";return QA=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},QA(t)}function Cve(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}function Ave(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sve(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&&$2(t,e)}function Ive(t){var e=$K();return function(){var n=k2(t),i;if(e){var s=k2(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return Tve(this,i)}}function Tve(t,e){if(e&&(QA(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TK(t)}function TK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function XA(t){var e=typeof Map=="function"?new Map:void 0;return XA=function(n){if(n===null||!$ve(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 h5(n,arguments,k2(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),$2(i,n)},XA(t)}function h5(t,e,r){return $K()?h5=Reflect.construct:h5=function(i,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(i,a),c=new l;return o&&$2(c,o.prototype),c},h5.apply(null,arguments)}function $K(){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 $ve(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function $2(t,e){return $2=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},$2(t,e)}function k2(t){return k2=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},k2(t)}var qu=function(t){Sve(r,t);var e=Ive(r);function r(n){var i;return Ave(this,r),i=e.call(this,n),Object.setPrototypeOf(TK(i),r.prototype),i.name=i.constructor.name,i}return Cve(r)}(XA(Error)),D$=2,kve=17,Nve=3,eo="0-90-9٠-٩۰-۹",Pve="-‐-―−ー-",Rve="//",Mve="..",Ove="  ­​⁠ ",jve="()()[]\\[\\]",Dve="~⁓∼~",Hl="".concat(Pve).concat(Rve).concat(Mve).concat(Ove).concat(jve).concat(Dve),J4="++";function Fj(t,e){t=t.split("-"),e=e.split("-");for(var r=t[0].split("."),n=e[0].split("."),i=0;i<3;i++){var s=Number(r[i]),o=Number(n[i]);if(s>o)return 1;if(o>s)return-1;if(!isNaN(s)&&isNaN(o))return 1;if(isNaN(s)&&!isNaN(o))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]=D$&&ewe.test(t)}function rwe(t){return Qve.test(t)}var zj=new RegExp("(?:"+NK()+")$","i");function nwe(t){var e=t.search(zj);if(e<0)return{};for(var r=t.slice(0,e),n=t.match(zj),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 swe(t,e){if(t){if(typeof t=="string")return Hj(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 Hj(t,e)}}function Hj(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 lwe(t,e){if(t){if(typeof t=="string")return qj(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 qj(t,e)}}function qj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rs?"TOO_SHORT":i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function dwe(t,e,r){if(e===void 0&&(e={}),r=new Xi(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 RK(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 RK(t,e){switch(t8(t,e)){case"IS_POSSIBLE":return!0;default:return!1}}function gd(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function fwe(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=hwe(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 hwe(t,e){if(t){if(typeof t=="string")return Gj(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 Gj(t,e)}}function Gj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0}function MK(t){return t.replace(new RegExp("[".concat(Hl,"]+"),"g")," ").trim()}var OK=/(\$\d)/;function jK(t,e,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var s=t.replace(new RegExp(e.pattern()),n?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(OK,e.nationalPrefixFormattingRule()):e.format());return n?MK(s):s}var vwe=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function wwe(t,e,r){var n=new Xi(r);if(n.selectNumberingPlan(t,e),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(vwe.test(n.IDDPrefix()))return n.IDDPrefix()}function bwe(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 _we(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=xwe(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 xwe(t,e){if(t){if(typeof t=="string")return Kj(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 Kj(t,e)}}function Kj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){var s=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(e.search(s)!==0)continue}if(gd(e,i.pattern()))return i}}function R9(t,e,r,n){return e?n(t,e,r):t}function Swe(t,e,r,n,i){var s=e8(n,i.metadata);if(s===r){var o=x6(t,e,"NATIONAL",i);return r==="1"?r+" "+o:o}var a=wwe(n,void 0,i.metadata);if(a)return"".concat(a," ").concat(r," ").concat(x6(t,null,"INTERNATIONAL",i))}function Qj(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 Xj(t){for(var e=1;e0&&o[1]==="0"))return t}}}function tS(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(t);if(n){var i,s,o=n.length-1,a=o>0&&n[o];if(e.nationalPrefixTransformRule()&&a)i=t.replace(r,e.nationalPrefixTransformRule()),o>1&&(s=n[1]);else{var l=n[0];i=t.slice(l.length),a&&(s=n[1])}var c;if(a){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:s}}}return{nationalNumber:t}}function rS(t,e){var r=tS(t,e),n=r.carrierCode,i=r.nationalNumber;if(i!==t){if(!Mwe(t,i,e))return{nationalNumber:t};if(e.possibleLengths()&&!Owe(i,e))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:n}}function Mwe(t,e,r){return!(gd(t,r.nationalNumberPattern())&&!gd(e,r.nationalNumberPattern()))}function Owe(t,e){switch(t8(t,e)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function LK(t,e,r,n){var i=e?e8(e,n):r;if(t.indexOf(i)===0){n=new Xi(n),n.selectNumberingPlan(e,r);var s=t.slice(i.length),o=rS(s,n),a=o.nationalNumber,l=rS(t,n),c=l.nationalNumber;if(!gd(c,n.nationalNumberPattern())&&gd(a,n.nationalNumberPattern())||t8(c,n)==="TOO_LONG")return{countryCallingCode:i,number:s}}return{number:t}}function FK(t,e,r,n){if(!t)return{};var i;if(t[0]!=="+"){var s=DK(t,e,r,n);if(s&&s!==t)i=!0,t="+"+s;else{if(e||r){var o=LK(t,e,r,n),a=o.countryCallingCode,l=o.number;if(a)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:a,number:l}}return{number:t}}}if(t[1]==="0")return{};n=new Xi(n);for(var c=2;c-1<=Nve&&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 jwe(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=Dwe(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 Dwe(t,e){if(t){if(typeof t=="string")return eD(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 eD(t,e)}}function eD(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 Kwe(t){return t===null?!0:t.length===0?!1:Uwe.test(t)||qwe.test(t)}function Ywe(t,e){var r=e.extractFormattedPhoneNumber,n=Gwe(t);if(!Kwe(n))throw new qu("NOT_A_NUMBER");var i;if(n===null)i=r(t)||"";else{i="",n.charAt(0)===WK&&(i+=n);var s=t.indexOf(rD),o;s>=0?o=s+rD.length:o=0;var a=t.indexOf(iS);i+=t.substring(o,a)}var l=i.indexOf(Vwe);if(l>0&&(i=i.substring(0,l)),i!=="")return i}var Zwe=250,Jwe=new RegExp("["+J4+eo+"]"),Qwe=new RegExp("[^"+eo+"#]+$");function Xwe(t,e,r){if(e=e||{},r=new Xi(r),e.defaultCountry&&!r.hasCountry(e.defaultCountry))throw e.v2?new qu("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var n=t3e(t,e.v2,e.extract),i=n.number,s=n.ext,o=n.error;if(!i){if(e.v2)throw o==="TOO_SHORT"?new qu("TOO_SHORT"):new qu("NOT_A_NUMBER");return{}}var a=n3e(i,e.defaultCountry,e.defaultCallingCode,r),l=a.country,c=a.nationalNumber,u=a.countryCallingCode,f=a.countryCallingCodeSource,h=a.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new qu("INVALID_COUNTRY");return{}}if(!c||c.lengthkve){if(e.v2)throw new qu("TOO_LONG");return{}}if(e.v2){var g=new F$(u,c,r.metadata);return l&&(g.country=l),h&&(g.carrierCode=h),s&&(g.ext=s),g.__countryCallingCodeSource=f,g}var m=(e.extended?r.hasSelectedNumberingPlan():l)?gd(c,r.nationalNumberPattern()):!1;return e.extended?{country:l,countryCallingCode:u,carrierCode:h,valid:m,possible:m?!0:!!(e.extended===!0&&r.possibleLengths()&&RK(c,r)),phone:c,ext:s}:m?r3e(l,c,s):{}}function e3e(t,e,r){if(t){if(t.length>Zwe){if(r)throw new qu("TOO_LONG");return}if(e===!1)return t;var n=t.search(Jwe);if(!(n<0))return t.slice(n).replace(Qwe,"")}}function t3e(t,e,r){var n=Ywe(t,{extractFormattedPhoneNumber:function(o){return e3e(o,r,e)}});if(!n)return{};if(!twe(n))return rwe(n)?{error:"TOO_SHORT"}:{};var i=nwe(n);return i.ext?i:{number:n}}function r3e(t,e,r){var n={country:t,phone:e};return r&&(n.ext=r),n}function n3e(t,e,r,n){var i=FK(Vj(t),e,r,n.metadata),s=i.countryCallingCodeSource,o=i.countryCallingCode,a=i.number,l;if(o)n.selectNumberingPlan(o);else if(a&&(e||r))n.selectNumberingPlan(e,r),e&&(l=e),o=r||e8(e,n.metadata);else return{};if(!a)return{countryCallingCodeSource:s,countryCallingCode:o};var c=rS(Vj(a),n),u=c.nationalNumber,f=c.carrierCode,h=BK(o,{nationalNumber:u,defaultCountry:e,metadata:n});return h&&(l=h,h==="001"||n.country(l)),{country:l,countryCallingCode:o,countryCallingCodeSource:s,nationalNumber:u,carrierCode:f}}function nD(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 iD(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 E3e(t,e){if(t){if(typeof t=="string")return dD(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 dD(t,e)}}function dD(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 fD(t,e){return t[e]===")"&&e++,C3e(t.slice(0,e))}function C3e(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 D3e(t,e){if(t){if(typeof t=="string")return gD(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 gD(t,e)}}function gD(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 s=sS(r.split(""),this.matchTree,!0);if(s&&s.match&&delete s.matchedChars,!(s&&s.overflow&&!i))return s}}]),t}();function sS(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(),s=0;s=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 W3e(t,e){if(t){if(typeof t=="string")return yD(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 yD(t,e)}}function yD(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()&&K3e.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var i=r.IDDPrefix,s=r.missingPlus;return i?n&&n.spacing===!1?i:i+" ":s?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,i=0,s=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";ic.length)){var u=new RegExp("^"+l+"$"),f=i.replace(/\d/g,oS);u.test(f)&&(c=f);var h=this.getFormatFormat(r,s),g;if(this.shouldTryNationalPrefixFormattingRule(r,{international:s,nationalPrefix:o})){var m=h.replace(OK,r.nationalPrefixFormattingRule());if(_6(r.nationalPrefixFormattingRule())===(o||"")+_6("$1")&&(h=m,g=!0,o))for(var w=o.length;w>0;)h=h.replace(/\d/,$l),w--}var E=c.replace(new RegExp(l),h).replace(new RegExp(oS,"g"),$l);return g||(a?E=p5($l,a.length)+" "+E:o&&(E=p5($l,o.length)+this.getSeparatorAfterNationalPrefix(r)+E)),s&&(E=MK(E)),E}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=A3e(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],fD(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var i=n.international,s=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var o=r.usesNationalPrefix();if(o&&s||!o&&!i)return!0}}}]),t}();function zK(t,e){return rbe(t)||tbe(t,e)||ebe(t,e)||X3e()}function X3e(){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 ebe(t,e){if(t){if(typeof t=="string")return wD(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 wD(t,e)}}function wD(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=3;if(n.appendDigits(r),s&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(o){return n.update(o)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,i=r.callingCode;return n&&!i}},{key:"extractCountryCallingCode",value:function(r){var n=FK("+"+r.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode,s=n.number;if(i)return r.setCallingCode(i),r.update({nationalSignificantNumber:s}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&ube.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var i=tS(r,this.metadata),s=i.nationalPrefix,o=i.nationalNumber,a=i.carrierCode;if(o!==r)return this.onExtractedNationalNumber(s,a,o,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var s=tS(r,this.metadata),o=s.nationalPrefix,a=s.nationalNumber,l=s.carrierCode;if(a!==n)return this.onExtractedNationalNumber(o,l,a,r,i),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,i,s,o){var a,l,c=s.lastIndexOf(i);if(c>=0&&c===s.length-i.length){l=!0;var u=s.slice(0,c);u!==r&&(a=u)}o({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:i,nationalSignificantNumberMatchesInput:l,complexPrefixBeforeNationalSignificantNumber:a}),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,s=r.digits;if(r.nationalSignificantNumber,!(n||i)){var o=DK(s,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(o!==void 0&&o!==s)return r.update({IDDPrefix:s.slice(0,s.length-o.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=LK(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,s=n.callingCode;r.startInternationalNumber(i,s),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 fbe(t){var e=t.search(lbe);if(!(e<0)){t=t.slice(e);var r;return t[0]==="+"&&(r=!0,t=t.slice(1)),t=t.replace(cbe,""),r&&(t="+"+t),t}}function hbe(t){var e=fbe(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function pbe(t){var e=hbe(t),r=zK(e,2),n=r[0],i=r[1];return abe.test(n)||(n=""),[n,i]}function gbe(t,e){return wbe(t)||vbe(t,e)||ybe(t,e)||mbe()}function mbe(){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 ybe(t,e){if(t){if(typeof t=="string")return bD(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 bD(t,e)}}function bD(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(BK(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,s=r.country,o=r.nationalSignificantNumber;if(n){if(this.isInternational())return i?"+"+i+o:"+"+n;if(s||i){var a=s?this.metadata.countryCallingCode():i;return"+"+a+o}}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.carrierCode,s=r.callingCode,o=this._getCountry();if(n&&!(!o&&!s)){if(o&&o===this.defaultCountry){var a=new Xi(this.metadata.metadata);a.selectNumberingPlan(o);var l=a.numberingPlan.callingCode(),c=this.metadata.getCountryCodesForCallingCode(l);if(c.length>1){var u=UK(n,{countries:c,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});u&&(o=u)}}var f=new F$(o||s,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 Ebe(t){return new Xi(t).getCountries()}function Cbe(t,e,r){if(e[t])return new F$(t,e[t],r)}const Abe={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"}}},Sbe={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},Ibe={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},Tbe={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"}}},$be={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},kbe={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},Nbe={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"}}},Pbe={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},Rbe={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},qK={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"}}},VK={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},Mbe={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"}}},Obe={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},jbe={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 yo;(yo={}).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",yo.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",yo.INVALID_DATA="invalid_data",yo.LINKED_TO_ANOTHER_USER="linked_to_another_user",yo.ALLOWLIST_REJECTED="allowlist_rejected",yo.OAUTH_USER_DENIED="oauth_user_denied",yo.UNKNOWN_AUTH_ERROR="unknown_auth_error",yo.USER_EXITED_AUTH_FLOW="exited_auth_flow",yo.MUST_BE_AUTHENTICATED="must_be_authenticated",yo.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",yo.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",yo.CLIENT_REQUEST_TIMEOUT="client_request_timeout",yo.INVALID_CREDENTIALS="invalid_credentials";let Dbe=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}},Lbe=class extends Dbe{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 j9=class extends Lbe{constructor(e){var n,i,s;super(e.message,e.code,e.data);let r=Object.values(qi).find(o=>o.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:(s=e.message)!=null&&s.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=qi.E32002_WALLET_LOCKED))}};const qs=t=>nt.from(t);function aS(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 Fbe(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=qs(t.nonce).toNumber()),t.gasLimit!==void 0&&(e.gasLimit=qs(t.gasLimit)),t.gasPrice!==void 0&&(e.gasPrice=qs(t.gasPrice)),t.value!==void 0&&(e.value=qs(t.value)),t.maxFeePerGas!==void 0&&(e.maxFeePerGas=qs(t.maxFeePerGas)),t.maxPriorityFeePerGas!==void 0&&(e.maxPriorityFeePerGas=qs(t.maxPriorityFeePerGas)),e}const GK=t=>[Abe.id,Sbe.id,Ibe.id].includes(t),Ube=async(t,e)=>{if(!GK(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=aS(n),t.maxPriorityFeePerGas=aS(nt.from(0))}}catch(r){throw Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return t},KK=t=>[56,97].includes(t),Bbe=async(t,e)=>{var r;if(!KK(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},Wbe=["function getL1Fee(bytes memory _data) external view returns (uint256)"],r8=t=>[Tbe.id,$be.id,kbe.id,Nbe.id,Pbe.id,Rbe.id,Mbe.id,jbe.id,Obe.id,81457,168587773].includes(t),zbe=async(t,e)=>{if(!r8(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=aS(n)}}catch(r){throw Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return t};async function Hbe(t,e){if(!t.chainId||t.chainId&&!r8(t.chainId))return nt.from(0);let r=nt.from(0);try{let n=new wve("0x420000000000000000000000000000000000000F",Wbe,e),i=Fbe(t),s=Kme(i);r=await n.getL1Fee(s)}catch{}return r}var YK={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Xt,function(){var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var a={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(a,o),function(c,u){var f=o.retries,h=o.retryDelay,g=o.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 E=function(_){var A=typeof Request<"u"&&c instanceof Request?c.clone():c;s(A,u).then(function(C){if(Array.isArray(g)&&g.indexOf(C.status)===-1)m(C);else if(typeof g=="function")try{return Promise.resolve(g(_,null,C)).then(function(R){R?v(_,null,C):m(C)}).catch(w)}catch(R){w(R)}else _=0}function i(s){this.name="ArgumentError",this.message=s}return r})})(YK);var qbe=YK.exports;const Vbe=wa(qbe),ZK={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 Gbe=Vbe(fetch,{retries:3,retryDelay:500});const JK=t=>[qK.id,VK.id,ZK.id].includes(t);let D9=t=>({maxPriorityFee:Lj(t.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:Lj(t.maxFee.toFixed(9),"gwei").toHexString()}),Kbe=t=>({safeLow:D9(t.safeLow),standard:D9(t.standard),fast:D9(t.fast)});const Ybe=async t=>{let e="";switch(t){case qK.id:e="https://gasstation.polygon.technology/v2";break;case VK.id:e="https://gasstation-testnet.polygon.technology/v2";break;case ZK.id:e="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${t} does not support polygon gas stations`)}let r=await Gbe(e),n=await r.json();if(r.status>399)throw n;return Kbe(n)};async function Zbe(t){if(!JK(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 Ybe(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 Jbe=async(t,e)=>{var r,n,i;if(t.type===void 0&&(t.type=2),t.type===2){if(!t.maxFeePerGas||!t.maxPriorityFeePerGas){let s=await e.getFeeData();t.maxFeePerGas||(t.maxFeePerGas=(r=s.maxFeePerGas)==null?void 0:r.toHexString()),t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=(n=s.maxPriorityFeePerGas)==null?void 0:n.toHexString())}}else if(!t.gasPrice){let s=await e.getFeeData();t.gasPrice=(i=s.gasPrice)==null?void 0:i.toHexString()}return t};async function U$(t,e){if(!t.gasLimit)throw new j9("gasLimit was not successfully set for transaction.");let r=qs(t.gasLimit),n=nt.from(0);if(t.type==2){if(!t.maxFeePerGas)throw new j9("maxFeePerGas was not successfully set for transaction of type 2.");n=qs(t.maxFeePerGas)}else{if(!t.gasPrice)throw new j9("gasPrice was not successfully set for transaction of type 0 or 1.");n=qs(t.gasPrice)}let i=r.mul(n),s=nt.from(0);if(t.chainId&&r8(t.chainId))try{s=await Hbe(t,e),i=i.add(s)}catch{}return{totalGasEstimate:i,l1ExecutionFeeEstimate:s}}async function Qbe(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:s}){try{let o={...i,value:void 0};return(await s.estimateGas(o)).toHexString()}catch(o){return console.warn(`Gas estimation failed with error: ${o} 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:s}){try{let o={...i,from:void 0};return(await s.estimateGas(o)).toHexString()}catch(o){return console.warn(`Gas estimation failed with error: ${o} when omitting the 'from' address`),null}}({txRequest:t,provider:e})),!n)throw r;return n}}function QK(t){return/^-?0x[a-f0-9]+$/i.test(t)}function Xbe(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",s=typeof n=="bigint",o=typeof n=="string"&&QK(n);return i||s||o}(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 B$(t,e,r){if(e.chainId=Number(e.chainId),Xbe(e),e.from||(e.from=t),!e.nonce){let n=new K4(t,r);e.nonce=await n.getTransactionCount("pending")}return e.gasLimit||(e.gas?(e.gasLimit=e.gas,delete e.gas):e.gasLimit=await Qbe(e,r)),typeof e.type=="string"&&QK(e.type)&&(e.type=Number(e.type)),[23294,23295].includes(e.chainId)&&(e.type=0),(e=JK(e.chainId)?await Zbe(e):GK(e.chainId)?await Ube(e,r):r8(e.chainId)?await zbe(e,r):KK(e.chainId)?await Bbe(e,r):await Jbe(e,r)).type===0&&delete e.accessList,e.type!==2&&(delete e.maxPriorityFeePerGas,delete e.maxFeePerGas),e}var XK={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 s(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 o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function a(){this._events=new n,this._eventsCount=0}a.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},a.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=a5e.encode(e));const r=32768,n=[];for(let i=0;il5e(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),u5e=t=>{const e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{let e=t;e instanceof Uint8Array&&(e=eY.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return u5e(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class f5e 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 xh extends f5e{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function h5e(t){return typeof t=="object"&&t!==null}function p5e(t){if(!h5e(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 E6=c5e,g5e=d5e;function xD(t){if(typeof t!="string")throw new xh("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:r}=t.split(".");if(r===5)throw new xh("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new xh("Invalid JWT");if(!e)throw new xh("JWTs must contain a payload");let n;try{n=g5e(e)}catch{throw new xh("Failed to base64url decode the payload")}let i;try{i=JSON.parse(eY.decode(n))}catch{throw new xh("Failed to parse the decoded payload as JSON")}if(!p5e(i))throw new xh("Invalid JWT Claims Set");return i}/*! js-cookie v3.0.5 | MIT */function lb(t){for(var e=1;e"u")){o=lb({},e,o),typeof o.expires=="number"&&(o.expires=new Date(Date.now()+o.expires*864e5)),o.expires&&(o.expires=o.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in o)o[l]&&(a+="; "+l,o[l]!==!0&&(a+="="+o[l].split(";")[0]));return document.cookie=i+"="+t.write(s,i)+a}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],o={},a=0;av5e(String(t),e),L9=(t,e)=>`+${W$(e)} ${t}`,_5e=t=>`*${t.replaceAll("-","").slice(-4)}`,x5e=t=>new P2(t),E5e=w5e().map(t=>({code:t,callCode:W$(t)})),C5e=t=>{var r;let e=(r=b5e(t,y5e))==null?void 0:r.formatInternational();return e==null?void 0:e.substring(e.indexOf(" ")+1)},A5e=t=>{let e=new P2;e.input(t);let r=e.getCountry()||"US",n=e.getCallingCode()||"1";return{countryCode:r,phone:t.replace("+"+n,"")}},S5e=(t,e=!0)=>t.reduce((r,n)=>({...r,[n]:e}),{});let I5e={buy:"CARD",send:"CRYPTO_ACCOUNT"},T5e={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 $5e({input:t,amount:e,blockchain:r,asset:n,experience:i}){let s=new URL("https://pay.coinbase.com/buy/select-asset");return s.searchParams.set("appId",t.app_id),s.searchParams.set("sessionToken",t.session_token),s.searchParams.set("defaultExperience",i),s.searchParams.set("presetCryptoAmount",e.startsWith(".")?`0${e}`:e),s.searchParams.set("defaultNetwork",r),s.searchParams.set("defaultPaymentMethod",I5e[i]),s.searchParams.set("defaultAsset",T5e[n]),s.searchParams.set("partnerUserId",t.partner_user_id),{url:s}}const k5e="1.0.7";let ll=class cS extends Error{constructor(e,r={}){var o;const n=r.cause instanceof cS?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,i=r.cause instanceof cS&&r.cause.docsPath||r.docsPath,s=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${k5e}`].join(` -`);super(s),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 Qf(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const rY=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,nY=/^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)?$/,iY=/^\(.+?\).*?$/,ED=/^tuple(?(\[(\d*)\])*)$/;function uS(t){let e=t.type;if(ED.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 P5e(t){return sY.test(t)}function R5e(t){return Qf(sY,t)}const oY=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function M5e(t){return oY.test(t)}function O5e(t){return Qf(oY,t)}const aY=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function j5e(t){return aY.test(t)}function D5e(t){return Qf(aY,t)}const lY=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function cY(t){return lY.test(t)}function L5e(t){return Qf(lY,t)}const uY=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function F5e(t){return uY.test(t)}function U5e(t){return Qf(uY,t)}const B5e=/^fallback\(\) external(?:\s(?payable{1}))?$/;function W5e(t){return B5e.test(t)}const z5e=/^receive\(\) external payable$/;function H5e(t){return z5e.test(t)}const q5e=new Set(["indexed"]),dS=new Set(["calldata","memory","storage"]);class V5e extends ll{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 G5e extends ll{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 K5e extends ll{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Y5e extends ll{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 Z5e extends ll{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 J5e extends ll{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 Q5e extends ll{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 wy extends ll{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class X5e extends ll{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class e6e extends ll{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 t6e extends ll{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 r6e extends ll{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 n6e(t,e,r){let n="";if(r)for(const i of Object.entries(r)){if(!i)continue;let s="";for(const o of i[1])s+=`[${o.type}${o.name?`:${o.name}`:""}]`;n+=`(${i[0]}{${s}})`}return e?`${e}:${t}${n}`:t}const F9=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 i6e(t,e={}){if(j5e(t)){const r=D5e(t);if(!r)throw new wy({signature:t,type:"function"});const n=Ol(r.parameters),i=[],s=n.length;for(let a=0;a[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,o6e=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,a6e=/^u?int$/;function Oh(t,e){var f,h;const r=n6e(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(F9.has(r))return F9.get(r);const n=iY.test(t),i=Qf(n?o6e:s6e,t);if(!i)throw new K5e({param:t});if(i.name&&c6e(i.name))throw new Y5e({param:t,name:i.name});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=(e==null?void 0:e.structs)??{};let l,c={};if(n){l="tuple";const g=Ol(i.type),m=[],w=g.length;for(let E=0;E[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function fY(t,e,r=new Set){const n=[],i=t.length;for(let s=0;se(t,s)}function nu(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new S6e(t.type);return`${t.name}(${s8(t.inputs,{includeName:e})})`}function s8(t,{includeName:e=!1}={}){return t?t.map(r=>h6e(r,{includeName:e})).join(e?", ":","):""}function h6e(t,{includeName:e}){return t.type.startsWith("tuple")?`(${s8(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}function Zl(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function ei(t){return Zl(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const hY="2.22.1";let Km={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${hY}`},Je=class fS extends Error{constructor(e,r={}){var a;const n=(()=>{var l;return r.cause instanceof fS?r.cause.details:(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),i=r.cause instanceof fS&&r.cause.docsPath||r.docsPath,s=(a=Km.getDocsUrl)==null?void 0:a.call(Km,{...r,docsPath:i}),o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...Km.version?[`Version: ${Km.version}`]:[]].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,"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=hY}walk(e){return pY(this,e)}};function pY(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?pY(t.cause,e):e?null:t}class p6e extends Je{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 CD extends Je{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 gY extends Je{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${s8(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 Pv extends Je{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class g6e extends Je{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 m6e extends Je{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${ei(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class y6e extends Je{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` -`),{name:"AbiEncodingLengthMismatchError"})}}class mY extends Je{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 v6e extends Je{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class yY extends Je{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 AD extends Je{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 C6 extends Je{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 w6e extends Je{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 b6e extends Je{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 _6e extends Je{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${nu(e.abiItem)}\`, and`,`\`${r.type}\` in \`${nu(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class x6e extends Je{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}}class R2 extends Je{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: (${s8(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 o8 extends Je{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${nu(e,{includeName:!0})}".`].join(` -`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class E6e extends Je{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 C6e extends Je{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 A6e extends Je{constructor(e){super([`Value "${e}" is not a valid array.`].join(` -`),{name:"InvalidArrayError"})}}class S6e extends Je{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`),{name:"InvalidDefinitionTypeError"})}}class I6e extends Je{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}class vY extends Je{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 wY=class extends Je{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 SD extends Je{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 Fg(t,{dir:e,size:r=32}={}){return typeof t=="string"?$f(t,{dir:e,size:r}):T6e(t,{dir:e,size:r})}function $f(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new wY({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function T6e(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new wY({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;ie)throw new N6e({givenSize:ei(t),maxSize:e})}function la(t,e={}){const{signed:r}=e;e.size&&sc(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<e.toString(16).padStart(2,"0"));function ur(t,e={}){return typeof t=="number"||typeof t=="bigint"?lr(t,e):typeof t=="string"?eg(t,e):typeof t=="boolean"?_Y(t,e):vi(t,e)}function _Y(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(sc(r,{size:e.size}),Fg(r,{size:e.size})):r}function vi(t,e={}){let r="";for(let i=0;is||i=Tu.zero&&t<=Tu.nine)return t-Tu.zero;if(t>=Tu.A&&t<=Tu.F)return t-(Tu.A-10);if(t>=Tu.a&&t<=Tu.f)return t-(Tu.a-10)}function Jl(t,e={}){let r=t;e.size&&(sc(r,{size:e.size}),r=Fg(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,s=new Uint8Array(i);for(let o=0,a=0;o0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function A6(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 xY(t,e){z$(t);const r=e.outputLen;if(t.length>$D&ub)}:{h:Number(t>>$D&ub)|0,l:Number(t&ub)|0}}function U6e(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,W6e=(t,e,r)=>e<>>32-r,z6e=(t,e,r)=>e<>>64-r,H6e=(t,e,r)=>t<>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const q6e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),U9=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),mc=(t,e)=>t<<32-e|t>>>e,kD=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,V6e=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function ND(t){for(let e=0;et().update(H$(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const AY=[],SY=[],IY=[],K6e=BigInt(0),Ym=BigInt(1),Y6e=BigInt(2),Z6e=BigInt(7),J6e=BigInt(256),Q6e=BigInt(113);for(let t=0,e=Ym,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],AY.push(2*(5*n+r)),SY.push((t+1)*(t+2)/2%64);let i=K6e;for(let s=0;s<7;s++)e=(e<>Z6e)*Q6e)%J6e,e&Y6e&&(i^=Ym<<(Ym<r>32?z6e(t,e,r):B6e(t,e,r),RD=(t,e,r)=>r>32?H6e(t,e,r):W6e(t,e,r);function t4e(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,c=r[l],u=r[l+1],f=PD(c,u,1)^r[a],h=RD(c,u,1)^r[a+1];for(let g=0;g<50;g+=10)t[o+g]^=f,t[o+g+1]^=h}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=SY[o],l=PD(i,s,a),c=RD(i,s,a),u=AY[o];i=t[u],s=t[u+1],t[u]=l,t[u+1]=c}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=X6e[n],t[1]^=e4e[n]}r.fill(0)}let r4e=class TY extends EY{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,TD(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=q6e(this.state)}keccak(){kD||ND(this.state32),t4e(this.state32,this.rounds),kD||ND(this.state32),this.posOut=0,this.pos=0}update(e){A6(this);const{blockLen:r,state:n}=this;e=H$(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return TD(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(xY(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:s,enableXOF:o}=this;return e||(e=new TY(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const n4e=(t,e,r)=>CY(()=>new r4e(e,t,r)),i4e=n4e(1,136,256/8);function Vi(t,e){const r=e||"hex",n=i4e(Zl(t,{strict:!1})?Ug(t):t);return r==="bytes"?n:ur(n)}const s4e=t=>Vi(Ug(t));function o4e(t){return s4e(t)}function a4e(t){let e=!0,r="",n=0,i="",s=!1;for(let o=0;o{const e=typeof t=="string"?t:N5e(t);return a4e(e)};function $Y(t){return o4e(l4e(t))}const a8=$Y;class to extends Je{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 l8 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 B9=new l8(8192);function Rv(t,e){if(B9.has(`${t}.${e}`))return B9.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),n=Vi(Xh(r),"bytes"),i=r.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return B9.set(`${t}.${e}`,s),s}function q$(t,e){if(!Mn(t,{strict:!1}))throw new to({address:t});return Rv(t,e)}const c4e=/^0x[a-fA-F0-9]{40}$/,W9=new l8(8192);function Mn(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(W9.has(n))return W9.get(n);const i=c4e.test(t)?t.toLowerCase()===t?!0:r?Rv(t)===t:!0:!1;return W9.set(n,i),i}function md(t){return typeof t[0]=="string"?cu(t):u4e(t)}function u4e(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 cu(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function _0(t,e,r,{strict:n}={}){return Zl(t,{strict:!1})?RY(t,e,r,{strict:n}):PY(t,e,r,{strict:n})}function kY(t,e){if(typeof e=="number"&&e>0&&e>ei(t)-1)throw new vY({offset:e,position:"start",size:ei(t)})}function NY(t,e,r){if(typeof e=="number"&&typeof r=="number"&&ei(t)!==r-e)throw new vY({offset:r,position:"end",size:ei(t)})}function PY(t,e,r,{strict:n}={}){kY(t,e);const i=t.slice(e,r);return n&&NY(i,e,r),i}function RY(t,e,r,{strict:n}={}){kY(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&NY(i,e,r),i}const d4e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,MY=/^(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 Bg(t,e){if(t.length!==e.length)throw new y6e({expectedLength:t.length,givenLength:e.length});const r=f4e({params:t,values:e}),n=G$(r);return n.length===0?"0x":n}function f4e({params:t,values:e}){const r=[];for(let n=0;n0?md([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:md(s.map(({encoded:o})=>o))}}function g4e(t,{param:e}){const[,r]=e.type.split("bytes"),n=ei(t);if(!r){let i=t;return n%32!==0&&(i=$f(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:md([$f(lr(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new m6e({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:$f(t,{dir:"right"})}}function m4e(t){if(typeof t!="boolean")throw new Je(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:$f(_Y(t))}}function y4e(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 K$(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const c8=t=>_0($Y(t),0,4);function Mv(t){const{abi:e,args:r=[],name:n}=t,i=Zl(n,{strict:!1}),s=e.filter(a=>i?a.type==="function"?c8(a)===n:a.type==="event"?a8(a)===n:!1:"name"in a&&a.name===n);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((c,u)=>{const f="inputs"in a&&a.inputs[u];return f?hS(c,f):!1})){if(o&&"inputs"in o&&o.inputs){const c=OY(a.inputs,o.inputs,r);if(c)throw new _6e({abiItem:a,type:c[0]},{abiItem:o,type:c[1]})}o=a}}return o||s[0]}function hS(t,e){const r=typeof t,n=e.type;switch(n){case"address":return Mn(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,s)=>hS(Object.values(t)[s],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=>hS(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function OY(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return OY(i.components,s.components,r[n]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Mn(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?Mn(r[n],{strict:!1}):!1)return o}}const MD="/docs/contract/encodeEventTopics";function Ov(t){var l;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const c=Mv({abi:e,name:r});if(!c)throw new AD(r,{docsPath:MD});i=c}if(i.type!=="event")throw new AD(void 0,{docsPath:MD});const s=nu(i),o=a8(s);let a=[];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&&(a=(c==null?void 0:c.map((f,h)=>Array.isArray(u[h])?u[h].map((g,m)=>OD({param:f,value:u[h][m]})):u[h]?OD({param:f,value:u[h]}):null))??[])}return[o,...a]}function OD({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Vi(Ug(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new I6e(t.type);return Bg([t],[e])}function u8(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:s,response:o,status:a,transport:l})=>{a==="success"&&e===s&&(r[o]=l.request)})),s=>r[s]||t.request}async function jY(t,e){const{address:r,abi:n,args:i,eventName:s,fromBlock:o,strict:a,toBlock:l}=e,c=u8(t,{method:"eth_newFilter"}),u=s?Ov({abi:n,args:i,eventName:s}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?lr(o):o,toBlock:typeof l=="bigint"?lr(l):l,topics:u}]});return{abi:n,args:i,eventName:s,id:f,request:c(f),strict:!!a,type:"event"}}function so(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const jD="/docs/contract/encodeFunctionData";function b4e(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const s=Mv({abi:e,args:r,name:n});if(!s)throw new C6(n,{docsPath:jD});i=s}if(i.type!=="function")throw new C6(void 0,{docsPath:jD});return{abi:[i],functionName:c8(nu(i))}}function oc(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var a;return t.abi.length===1&&((a=t.functionName)!=null&&a.startsWith("0x"))?t:b4e(t)})(),i=r[0],s=n,o="inputs"in i&&i.inputs?Bg(i.inputs,e??[]):void 0;return cu([s,o??"0x"])}const DY={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."},_4e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},x4e={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class DD extends Je{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class LY extends Je{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class E4e extends Je{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const C4e={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 E4e({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new LY({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new DD({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 DD({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 Y$(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(C4e);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function A4e(t,e={}){typeof e.size<"u"&&sc(t,{size:e.size});const r=vi(t,e);return la(r,e)}function S4e(t,e={}){let r=t;if(typeof e.size<"u"&&(sc(r,{size:e.size}),r=ql(r)),r.length>1||r[0]>1)throw new $6e(r);return!!r[0]}function od(t,e={}){typeof e.size<"u"&&sc(t,{size:e.size});const r=vi(t,e);return iu(r,e)}function I4e(t,e={}){let r=t;return typeof e.size<"u"&&(sc(r,{size:e.size}),r=ql(r,{dir:"right"})),new TextDecoder().decode(r)}function Wg(t,e){const r=typeof e=="string"?Jl(e):e,n=Y$(r);if(ei(r)===0&&t.length>0)throw new Pv;if(ei(e)&&ei(e)<32)throw new gY({data:typeof e=="string"?e:vi(e),params:t,size:ei(e)});let i=0;const s=[];for(let o=0;o48?A4e(i,{signed:r}):od(i,{signed:r}),32]}function R4e(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(M2(e)){const o=od(t.readBytes(pS)),a=r+o;for(let l=0;lo.type==="error"&&n===c8(nu(o)));if(!s)throw new mY(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Wg(s.inputs,_0(r,4)):void 0,errorName:s.name}}const Zi=(t,e,r)=>JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r);function FY({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,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?Zi(e[s]):e[s]}`).join(", ")})`}const UY={gwei:9,wei:18},j4e={ether:-9,wei:9};function d8(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function jv(t,e="wei"){return d8(t,UY[e])}function Mo(t,e="wei"){return d8(t,j4e[e])}class D4e extends Je{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class L4e extends Je{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function FD(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} -`,"")}function F4e(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 s=!n&&typeof self=="object",a=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;a?i=Xt:s&&(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],E=[224,256,384,512],v=[128,256],_=["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 C=function(H,ee,Z){return function(te){return new M(H,ee,H).update(te)[Z]()}},R=function(H,ee,Z){return function(te,re){return new M(H,ee,re).update(te)[Z]()}},B=function(H,ee,Z){return function(te,re,W,q){return b["cshake"+H].update(te,re,W,q)[Z]()}},S=function(H,ee,Z){return function(te,re,W,q){return b["kmac"+H].update(te,re,W,q)[Z]()}},U=function(H,ee,Z,te){for(var re=0;re<_.length;++re){var W=_[re];H[W]=ee(Z,te,W)}return H},G=function(H,ee){var Z=C(H,ee,"hex");return Z.create=function(){return new M(H,ee,H)},Z.update=function(te){return Z.create().update(te)},U(Z,C,H,ee)},ae=function(H,ee){var Z=R(H,ee,"hex");return Z.create=function(te){return new M(H,ee,te)},Z.update=function(te,re){return Z.create(re).update(te)},U(Z,R,H,ee)},K=function(H,ee){var Z=A[H],te=B(H,ee,"hex");return te.create=function(re,W,q){return!W&&!q?b["shake"+H].create(re):new M(H,ee,re).bytepad([W,q],Z)},te.update=function(re,W,q,J){return te.create(W,q,J).update(re)},U(te,B,H,ee)},N=function(H,ee){var Z=A[H],te=S(H,ee,"hex");return te.create=function(re,W,q){return new X(H,ee,W).bytepad(["KMAC",q],Z).bytepad([re],Z)},te.update=function(re,W,q,J){return te.create(re,q,J).update(W)},U(te,S,H,ee)},k=[{name:"keccak",padding:h,bits:E,createMethod:G},{name:"sha3",padding:g,bits:E,createMethod:G},{name:"shake",padding:u,bits:v,createMethod:ae},{name:"cshake",padding:f,bits:v,createMethod:K},{name:"kmac",padding:f,bits:v,createMethod:N}],b={},x=[],P=0;P>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Z>>5,this.extraBytes=(Z&31)>>3;for(var te=0;te<50;++te)this.s[te]=0}M.prototype.update=function(H){if(this.finalized)throw new Error(r);var ee,Z=typeof H;if(Z!=="string"){if(Z==="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,W=H.length,q=this.blockCount,J=0,me=this.s,be,Ce;J>2]|=H[J]<>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[q],be=0;be>8,Z=H&255;Z>0;)re.unshift(Z),H=H>>8,Z=H&255,++te;return ee?re.push(te):re.unshift(te),this.update(re),re.length},M.prototype.encodeString=function(H){var ee,Z=typeof H;if(Z!=="string"){if(Z==="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 W=0;W=57344?te+=3:(q=65536+((q&1023)<<10|H.charCodeAt(++W)&1023),te+=4)}return te+=this.encode(te*8),this.update(H),te},M.prototype.bytepad=function(H,ee){for(var Z=this.encode(ee),te=0;te>2]|=this.padding[ee&3],this.lastByteIndex===this.byteCount)for(H[0]=H[Z],ee=1;ee>4&15]+c[J&15]+c[J>>12&15]+c[J>>8&15]+c[J>>20&15]+c[J>>16&15]+c[J>>28&15]+c[J>>24&15];W%H===0&&(le(ee),re=0)}return te&&(J=ee[re],q+=c[J>>4&15]+c[J&15],te>1&&(q+=c[J>>12&15]+c[J>>8&15]),te>2&&(q+=c[J>>20&15]+c[J>>16&15])),q},M.prototype.arrayBuffer=function(){this.finalize();var H=this.blockCount,ee=this.s,Z=this.outputBlocks,te=this.extraBytes,re=0,W=0,q=this.outputBits>>3,J;te?J=new ArrayBuffer(Z+1<<2):J=new ArrayBuffer(q);for(var me=new Uint32Array(J);W>8&255,q[J+2]=me>>16&255,q[J+3]=me>>24&255;W%H===0&&le(ee)}return te&&(J=W<<2,me=ee[re],q[J]=me&255,te>1&&(q[J+1]=me>>8&255),te>2&&(q[J+2]=me>>16&255)),q};function X(H,ee,Z){M.call(this,H,ee,Z)}X.prototype=new M,X.prototype.finalize=function(){return this.encode(this.outputBits,!0),M.prototype.finalize.call(this)};var le=function(H){var ee,Z,te,re,W,q,J,me,be,Ce,Fe,Ue,Ye,lt,xe,He,Ve,Ie,Ne,Oe,Me,Y,F,z,ie,pe,ve,he,Le,Ze,et,it,ut,pt,tr,Wt,At,mt,Ct,dt,Nt,jt,gt,Vt,zt,ot,Gt,Ft,yt,Qe,Ot,_t,Zt,Cr,qt,Ar,cr,br,Q,se,de,ue,we;for(te=0;te<48;te+=2)re=H[0]^H[10]^H[20]^H[30]^H[40],W=H[1]^H[11]^H[21]^H[31]^H[41],q=H[2]^H[12]^H[22]^H[32]^H[42],J=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],Ye=H[9]^H[19]^H[29]^H[39]^H[49],ee=Ue^(q<<1|J>>>31),Z=Ye^(J<<1|q>>>31),H[0]^=ee,H[1]^=Z,H[10]^=ee,H[11]^=Z,H[20]^=ee,H[21]^=Z,H[30]^=ee,H[31]^=Z,H[40]^=ee,H[41]^=Z,ee=re^(me<<1|be>>>31),Z=W^(be<<1|me>>>31),H[2]^=ee,H[3]^=Z,H[12]^=ee,H[13]^=Z,H[22]^=ee,H[23]^=Z,H[32]^=ee,H[33]^=Z,H[42]^=ee,H[43]^=Z,ee=q^(Ce<<1|Fe>>>31),Z=J^(Fe<<1|Ce>>>31),H[4]^=ee,H[5]^=Z,H[14]^=ee,H[15]^=Z,H[24]^=ee,H[25]^=Z,H[34]^=ee,H[35]^=Z,H[44]^=ee,H[45]^=Z,ee=me^(Ue<<1|Ye>>>31),Z=be^(Ye<<1|Ue>>>31),H[6]^=ee,H[7]^=Z,H[16]^=ee,H[17]^=Z,H[26]^=ee,H[27]^=Z,H[36]^=ee,H[37]^=Z,H[46]^=ee,H[47]^=Z,ee=Ce^(re<<1|W>>>31),Z=Fe^(W<<1|re>>>31),H[8]^=ee,H[9]^=Z,H[18]^=ee,H[19]^=Z,H[28]^=ee,H[29]^=Z,H[38]^=ee,H[39]^=Z,H[48]^=ee,H[49]^=Z,lt=H[0],xe=H[1],ot=H[11]<<4|H[10]>>>28,Gt=H[10]<<4|H[11]>>>28,he=H[20]<<3|H[21]>>>29,Le=H[21]<<3|H[20]>>>29,se=H[31]<<9|H[30]>>>23,de=H[30]<<9|H[31]>>>23,jt=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,Ve=H[12]<<12|H[13]>>>20,Ft=H[22]<<10|H[23]>>>22,yt=H[23]<<10|H[22]>>>22,Ze=H[33]<<13|H[32]>>>19,et=H[32]<<13|H[33]>>>19,ue=H[42]<<2|H[43]>>>30,we=H[43]<<2|H[42]>>>30,Cr=H[5]<<30|H[4]>>>2,qt=H[4]<<30|H[5]>>>2,Wt=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,Ot=H[35]<<15|H[34]>>>17,it=H[45]<<29|H[44]>>>3,ut=H[44]<<29|H[45]>>>3,z=H[6]<<28|H[7]>>>4,ie=H[7]<<28|H[6]>>>4,Ar=H[17]<<23|H[16]>>>9,cr=H[16]<<23|H[17]>>>9,mt=H[26]<<25|H[27]>>>7,Ct=H[27]<<25|H[26]>>>7,Oe=H[36]<<21|H[37]>>>11,Me=H[37]<<21|H[36]>>>11,_t=H[47]<<24|H[46]>>>8,Zt=H[46]<<24|H[47]>>>8,Vt=H[8]<<27|H[9]>>>5,zt=H[9]<<27|H[8]>>>5,pe=H[18]<<20|H[19]>>>12,ve=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,Y=H[48]<<14|H[49]>>>18,F=H[49]<<14|H[48]>>>18,H[0]=lt^~He&Ie,H[1]=xe^~Ve&Ne,H[10]=z^~pe&he,H[11]=ie^~ve&Le,H[20]=pt^~Wt&mt,H[21]=tr^~At&Ct,H[30]=Vt^~ot&Ft,H[31]=zt^~Gt&yt,H[40]=Cr^~Ar&br,H[41]=qt^~cr&Q,H[2]=He^~Ie&Oe,H[3]=Ve^~Ne&Me,H[12]=pe^~he&Ze,H[13]=ve^~Le&et,H[22]=Wt^~mt&dt,H[23]=At^~Ct&Nt,H[32]=ot^~Ft&Qe,H[33]=Gt^~yt&Ot,H[42]=Ar^~br&se,H[43]=cr^~Q&de,H[4]=Ie^~Oe&Y,H[5]=Ne^~Me&F,H[14]=he^~Ze&it,H[15]=Le^~et&ut,H[24]=mt^~dt&jt,H[25]=Ct^~Nt>,H[34]=Ft^~Qe&_t,H[35]=yt^~Ot&Zt,H[44]=br^~se&ue,H[45]=Q^~de&we,H[6]=Oe^~Y<,H[7]=Me^~F&xe,H[16]=Ze^~it&z,H[17]=et^~ut&ie,H[26]=dt^~jt&pt,H[27]=Nt^~gt&tr,H[36]=Qe^~_t&Vt,H[37]=Ot^~Zt&zt,H[46]=se^~ue&Cr,H[47]=de^~we&qt,H[8]=Y^~lt&He,H[9]=F^~xe&Ve,H[18]=it^~z&pe,H[19]=ut^~ie&ve,H[28]=jt^~pt&Wt,H[29]=gt^~tr&At,H[38]=_t^~Vt&ot,H[39]=Zt^~zt&Gt,H[48]=ue^~Cr&Ar,H[49]=we^~qt&cr,H[0]^=w[te],H[1]^=w[te+1]};if(o)t.exports=b;else for(P=0;P>=8;return e}function hj(t,e,r){let n=0;for(let i=0;ie+1+n&&$c.throwError("child data too short",Pe.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function qV(t,e){if(t.length===0&&$c.throwError("data too short",Pe.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&$c.throwError("data short segment too short",Pe.errors.BUFFER_OVERRUN,{});const n=hj(t,e+1,r);return e+1+r+n>t.length&&$c.throwError("data long segment too short",Pe.errors.BUFFER_OVERRUN,{}),pj(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&$c.throwError("data array too short",Pe.errors.BUFFER_OVERRUN,{}),pj(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&$c.throwError("data array too short",Pe.errors.BUFFER_OVERRUN,{});const n=hj(t,e+1,r);e+1+r+n>t.length&&$c.throwError("data array too short",Pe.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&&$c.throwError("data too short",Pe.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 O$(t){const e=er(t),r=qV(e,0);return r.consumed!==e.length&&$c.throwArgumentError("invalid rlp data","data",t),r.result}const D1e="address/5.7.0",m1=new Pe(D1e);function gj(t){Vr(t,20)||m1.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(yi(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 F1e=9007199254740991;function U1e(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const j$={};for(let t=0;t<10;t++)j$[String(t)]=String(t);for(let t=0;t<26;t++)j$[String.fromCharCode(65+t)]=String(10+t);const mj=Math.floor(U1e(F1e));function B1e(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>j$[n]).join("");for(;e.length>=mj;){let n=e.substring(0,mj);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"&&m1.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=gj(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&m1.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)!==B1e(t)&&m1.throwArgumentError("bad icap checksum","address",t),e=R1e(t.substring(4));e.length<40;)e="0"+e;e=gj("0x"+e)}else m1.throwArgumentError("invalid address","address",t);return e}function W1e(t){try{return Ir(t),!0}catch{}return!1}function VV(t){let e=null;try{e=Ir(t.from)}catch{m1.throwArgumentError("missing from address","transaction",t)}const r=w0(er(nt.from(t.nonce).toHexString()));return Ir(Es(yi(Iv([e,r])),12))}const z1e="properties/5.7.0";var H1e=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const g4=new Pe(z1e);function at(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Dc(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 hi(t){return H1e(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function GV(t,e){(!t||typeof t!="object")&&g4.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||g4.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Ti(t){const e={};for(const r in t)e[r]=t[r];return e}const q1e={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function KV(t){if(t==null||q1e[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;rpd(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&at(e,r,pd(n))}return e}return g4.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function pd(t){return V1e(t)}class Tv{constructor(e){for(const r in e)this[r]=pd(e[r])}}const G1e="abstract-provider/5.7.0";var K1e=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Y1e=new Pe(G1e);class Z1e extends Tv{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class K6{constructor(){Y1e.checkAbstract(new.target,K6),at(this,"_isProvider",!0)}getFeeData(){return K1e(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield hi({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(a=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=nt.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,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 J1e="networks/5.7.1",yj=new Pe(J1e);function Q1e(t){return t&&typeof t.renetwork=="function"}function Vu(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 s=["goerli","ropsten","rinkeby","sepolia"];try{const a=new r.PocketProvider(t,n.pocket);a.network&&s.indexOf(a.network.name)===-1&&i.push(a)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],a=new r.AnkrProvider(t,n.ankr);a.network&&s.indexOf(a.network.name)===-1&&i.push(a)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return Vu(r)},e}function m4(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return m4(t,n)},r}const vj={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Vu("homestead")},wj={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Vu("ropsten")},bj={chainId:63,name:"classicMordor",_defaultProvider:m4("https://www.ethercluster.com/mordor","classicMordor")},ib={unspecified:{chainId:0,name:"unspecified"},homestead:vj,mainnet:vj,morden:{chainId:2,name:"morden"},ropsten:wj,testnet:wj,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Vu("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Vu("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Vu("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Vu("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:m4("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:bj,classicTestnet:bj,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:m4("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Vu("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Vu("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 X1e(t){if(t==null)return null;if(typeof t=="number"){for(const n in ib){const i=ib[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=ib[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=ib[t.name];if(!e)return typeof t.chainId!="number"&&yj.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&yj.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(Q1e(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 YV(t){t=atob(t);const e=[];for(let r=0;r0;)n.push(a%this.base),a=a/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];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(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>6===2;a++)s++;return s}return t===io.OVERRUN?r.length-e-1:0}function oge(t,e,r,n,i){return t===io.OVERLONG?(n.push(i),0):(n.push(65533),eG(t,e,r))}const lge=Object.freeze({error:age,ignore:eG,replace:oge});function tG(t,e){e==null&&(e=lge.error),t=er(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,a=null;if((i&224)===192)s=1,a=127;else if((i&240)===224)s=2,a=2047;else if((i&248)===240)s=3,a=65535;else{(i&192)===128?n+=e(io.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(io.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(io.OVERRUN,n-1,t,r);continue}let o=i&(1<<8-s-1)-1;for(let l=0;l1114111){n+=e(io.OUT_OF_RANGE,n-1-s,t,r,o);continue}if(o>=55296&&o<=57343){n+=e(io.UTF16_SURROGATE,n-1-s,t,r,o);continue}if(o<=a){n+=e(io.OVERLONG,n-1-s,t,r,o);continue}r.push(o)}}return r}function po(t,e=S2.current){e!=S2.current&&(XV.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 s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const a=65536+((i&1023)<<10)+(s&1023);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(a&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return er(r)}function cge(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Mg(t,e){return cge(tG(t,e))}function uge(t,e=S2.current){return tG(po(t,e))}function y1(t){return yi(po(t))}const rG="hash/5.7.0";function nG(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(s,a){n.call(s,function(o){a>0&&Array.isArray(o)?i(o,a-1):r.push(o)})};return i(t,e),r}function dge(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 E=0;for(let R=0;R1;){let ae=B+S>>>1;R>>1|u(),U=U<<1^g,G=(G^g)<<1|g|1;_=U,A=1+G-U}let C=n-4;return v.map(R=>{switch(R-C){case 3:return C+65792+(t[o++]<<16|t[o++]<<8|t[o++]);case 2:return C+256+(t[o++]<<8|t[o++]);case 1:return C+t[o++];default:return R-1}})}function hge(t){let e=0;return()=>t[e++]}function pge(t){return hge(fge(t))}function gge(t){return t&1?~t>>1:t>>1}function mge(t,e){let r=Array(t);for(let n=0;ne[a]):r}function vge(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(bge(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(_ge(r,t))}return dge(nG(e))}function wge(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function iG(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[a].push(s));return n}function bge(t,e){let r=1+e(),n=e(),i=wge(e),s=iG(i.length,1+t,e);return nG(s.map((a,o)=>{const l=a[0],c=a.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 _ge(t,e){let r=1+e();return iG(r,1+t,e).map(i=>[i[0],i.slice(1)])}function xge(t){let e=y4(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let c=y4(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(),s=i%3;i=i/3|0;let a=!!(i&1);i>>=1;let o=i==1,l=i==2;return{branches:n,valid:s,fe0f:a,save:o,check:l}}}function Ege(){return pge(YV("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 Y6=Ege(),Cge=new Set(y4(Y6)),Age=new Set(y4(Y6)),Sge=vge(Y6),Ige=xge(Y6),xj=45,Ej=95;function sG(t){return uge(t)}function Tge(t){return t.filter(e=>e!=65039)}function aG(t){for(let e of t.split(".")){let r=sG(e);try{for(let n=r.lastIndexOf(Ej)-1;n>=0;n--)if(r[n]!==Ej)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===xj&&r[3]===xj)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function $ge(t){return aG(kge(t,Tge))}function kge(t,e){let r=sG(t).reverse(),n=[];for(;r.length;){let i=Pge(r);if(i){n.push(...e(i));continue}let s=r.pop();if(Cge.has(s)){n.push(s);continue}if(Age.has(s))continue;let a=Sge[s];if(a){n.push(...a);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return aG(Nge(String.fromCodePoint(...n)))}function Nge(t){return t.normalize("NFC")}function Pge(t,e){var r;let n=Ige,i,s,a=[],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)s=l;else if(n.check&&l===s)break;a.push(l),n.fe0f&&(a.push(65039),o>0&&t[o-1]==65039&&o--),n.valid&&(i=a.slice(),n.valid==2&&i.splice(1,1),t.length=o)}return i}const Rge=new Pe(rG),oG=new Uint8Array(32);oG.fill(0);function Cj(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function lG(t){const e=po($ge(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(Cj(e.slice(n))),r}function c5(t){typeof t!="string"&&Rge.throwArgumentError("invalid ENS name; not a string","name",t);let e=oG;const r=lG(t);for(;r.length;)e=yi(Ta([e,yi(r.pop())]));return Bt(e)}function Mge(t){return Bt(Ta(lG(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 Oge=`Ethereum Signed Message: +`;function cG(t){return typeof t=="string"&&(t=po(t)),yi(Ta([po(Oge),po(String(t.length)),t]))}var jge=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const zn=new Pe(rG),uG=new Uint8Array(32);uG.fill(0);const Lge=nt.from(-1),dG=nt.from(0),fG=nt.from(1),Dge=nt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Fge(t){const e=er(t),r=e.length%32;return r?Aa([e,uG.slice(r)]):Bt(e)}const Uge=Dn(fG.toHexString(),32),Bge=Dn(dG.toHexString(),32),Aj={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},S9=["name","version","chainId","verifyingContract","salt"];function Sj(t){return function(e){return typeof e!="string"&&zn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Wge={name:Sj("name"),version:Sj("version"),chainId:function(t){try{return nt.from(t).toString()}catch{}return zn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ir(t).toLowerCase()}catch{}return zn.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 zn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function I9(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))&&zn.throwArgumentError("invalid numeric width","type",t);const i=Dge.mask(r?n-1:n),s=r?i.add(fG).mul(Lge):dG;return function(a){const o=nt.from(a);return(o.lt(s)||o.gt(i))&&zn.throwArgumentError(`value out-of-bounds for ${t}`,"value",a),Dn(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))&&zn.throwArgumentError("invalid bytes width","type",t),function(n){return er(n).length!==r&&zn.throwArgumentError(`invalid length for ${t}`,"value",n),Fge(n)}}}switch(t){case"address":return function(e){return Dn(Ir(e),32)};case"bool":return function(e){return e?Uge:Bge};case"bytes":return function(e){return yi(e)};case"string":return function(e){return y1(e)}}return null}function Ij(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class eo{constructor(e){at(this,"types",Object.freeze(pd(e))),at(this,"_encoderCache",{}),at(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]&&zn.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&&zn.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!I9(u)&&(n[u]||zn.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(o),r[o][u]=!0)})}const s=Object.keys(n).filter(o=>n[o].length===0);s.length===0?zn.throwArgumentError("missing primary type","types",e):s.length>1&&zn.throwArgumentError(`ambiguous primary types or unused types: ${s.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),at(this,"primaryType",s[0]);function a(o,l){l[o]&&zn.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),l[o]=!0,Object.keys(r[o]).forEach(c=>{n[c]&&(a(c,l),Object.keys(l).forEach(u=>{i[u][c]=!0}))}),delete l[o]}a(this.primaryType,{});for(const o in i){const l=Object.keys(i[o]);l.sort(),this._types[o]=Ij(o,e[o])+l.map(c=>Ij(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=I9(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),a=parseInt(r[3]);return o=>{a>=0&&o.length!==a&&zn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",o);let l=o.map(s);return this._types[i]&&(l=l.map(yi)),yi(Aa(l))}}const n=this.types[e];if(n){const i=y1(this._types[e]);return s=>{const a=n.map(({name:o,type:l})=>{const c=this.getEncoder(l)(s[o]);return this._types[l]?yi(c):c});return a.unshift(i),Aa(a)}}return zn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||zn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return yi(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(I9(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const a=i[1],o=parseInt(i[3]);return o>=0&&r.length!==o&&zn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(a,l,n))}const s=this.types[e];return s?s.reduce((a,{name:o,type:l})=>(a[o]=this._visit(l,r[o],n),a),{}):zn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new eo(e)}static getPrimaryType(e){return eo.from(e).primaryType}static hashStruct(e,r,n){return eo.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=Aj[n];i||zn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>S9.indexOf(n.name)-S9.indexOf(i.name)),eo.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Aa(["0x1901",eo.hashDomain(e),eo.from(r).hash(n)])}static hash(e,r,n){return yi(eo.encode(e,r,n))}static resolveNames(e,r,n,i){return jge(this,void 0,void 0,function*(){e=Ti(e);const s={};e.verifyingContract&&!Vr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const a=eo.from(r);a.visit(n,(o,l)=>(o==="address"&&!Vr(l,20)&&(s[l]="0x"),l));for(const o in s)s[o]=yield i(o);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=a.visit(n,(o,l)=>o==="address"&&s[l]?s[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){eo.hashDomain(e);const i={},s=[];S9.forEach(l=>{const c=e[l];c!=null&&(i[l]=Wge[l](c),s.push({name:l,type:Aj[l]}))});const a=eo.from(r),o=Ti(r);return o.EIP712Domain?zn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):o.EIP712Domain=s,a.encode(n),{types:o,domain:i,primaryType:a.primaryType,message:a.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"&&zn.throwArgumentError("invalid string","value",c),c}return zn.throwArgumentError("unsupported type","type",l)})}}}var $v={},Lr={},q0=hG;function hG(t,e){if(!t)throw new Error(e||"Assertion failed")}hG.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var VA={exports:{}};typeof Object.create=="function"?VA.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:VA.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 ia=VA.exports,zge=q0,Hge=ia;Lr.inherits=Hge;function qge(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function Vge(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++]=s&63|128):qge(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Lr.htonl=pG;function Kge(t,e){for(var r="",n=0;n>>0}return s}Lr.join32=Yge;function Zge(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}Lr.split32=Zge;function Jge(t,e){return t>>>e|t<<32-e}Lr.rotr32=Jge;function Qge(t,e){return t<>>32-e}Lr.rotl32=Qge;function Xge(t,e){return t+e>>>0}Lr.sum32=Xge;function eme(t,e,r){return t+e+r>>>0}Lr.sum32_3=eme;function tme(t,e,r,n){return t+e+r+n>>>0}Lr.sum32_4=tme;function rme(t,e,r,n,i){return t+e+r+n+i>>>0}Lr.sum32_5=rme;function nme(t,e,r,n){var i=t[e],s=t[e+1],a=n+s>>>0,o=(a>>0,t[e+1]=a}Lr.sum64=nme;function ime(t,e,r,n){var i=e+n>>>0,s=(i>>0}Lr.sum64_hi=ime;function sme(t,e,r,n){var i=e+n;return i>>>0}Lr.sum64_lo=sme;function ame(t,e,r,n,i,s,a,o){var l=0,c=e;c=c+n>>>0,l+=c>>0,l+=c>>0,l+=c>>0}Lr.sum64_4_hi=ame;function ome(t,e,r,n,i,s,a,o){var l=e+n+s+o;return l>>>0}Lr.sum64_4_lo=ome;function lme(t,e,r,n,i,s,a,o,l,c){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}Lr.sum64_5_hi=lme;function cme(t,e,r,n,i,s,a,o,l,c){var u=e+n+s+o+c;return u>>>0}Lr.sum64_5_lo=cme;function ume(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Lr.rotr64_hi=ume;function dme(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Lr.rotr64_lo=dme;function fme(t,e,r){return t>>>r}Lr.shr64_hi=fme;function hme(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Lr.shr64_lo=hme;var Og={},Tj=Lr,pme=q0;function Z6(){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}Og.BlockHash=Z6;Z6.prototype.update=function(e,r){if(e=Tj.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=Tj.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,a=8;a>>3}uu.g0_256=wme;function bme(t){return Hc(t,17)^Hc(t,19)^t>>>10}uu.g1_256=bme;var X1=Lr,_me=Og,xme=uu,T9=X1.rotl32,Hm=X1.sum32,Eme=X1.sum32_5,Cme=xme.ft_1,bG=_me.BlockHash,Ame=[1518500249,1859775393,2400959708,3395469782];function ru(){if(!(this instanceof ru))return new ru;bG.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}X1.inherits(ru,bG);var Sme=ru;ru.blockSize=512;ru.outSize=160;ru.hmacStrength=80;ru.padLength=64;ru.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()),hye(e.length<=this.blockSize);for(var r=e.length;r{s[o.toLowerCase()]=a}):n.headers.keys().forEach(a=>{s[a.toLowerCase()]=n.headers.get(a)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:er(new Uint8Array(i))}})}var vye=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Sl=new Pe(gye);function Rj(t){return new Promise(e=>{setTimeout(e,t)})}function Kd(t,e){if(t==null)return null;if(typeof t=="string")return t;if(N$(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return Mg(t)}catch{}return Bt(t)}return t}function wye(t){return po(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function bye(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;Sl.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;Sl.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const a=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)&&Sl.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&&Sl.throwError("basic authentication requires a secure https url",Pe.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const v=t.user+":"+t.password;o.authorization={key:"Authorization",value:"Basic "+ZV(po(v))}}t.skipFetchSetup!=null&&(c.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(c.fetchOptions=Ti(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]?YV(g[3]):wye(g[3])};let _=v.body;return r&&(_=r(v.body,v)),Promise.resolve(_)}catch(v){Sl.throwError("processing response error",Pe.errors.SERVER_ERROR,{body:Kd(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 _=o[v];m[_.key]=_.value}),c.headers=m;const w=function(){let v=null;return{promise:new Promise(function(C,R){f&&(v=setTimeout(()=>{v!=null&&(v=null,R(Sl.makeError("timeout",Pe.errors.TIMEOUT,{requestBody:Kd(c.body,m["content-type"]),requestMethod:c.method,timeout:f,url:l})))},f))}),cancel:function(){v!=null&&(clearTimeout(v),v=null)}}}(),E=function(){return vye(this,void 0,void 0,function*(){for(let v=0;v=300)&&(w.cancel(),Sl.throwError("bad response",Pe.errors.SERVER_ERROR,{status:_.statusCode,headers:_.headers,body:Kd(A,_.headers?_.headers["content-type"]:null),requestBody:Kd(c.body,m["content-type"]),requestMethod:c.method,url:l})),r)try{const C=yield r(A,_);return w.cancel(),C}catch(C){if(C.throttleRetry&&v{let o=null;if(s!=null)try{o=JSON.parse(Mg(s))}catch(l){Sl.throwError("invalid JSON",Pe.errors.SERVER_ERROR,{body:s,error:l})}return r&&(o=r(o,a)),o},i=null;if(e!=null){i=po(e);const s=typeof t=="string"?{url:t}:Ti(t);s.headers?Object.keys(s.headers).filter(o=>o.toLowerCase()==="content-type").length!==0||(s.headers=Ti(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return bye(t,i,n)}function by(t,e){return e||(e={}),e=Ti(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,s=!1;const a=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{a()&&n(new Error("timeout"))},e.timeout));const o=e.retryLimit;let l=0;function c(){return t().then(function(u){if(u!==void 0)a()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",c);else if(e.onceBlock)e.onceBlock.once("block",c);else if(!s){if(l++,l>o){a()&&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){a()&&n(u)})}c()})}var v4="qpzry9x8gf2tvdw0s3jn54khce6mua7l",YA={};for(var ab=0;ab>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 NG(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=M1(e)^n>>5}for(e=M1(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=NG(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=M1(n)^a,i+=v4.charAt(a)}for(s=0;s<6;++s)n=M1(n);for(n^=1,s=0;s<6;++s){var o=n>>(5-s)*5&31;i+=v4.charAt(o)}return i}function PG(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 s=t.slice(0,i),a=t.slice(i+1);if(a.length<6)return"Data too short";var o=NG(s);if(typeof o=="string")return o;for(var l=[],c=0;c=a.length)&&l.push(f)}return o!==1?"Invalid checksum for "+t:{prefix:s,words:l}}function xye(){var t=PG.apply(null,arguments);if(typeof t=="object")return t}function Eye(t){var e=PG.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function J6(t,e,r,n){for(var i=0,s=0,a=(1<=r;)s-=r,o.push(i>>s&a);if(n)s>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(a){return a.length===1?"0"+a:a}r.zero2=i;function s(a){for(var o="",l=0;l(h>>1)-1?w=(h>>1)-E:w=E,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 E;m&1?(g=l.andln(7)+f&7,(g===3||g===5)&&w===2?E=-m:E=m):E=0,u[0].push(E);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===E+1&&(f=1-f),2*h===v+1&&(h=1-h),l.iushrn(1),c.iushrn(1)}return u}r.getJSF=i;function s(l,c,u){var f="_"+c;l.prototype[c]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function a(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=a;function o(l){return new yr(l,"hex","le")}r.intFromLE=o}),w4=xo.getNAF,kye=xo.getJSF,b4=xo.assert;function Qf(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 V0=Qf;Qf.prototype.point=function(){throw new Error("Not implemented")};Qf.prototype.validate=function(){throw new Error("Not implemented")};Qf.prototype._fixedNafMul=function(e,r){b4(e.precomputed);var n=e._getDoubles(),i=w4(r,1,this._bitLength),s=(1<=o;c--)l=(l<<1)+i[c];a.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=s;h>0;h--){for(o=0;o=0;l--){for(var c=0;l>=0&&a[l]===0;l--)c++;if(l>=0&&c++,o=o.dblp(c),l<0)break;var u=a[l];b4(u!==0),e.type==="affine"?u>0?o=o.mixedAdd(s[u-1>>1]):o=o.mixedAdd(s[-u-1>>1].neg()):u>0?o=o.add(s[u-1>>1]):o=o.add(s[-u-1>>1].neg())}return e.type==="affine"?o.toP():o};Qf.prototype._wnafMulAdd=function(e,r,n,i,s){var a=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(a[m]!==1||a[w]!==1){l[m]=w4(n[m],a[m],this._bitLength),l[w]=w4(n[w],a[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var E=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(E[1]=r[m].add(r[w]),E[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(E[1]=r[m].toJ().mixedAdd(r[w]),E[2]=r[m].add(r[w].neg())):(E[1]=r[m].toJ().mixedAdd(r[w]),E[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],_=kye(n[m],n[w]);for(c=Math.max(_[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var S=0;u>=0;){var U=!0;for(f=0;f=0&&S++,R=R.dblp(S),u<0)break;for(f=0;f0?h=o[f][G-1>>1]:G<0&&(h=o[f][-G-1>>1].neg()),h.type==="affine"?R=R.mixedAdd(h):R=R.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};sl.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=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}]};al.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=s.mul(n.a),l=a.mul(i.a),c=s.mul(n.b),u=a.mul(i.b),f=e.sub(o).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};al.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 s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};al.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};al.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a":""};rs.prototype.isInfinity=function(){return this.inf};rs.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)};rs.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(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),o=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)};rs.prototype.getX=function(){return this.x.fromRed()};rs.prototype.getY=function(){return this.y.fromRed()};rs.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)};rs.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};rs.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};rs.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)};rs.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(s){return s.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};rs.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 fs(t,e,r,n){V0.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}F$(fs,V0.BasePoint);al.prototype.jpoint=function(e,r,n){return new fs(this,e,r,n)};fs.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)};fs.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};fs.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),s=e.x.redMul(n),a=this.y.redMul(r.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),c=a.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(a.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};fs.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),s=this.y,a=e.y.redMul(r).redMul(this.z),o=n.redSub(i),l=s.redSub(a);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(s.redMul(u)),m=this.z.redMul(o);return this.curve.jpoint(h,g,m)};fs.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(s),this.x.cmp(n)===0)return!0}};fs.prototype.inspect=function(){return this.isInfinity()?"":""};fs.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var u5=Dg(function(t,e){var r=e;r.base=V0,r.short=Pye,r.mont=null,r.edwards=null}),d5=Dg(function(t,e){var r=e,n=xo.assert;function i(o){o.type==="short"?this.curve=new u5.short(o):o.type==="edwards"?this.curve=new u5.edwards(o):this.curve=new u5.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 s(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}})}s("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:Sc.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:Sc.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:Sc.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:Sc.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"]}),s("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:Sc.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Sc.sha256,gRed:!1,g:["9"]}),s("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:Sc.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=null.crash()}catch{a=void 0}s("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:Sc.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})});function Df(t){if(!(this instanceof Df))return new Df(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=Dl.toArray(t.entropy,t.entropyEnc||"hex"),r=Dl.toArray(t.nonce,t.nonceEnc||"hex"),n=Dl.toArray(t.pers,t.persEnc||"hex");D$(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var MG=Df;Df.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 s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Df.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=Dl.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var Rye=xo.assert;function Q6(t,e){if(t instanceof Q6)return t;this._importDER(t,e)||(Rye(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 X6=Q6;function Mye(){this.place=0}function P9(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,s=0,a=e.place;s>>=0;return i<=127?!1:(e.place=a,i)}function Oj(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)}Q6.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=Oj(r),n=Oj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];R9(i,r.length),i=i.concat(r),i.push(2),R9(i,n.length);var s=i.concat(n),a=[48];return R9(a,s.length),a=a.concat(s),xo.encode(a,e)};var Oye=function(){throw new Error("unsupported")},OG=xo.assert;function tl(t){if(!(this instanceof tl))return new tl(t);typeof t=="string"&&(OG(Object.prototype.hasOwnProperty.call(d5,t),"Unknown curve "+t),t=d5[t]),t instanceof d5.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 jye=tl;tl.prototype.keyPair=function(e){return new U$(this,e)};tl.prototype.keyFromPrivate=function(e,r){return U$.fromPrivate(this,e,r)};tl.prototype.keyFromPublic=function(e,r){return U$.fromPublic(this,e,r)};tl.prototype.genKeyPair=function(e){e||(e={});for(var r=new MG({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Oye(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 s=new yr(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};tl.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};tl.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 s=this.n.byteLength(),a=r.getPrivate().toArray("be",s),o=e.toArray("be",s),l=new MG({hash:this.hash,entropy:a,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 E=(h.getY().isOdd()?1:0)|(g.cmp(m)!==0?2:0);return i.canonical&&w.cmp(this.nh)>0&&(w=this.n.sub(w),E^=1),new X6({r:m,s:w,recoveryParam:E})}}}}}};tl.prototype.verify=function(e,r,n,i){e=this._truncateToN(new yr(e,16)),n=this.keyFromPublic(n,i),r=new X6(r,"hex");var s=r.r,a=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var o=a.invm(this.n),l=o.mul(e).umod(this.n),c=o.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)};tl.prototype.recoverPubKey=function(t,e,r,n){OG((3&r)===r,"The recovery param is more than two bits"),e=new X6(e,n);var i=this.n,s=new yr(t),a=e.r,o=e.s,l=r&1,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?a=this.curve.pointFromX(a.add(this.curve.n),l):a=this.curve.pointFromX(a,l);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(f,a,h)};tl.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new X6(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Lye=Dg(function(t,e){var r=e;r.version="6.5.4",r.utils=xo,r.rand=function(){throw new Error("unsupported")},r.curve=u5,r.curves=d5,r.ec=jye,r.eddsa=null}),Dye=Lye.ec;const Fye="signing-key/5.7.0",JA=new Pe(Fye);let M9=null;function af(){return M9||(M9=new Dye("secp256k1")),M9}class Uye{constructor(e){at(this,"curve","secp256k1"),at(this,"privateKey",Bt(e)),b0(this.privateKey)!==32&&JA.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=af().keyFromPrivate(er(this.privateKey));at(this,"publicKey","0x"+r.getPublic(!1,"hex")),at(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),at(this,"_isSigningKey",!0)}_addPoint(e){const r=af().keyFromPublic(er(this.publicKey)),n=af().keyFromPublic(er(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=af().keyFromPrivate(er(this.privateKey)),n=er(e);n.length!==32&&JA.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return G6({recoveryParam:i.recoveryParam,r:Dn("0x"+i.r.toString(16),32),s:Dn("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=af().keyFromPrivate(er(this.privateKey)),n=af().keyFromPublic(er(jG(e)));return Dn("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function Bye(t,e){const r=G6(e),n={r:er(r.r),s:er(r.s)};return"0x"+af().recoverPubKey(er(t),n,r.recoveryParam).encode("hex",!1)}function jG(t,e){const r=er(t);return r.length===32?new Uye(r).publicKey:r.length===33?"0x"+af().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?Bt(r):JA.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Wye="transactions/5.7.0",Pa=new Pe(Wye);var jj;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(jj||(jj={}));function B$(t){return t==="0x"?null:Ir(t)}function Ss(t){return t==="0x"?QV:nt.from(t)}const zye=[{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"}],Hye={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function qye(t){const e=jG(t);return Ir(Es(yi(Es(e,1)),12))}function W$(t,e){return qye(Bye(er(t),e))}function so(t,e){const r=w0(nt.from(t).toHexString());return r.length>32&&Pa.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function O9(t,e){return{address:Ir(t),storageKeys:(e||[]).map((r,n)=>(b0(r)!==32&&Pa.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function Fg(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Pa.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),O9(r[0],r[1])):O9(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return O9(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function LG(t){return Fg(t).map(e=>[e.address,e.storageKeys])}function DG(t,e){if(t.gasPrice!=null){const n=nt.from(t.gasPrice),i=nt.from(t.maxFeePerGas||0);n.eq(i)||Pa.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[so(t.chainId||0,"chainId"),so(t.nonce||0,"nonce"),so(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),so(t.maxFeePerGas||0,"maxFeePerGas"),so(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",so(t.value||0,"value"),t.data||"0x",LG(t.accessList||[])];if(e){const n=G6(e);r.push(so(n.recoveryParam,"recoveryParam")),r.push(w0(n.r)),r.push(w0(n.s))}return Aa(["0x02",Iv(r)])}function FG(t,e){const r=[so(t.chainId||0,"chainId"),so(t.nonce||0,"nonce"),so(t.gasPrice||0,"gasPrice"),so(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",so(t.value||0,"value"),t.data||"0x",LG(t.accessList||[])];if(e){const n=G6(e);r.push(so(n.recoveryParam,"recoveryParam")),r.push(w0(n.r)),r.push(w0(n.s))}return Aa(["0x01",Iv(r)])}function Vye(t,e){GV(t,Hye);const r=[];zye.forEach(function(i){let s=t[i.name]||[];const a={};i.numeric&&(a.hexPad="left"),s=er(Bt(s,a)),i.length&&s.length!==i.length&&s.length>0&&Pa.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,s),i.maxLength&&(s=w0(s),s.length>i.maxLength&&Pa.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,s)),r.push(Bt(s))});let n=0;return t.chainId!=null&&(n=t.chainId,typeof n!="number"&&Pa.throwArgumentError("invalid transaction.chainId","transaction",t)),n!==0&&(r.push(Bt(n)),r.push("0x"),r.push("0x")),Iv(r)}function Gye(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&Pa.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),Vye(t);switch(t.type){case 1:return FG(t,e);case 2:return DG(t,e)}return Pa.throwError(`unsupported transaction type: ${t.type}`,Pe.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function UG(t,e,r){try{const n=Ss(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Pa.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Dn(e[1],32),t.s=Dn(e[2],32);try{const n=yi(r(t));t.from=W$(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function Kye(t){const e=O$(t.slice(1));e.length!==9&&e.length!==12&&Pa.throwArgumentError("invalid component count for transaction type: 2","payload",Bt(t));const r=Ss(e[2]),n=Ss(e[3]),i={type:2,chainId:Ss(e[0]).toNumber(),nonce:Ss(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ss(e[4]),to:B$(e[5]),value:Ss(e[6]),data:e[7],accessList:Fg(e[8])};return e.length===9||(i.hash=yi(t),UG(i,e.slice(9),DG)),i}function Yye(t){const e=O$(t.slice(1));e.length!==8&&e.length!==11&&Pa.throwArgumentError("invalid component count for transaction type: 1","payload",Bt(t));const r={type:1,chainId:Ss(e[0]).toNumber(),nonce:Ss(e[1]).toNumber(),gasPrice:Ss(e[2]),gasLimit:Ss(e[3]),to:B$(e[4]),value:Ss(e[5]),data:e[6],accessList:Fg(e[7])};return e.length===8||(r.hash=yi(t),UG(r,e.slice(8),FG)),r}function Zye(t){const e=O$(t);e.length!==9&&e.length!==6&&Pa.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Ss(e[0]).toNumber(),gasPrice:Ss(e[1]),gasLimit:Ss(e[2]),to:B$(e[3]),value:Ss(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=Dn(e[7],32),r.s=Dn(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 s=yi(Iv(i));try{r.from=W$(s,{r:Bt(r.r),s:Bt(r.s),recoveryParam:n})}catch{}r.hash=yi(t)}return r.type=null,r}function Jye(t){const e=er(t);if(e[0]>127)return Zye(e);switch(e[0]){case 1:return Yye(e);case 2:return Kye(e)}return Pa.throwError(`unsupported transaction type: ${e[0]}`,Pe.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const Vm=new Pe(kv);class Rt{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),s=this.data.bind(this),a=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:a,type:c,accessList:Rt.allowNull(this.accessList.bind(this),null),blockHash:Rt.allowNull(a,null),blockNumber:Rt.allowNull(l,null),transactionIndex:Rt.allowNull(l,null),confirmations:Rt.allowNull(l,null),from:r,gasPrice:Rt.allowNull(n),maxPriorityFeePerGas:Rt.allowNull(n),maxFeePerGas:Rt.allowNull(n),gasLimit:n,to:Rt.allowNull(r,null),value:n,nonce:l,data:s,r:Rt.allowNull(this.uint256),s:Rt.allowNull(this.uint256),v:Rt.allowNull(l),creates:Rt.allowNull(r,null),raw:Rt.allowNull(s)},e.transactionRequest={from:Rt.allowNull(r),nonce:Rt.allowNull(l),gasLimit:Rt.allowNull(n),gasPrice:Rt.allowNull(n),maxPriorityFeePerGas:Rt.allowNull(n),maxFeePerGas:Rt.allowNull(n),to:Rt.allowNull(r),value:Rt.allowNull(n),data:Rt.allowNull(u),type:Rt.allowNull(l),accessList:Rt.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:a,address:r,topics:Rt.arrayOf(a),data:s,logIndex:l,blockHash:a},e.receipt={to:Rt.allowNull(this.address,null),from:Rt.allowNull(this.address,null),contractAddress:Rt.allowNull(r,null),transactionIndex:l,root:Rt.allowNull(o),gasUsed:n,logsBloom:Rt.allowNull(s),blockHash:a,transactionHash:a,logs:Rt.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:Rt.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:Rt.allowNull(n),status:Rt.allowNull(l),type:c},e.block={hash:Rt.allowNull(a),parentHash:a,number:l,timestamp:l,nonce:Rt.allowNull(o),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Rt.allowNull(r),extraData:s,transactions:Rt.allowNull(Rt.arrayOf(a)),baseFeePerGas:Rt.allowNull(n)},e.blockWithTransactions=Ti(e.block),e.blockWithTransactions.transactions=Rt.allowNull(Rt.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Rt.allowNull(i,void 0),toBlock:Rt.allowNull(i,void 0),blockHash:Rt.allowNull(a,void 0),address:Rt.allowNull(r,void 0),topics:Rt.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Rt.allowNull(l),blockHash:Rt.allowNull(a),transactionIndex:l,removed:Rt.allowNull(this.boolean.bind(this)),address:r,data:Rt.allowFalsish(s,"0x"),topics:Rt.arrayOf(a),transactionHash:a,logIndex:l},e}accessList(e){return Fg(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),Vr(e))?e.toLowerCase():Vm.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(!Vr(e,32))return null;const r=Ir(Es(e,12));return r===ege?null:r}contractAddress(e){return VV(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"||Vr(e))return P$(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return b0(n)!==32?Vm.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(!Vr(e))throw new Error("invalid uint256");return Dn(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=Rt.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 Rt.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=Rt.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;Vr(n)&&(n=nt.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),Vr(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 Jye(e)}receiptLog(e){return Rt.check(this.formats.receiptLog,e)}receipt(e){const r=Rt.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&&Vm.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):Vm.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&Vm.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 Rt.check(this.formats.filter,e)}filterLog(e){return Rt.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}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(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Tr=new Pe(kv),Qye=10;function Lj(t){return t==null?"null":(b0(t)!==32&&Tr.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function Dj(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[Lj(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return Lj(e)}).join("&")}function Xye(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 Mp(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:*:"+Dj(t);if(Z1e.isForkEvent(t))throw Tr.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+Dj(t.topics||[])}throw new Error("invalid event - "+t)}function Gm(){return new Date().getTime()}function Fj(t){return new Promise(e=>{setTimeout(e,t)})}const e2e=["block","network","pending","poll"];let t2e=class{constructor(e,r,n){at(this,"tag",e),at(this,"listener",r),at(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=Xye(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||e2e.indexOf(this.tag)>=0}};const r2e={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 j9(t){return Dn(nt.from(t).toHexString(),32)}function Uj(t){return qA.encode(Ta([t,Es(Pj(Pj(t)),0,4)]))}const BG=new RegExp("^(ipfs)://(.*)$","i"),Bj=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),BG,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function f5(t,e){try{return Mg(I2(t,e))}catch{}return null}function I2(t,e){if(t==="0x")return null;const r=nt.from(Es(t,e,e+32)).toNumber(),n=nt.from(Es(t,r,r+32)).toNumber();return Es(t,r+32,r+32+n)}function L9(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Tr.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Wj(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 n2e(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function WG(t){const e=[];let r=0;for(let n=0;nnt.from(e).eq(1)).catch(e=>{if(e.code===Pe.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:Aa([e,c5(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Aa(["0x9061b923",WG([Mge(this.name),n.data])]));try{let s=yield this.provider.call(n);return er(s).length%32===4&&Tr.throwError("resolver threw error",Pe.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=I2(s,0)),s}catch(s){if(s.code===Pe.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return hr(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?I2(n,0):null})}_getAddress(e,r){const n=r2e[String(e)];if(n==null&&Tr.throwError(`unsupported coin type: ${e}`,Pe.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=er(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const a=parseInt(s[1],16);if(s[2].length===a*2&&a>=1&&a<=75)return Uj(Ta([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const a=parseInt(s[1],16);if(s[2].length===a*2&&a>=1&&a<=75)return Uj(Ta([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let a=i[0];if(a===0?s!==20&&s!==32&&(a=-1):a=-1,a>=0&&i.length===2+s&&s>=1&&s<=75){const o=Mj.toWords(i.slice(2));return o.unshift(a),Mj.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===ige?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===Pe.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",j9(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Tr.throwError("invalid or unsupported coin data",Pe.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;na[l])}return Tr.throwError("invalid or unsupported content hash data",Pe.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return hr(this,void 0,void 0,function*(){let r=po(e);r=Ta([j9(64),j9(r.length),r]),r.length%32!==0&&(r=Ta([r,Dn("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Bt(r));return n==null||n==="0x"?null:Mg(n)})}}let D9=null,i2e=1;class s2e extends K6{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),at(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=Dc(new.target,"getNetwork")(e);r?(at(this,"_network",r),this.emit("network",r,null)):Tr.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||Tr.throwError("no network detected",Pe.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:at(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return by(()=>this._ready().then(e=>e,e=>{if(!(e.code===Pe.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return D9==null&&(D9=new Rt),D9}static getNetwork(e){return X1e(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(),s=r.toLowerCase(),a=[];for(let o=0;o=0?null:JSON.stringify({data:s,sender:i}),f=yield L$({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 Tr.throwError(`response not found during CCIP fetch: ${h}`,Pe.errors.SERVER_ERROR,{url:l,errorMessage:h});a.push(h)}return Tr.throwError(`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,Pe.errors.SERVER_ERROR,{urls:n,errorMessages:a})})}_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 s=yield i;if(Gm()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=Gm(),n=hi({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const a=Gm();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=i2e++,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)Tr.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Tr.makeError("network block skew detected",Pe.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 s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let a=this.getTransactionReceipt(s).then(o=>(!o||o.blockNumber==null||(this._emitted["t:"+s]=o.blockNumber,this.emit(s,o)),null)).catch(o=>{this.emit("error",o)});r.push(a);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const a=s.toBlock-this._maxFilterBlockRange;a>s.fromBlock&&(s.fromBlock=a),s.fromBlock<0&&(s.fromBlock=0);const o=this.getLogs(s).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(s,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 Tr.throwError("provider does not support network detection",Pe.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 Fj(0),this._network;const n=Tr.makeError("underlying network changed",Pe.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=Gm();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 s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((a,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 Fj(1e3),this.getTransactionCount(i.from).then(E=>hr(this,void 0,void 0,function*(){if(!c){if(E<=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(Tr.makeError("timeout exceeded",Pe.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 Tr.throwError("bad result from backend",Pe.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 hi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return nt.from(i)}catch(s){return Tr.throwError("bad result from backend",Pe.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield hi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return nt.from(i).toNumber()}catch(s){return Tr.throwError("bad result from backend",Pe.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield hi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Bt(i)}catch(s){return Tr.throwError("bad result from backend",Pe.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield hi({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(a=>P$(a))}),s=yield this.perform("getStorageAt",i);try{return Bt(s)}catch(a){return Tr.throwError("bad result from backend",Pe.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:a})}})}_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&&Tr.throwError("Transaction hash mismatch from Provider.sendTransaction.",Pe.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,a)=>hr(this,void 0,void 0,function*(){s==null&&(s=1),a==null&&(a=0);let o;s!==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,s,a,o);return l==null&&s===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Tr.throwError("transaction failed",Pe.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(s=>Bt(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_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(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?nt.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?Bt(s):null))}),this.formatter.transactionRequest(yield hi(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 hi(r))})}_call(e,r,n){return hr(this,void 0,void 0,function*(){n>=Qye&&Tr.throwError("CCIP read exceeded maximum redirections",Pe.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&b0(s)%32===4)try{const a=Es(s,4),o=Es(a,0,32);nt.from(o).eq(i)||Tr.throwError("CCIP Read sender did not match",Pe.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const l=[],c=nt.from(Es(a,32,64)).toNumber(),u=nt.from(Es(a,c,c+32)).toNumber(),f=Es(a,c+32);for(let v=0;vhr(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let a=null;for(let l=0;lthis._wrapTransaction(l)),o}return this.formatter.block(s)}),{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 by(()=>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 a=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;a<=0&&(a=1),i.confirmations=a}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 by(()=>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 a=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;a<=0&&(a=1),i.confirmations=a}return i}),{oncePoll:this})})}getLogs(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield hi({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),Rt.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&&Tr.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 zj(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||Tr.throwError("network does not support ENS",Pe.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+c5(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(Vr(e))throw n}typeof e!="string"&&Tr.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=f5(yield this.call({to:n,data:"0x691f3431"+c5(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(Vr(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",a=yield this._getResolver(s,"getAvatar");if(!a)return null;r=new zj(this,a,s);try{const o=yield r.getAvatar();if(o)return o.url}catch(o){if(o.code!==Pe.errors.CALL_EXCEPTION)throw o}try{const o=f5(yield this.call({to:a,data:"0x691f3431"+c5(s).substring(2)}),0);r=yield this.getResolver(o)}catch(o){if(o.code!==Pe.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 Tr.throwError(e+" not implemented",Pe.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 t2e(Mp(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=[],s=Mp(e);return this._events=this._events.filter(a=>a.tag!==s?!0:(setTimeout(()=>{a.listener.apply(this,r)},0),n=!0,a.once?(i.push(a),!1):!0)),i.forEach(a=>{this._stopEvent(a)}),n}listenerCount(e){if(!e)return this._events.length;let r=Mp(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Mp(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,s=Mp(e);return this._events=this._events.filter(a=>a.tag!==s||a.listener!=r||i?!0:(i=!0,n.push(a),!1)),n.forEach(a=>{this._stopEvent(a)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Mp(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}const a2e="abstract-signer/5.7.0";var _l=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Uo=new Pe(a2e),o2e=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],l2e=[Pe.errors.INSUFFICIENT_FUNDS,Pe.errors.NONCE_EXPIRED,Pe.errors.REPLACEMENT_UNDERPRICED];class Nv{constructor(){Uo.checkAbstract(new.target,Nv),at(this,"_isSigner",!0)}getBalance(e){return _l(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return _l(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return _l(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield hi(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return _l(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield hi(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return _l(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 _l(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return _l(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return _l(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return _l(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)o2e.indexOf(n)===-1&&Uo.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Ti(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()&&Uo.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return _l(this,void 0,void 0,function*(){const r=yield hi(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>_l(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Uo.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Uo.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Uo.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 s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Uo.throwError("network does not support EIP-1559",Pe.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Uo.throwError("failed to get consistent fee data",Pe.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(l2e.indexOf(i.code)>=0)throw i;return Uo.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Pe.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]&&Uo.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield hi(r)})}_checkProvider(e){this.provider||Uo.throwError("missing provider",Pe.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class e8 extends Nv{constructor(e,r){super(),at(this,"address",e),at(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Uo.throwError(e,Pe.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 e8(this.address,e)}}var Bu=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const pi=new Pe(kv),c2e=["call","estimateGas"];function zy(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=Vr(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=zy(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return zy(JSON.parse(t),e)}catch{}return null}function zG(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=zy(e,!0);if(s)return s.data;pi.throwError("missing revert data in call exception; Transaction reverted without a reason string",Pe.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=zy(e.body,!1);s==null&&(s=zy(e,!1)),s&&pi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Pe.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===Pe.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)&&pi.throwError("insufficient funds for intrinsic transaction cost",Pe.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&pi.throwError("nonce has already been used",Pe.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&pi.throwError("replacement fee too low",Pe.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&pi.throwError("legacy pre-eip-155 transactions not supported",Pe.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),c2e.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&pi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Pe.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Hj(t){return new Promise(function(e){setTimeout(e,t)})}function u2e(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 Km(t){return t&&t.toLowerCase()}const QA={};class HG extends Nv{constructor(e,r,n){if(super(),e!==QA)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");at(this,"provider",r),n==null&&(n=0),typeof n=="string"?(at(this,"_address",this.provider.formatter.address(n)),at(this,"_index",null)):typeof n=="number"?(at(this,"_index",n),at(this,"_address",null)):pi.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return pi.throwError("cannot alter JSON-RPC Signer connection",Pe.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new d2e(QA,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&&pi.throwError("unknown account #"+this._index,Pe.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Ti(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Ti(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Bu(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&pi.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),hi({tx:hi(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&pi.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(a=>a,a=>(typeof a.message=="string"&&a.message.match(/user denied/i)&&pi.throwError("user rejected transaction",Pe.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),zG("sendTransaction",a,s)))})}signTransaction(e){return pi.throwError("signing transactions is unsupported",Pe.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Bu(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 by(()=>Bu(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 Bu(this,void 0,void 0,function*(){const r=typeof e=="string"?po(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)&&pi.throwError("user rejected signing",Pe.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Bu(this,void 0,void 0,function*(){const r=typeof e=="string"?po(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)&&pi.throwError("user rejected signing",Pe.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Bu(this,void 0,void 0,function*(){const i=yield eo.resolveNames(e,r,n,a=>this.provider.resolveName(a)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(eo.getPayload(i.domain,r,i.value))])}catch(a){throw typeof a.message=="string"&&a.message.match(/user denied/i)&&pi.throwError("user rejected signing",Pe.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),a}})}unlock(e){return Bu(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class d2e extends HG{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 f2e={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class qG extends s2e{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(a=>{i(a)},a=>{s(a)})},0)})),super(n),e||(e=Dc(this.constructor,"defaultUrl")()),typeof e=="string"?at(this,"connection",Object.freeze({url:e})):at(this,"connection",Object.freeze(Ti(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 Bu(this,void 0,void 0,function*(){yield Hj(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=Dc(this.constructor,"getNetwork");try{return r(nt.from(e).toNumber())}catch(n){return pi.throwError("could not detect network",Pe.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return pi.throwError("could not detect network",Pe.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new HG(QA,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:pd(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=L$(this.connection,JSON.stringify(n),u2e).then(a=>(this.emit("debug",{action:"response",request:n,response:a,provider:this}),a),a=>{throw this.emit("debug",{action:"response",error:a,request:n,provider:this}),a});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Km(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Km(r.address),r.blockTag]];case"getCode":return["eth_getCode",[Km(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Km(r.address),Dn(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",[Dc(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Dc(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=Km(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Bu(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 s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Ti(r),r.transaction=Ti(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&pi.throwError(e+" not implemented",Pe.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return zG(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(s){if(e._pendingFilter!=r)return null;let a=Promise.resolve();return s.forEach(function(o){e._emitted["t:"+o.toLowerCase()]="pending",a=a.then(function(){return e.getTransaction(o).then(function(l){return e.emit("pending",l),null})})}),a.then(function(){return Hj(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}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=Ti(f2e);if(r)for(const s in r)r[s]&&(n[s]=!0);GV(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const a=P$(nt.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=a}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=Bt(e[s]))}),e.accessList&&(i.accessList=Fg(e.accessList)),i}}var h2e=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const p2e=new Pe(kv);class g2e extends qG{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return h2e(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||p2e.throwError("no network detected",Pe.errors.UNKNOWN_ERROR,{}),this._network==null&&(at(this,"_network",r),this.emit("network",r,null))),r})}}const qj=new Pe(kv);let m2e=1;function Vj(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:m2e++,jsonrpc:"2.0"};return new Promise((a,o)=>{this.emit("debug",{action:"request",fetcher:r,request:pd(s),provider:this}),e(s,(l,c)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:s,provider:this}),o(l);if(this.emit("debug",{action:"response",fetcher:r,request:s,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)}a(c.result)})})}}function y2e(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:pd(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 _4 extends qG{constructor(e,r){e==null&&qj.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=y2e(e)):e.sendAsync?i=Vj(e,e.sendAsync.bind(e)):e.send?i=Vj(e,e.send.bind(e)):qj.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),at(this,"jsonRpcFetchFunc",i),at(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}function v2e(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 w2e(){const t=new Set;let e=[];const r=()=>v2e(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(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(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n==null||n(),n=r()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}var kt={},XA={exports:{}};(function(t,e){(function(r,n){var i="1.0.40",s="",a="?",o="function",l="undefined",c="object",u="string",f="major",h="model",g="name",m="type",w="vendor",E="version",v="architecture",_="console",A="mobile",C="tablet",R="smarttv",B="wearable",S="embedded",U=500,G="Amazon",ae="Apple",K="ASUS",N="BlackBerry",k="Browser",b="Chrome",x="Edge",P="Firefox",D="Google",O="Huawei",j="LG",T="Microsoft",L="Motorola",M="Opera",X="Samsung",le="Sharp",H="Sony",ee="Xiaomi",Z="Zebra",te="Facebook",re="Chromium OS",W="Mac OS",q=" Browser",J=function(Me,Y){var F={};for(var z in Me)Y[z]&&Y[z].length%2===0?F[z]=Y[z].concat(Me[z]):F[z]=Me[z];return F},me=function(Me){for(var Y={},F=0;F0?ve.length===2?typeof ve[1]==o?this[ve[0]]=ve[1].call(this,Le):this[ve[0]]=ve[1]:ve.length===3?typeof ve[1]===o&&!(ve[1].exec&&ve[1].test)?this[ve[0]]=Le?ve[1].call(this,Le,ve[2]):n:this[ve[0]]=Le?Le.replace(ve[1],ve[2]):n:ve.length===4&&(this[ve[0]]=Le?ve[3].call(this,Le.replace(ve[1],ve[2])):n):this[ve]=Le||n;F+=2}},lt=function(Me,Y){for(var F in Y)if(typeof Y[F]===c&&Y[F].length>0){for(var z=0;z2&&(he[h]="iPad",he[m]=C),he},this.getEngine=function(){var he={};return he[g]=n,he[E]=n,Ye.call(he,z,pe.engine),he},this.getOS=function(){var he={};return he[g]=n,he[E]=n,Ye.call(he,z,pe.os),ve&&!he[g]&&ie&&ie.platform&&ie.platform!="Unknown"&&(he[g]=ie.platform.replace(/chrome os/i,re).replace(/macos/i,W)),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 z},this.setUA=function(he){return z=typeof he===u&&he.length>U?Ue(he,U):he,this},this.setUA(z),this};Ie.VERSION=i,Ie.BROWSER=me([g,E,f]),Ie.CPU=me([v]),Ie.DEVICE=me([h,w,m,_,A,R,C,B,S]),Ie.ENGINE=Ie.OS=me([g,E]),t.exports&&(e=t.exports=Ie),e.UAParser=Ie;var Ne=typeof r!==l&&(r.jQuery||r.Zepto);if(Ne&&!Ne.ua){var Oe=new Ie;Ne.ua=Oe.getResult(),Ne.ua.get=function(){return Oe.getUA()},Ne.ua.set=function(Me){Oe.setUA(Me);var Y=Oe.getResult();for(var F in Y)Ne.ua[F]=Y[F]}}})(typeof window=="object"?window:Xt)})(XA,XA.exports);var b2e=XA.exports;Object.defineProperty(kt,"__esModule",{value:!0});function _2e(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Rs=I,An=_2e(Rs),VG=b2e,Xf=new VG,js=Xf.getBrowser(),x2e=Xf.getCPU(),Eo=Xf.getDevice(),z$=Xf.getEngine(),eh=Xf.getOS(),Pv=Xf.getUA(),GG=function(e){return Xf.setUA(e)},Rv=function(e){if(!e){console.error("No userAgent string was provided");return}var r=new VG(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)}}},KG=Object.freeze({ClientUAInstance:Xf,browser:js,cpu:x2e,device:Eo,engine:z$,os:eh,ua:Pv,setUa:GG,parseUserAgent:Rv});function Gj(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 E2e(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function ol(t,e){if(t==null)return{};var r=$2e(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function h5(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function k2e(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 h5(t)}function N2e(t,e){return P2e(t)||R2e(t,e)||M2e(t,e)||O2e()}function P2e(t){if(Array.isArray(t))return t}function R2e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,s=!1,a,o;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(l){s=!0,o=l}finally{try{!i&&r.return!=null&&r.return()}finally{if(s)throw o}}return n}}function M2e(t,e){if(t){if(typeof t=="string")return Kj(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 Kj(t,e)}}function Kj(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},H$=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},q$=function(e){var r=H$();return r&&r.platform&&(r.platform.indexOf(e)!==-1||r.platform==="MacIntel"&&r.maxTouchPoints>1&&!window.MSStream)},F2e=function(e,r,n,i,s){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(s)}},Yj=function(e,r,n,i){return E2e({},e,{vendor:dr(r.vendor),model:dr(r.model),os:dr(n.name),osVersion:dr(n.version),ua:dr(i)})},U2e=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)}},B2e=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)}},W2e=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)}},z2e=function(e,r,n,i,s){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(s)}};function H2e(t){var e=t?Rv(t):KG,r=e.device,n=e.browser,i=e.engine,s=e.os,a=e.ua,o=L2e(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 F2e(l,n,i,s,a);if(f)return U2e(f,i,s,a);if(h)return B2e(h,i,s,a);if(c||u)return Yj(o,r,s,a);if(g)return W2e(g,i,s,a);if(m)return z2e(m,r,i,s,a)}var YG=function(e){var r=e.type;return r===Cs.Mobile},ZG=function(e){var r=e.type;return r===Cs.Tablet},JG=function(e){var r=e.type;return r===Cs.Mobile||r===Cs.Tablet},QG=function(e){var r=e.type;return r===Cs.SmartTv},x4=function(e){var r=e.type;return r===Cs.Browser},XG=function(e){var r=e.type;return r===Cs.Wearable},eK=function(e){var r=e.type;return r===Cs.Console},tK=function(e){var r=e.type;return r===Cs.Embedded},rK=function(e){var r=e.vendor;return dr(r)},nK=function(e){var r=e.model;return dr(r)},iK=function(e){var r=e.type;return dr(r,"browser")},sK=function(e){var r=e.name;return r===Ug.Android},aK=function(e){var r=e.name;return r===Ug.Windows},oK=function(e){var r=e.name;return r===Ug.MAC_OS},lK=function(e){var r=e.name;return r===Ug.WindowsPhone},cK=function(e){var r=e.name;return r===Ug.IOS},uK=function(e){var r=e.version;return dr(r)},dK=function(e){var r=e.name;return dr(r)},fK=function(e){var r=e.name;return r===ja.Chrome},hK=function(e){var r=e.name;return r===ja.Firefox},pK=function(e){var r=e.name;return r===ja.Chromium},E4=function(e){var r=e.name;return r===ja.Edge},gK=function(e){var r=e.name;return r===ja.Yandex},mK=function(e){var r=e.name;return r===ja.Safari||r===ja.MobileSafari},yK=function(e){var r=e.name;return r===ja.MobileSafari},vK=function(e){var r=e.name;return r===ja.Opera},wK=function(e){var r=e.name;return r===ja.InternetExplorer||r===ja.Ie},bK=function(e){var r=e.name;return r===ja.MIUI},_K=function(e){var r=e.name;return r===ja.SamsungBrowser},xK=function(e){var r=e.version;return dr(r)},EK=function(e){var r=e.major;return dr(r)},CK=function(e){var r=e.name;return dr(r)},AK=function(e){var r=e.name;return dr(r)},SK=function(e){var r=e.version;return dr(r)},IK=function(){var e=H$(),r=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof r=="string"?/electron/.test(r):!1},O1=function(e){return typeof e=="string"&&e.indexOf("Edg/")!==-1},TK=function(){var e=H$();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform==="MacIntel"&&e.maxTouchPoints>1)&&!window.MSStream},Rc=function(){return q$("iPad")},$K=function(){return q$("iPhone")},kK=function(){return q$("iPod")},NK=function(e){return dr(e)};function PK(t){var e=t||KG,r=e.device,n=e.browser,i=e.os,s=e.engine,a=e.ua;return{isSmartTV:QG(r),isConsole:eK(r),isWearable:XG(r),isEmbedded:tK(r),isMobileSafari:yK(n)||Rc(),isChromium:pK(n),isMobile:JG(r)||Rc(),isMobileOnly:YG(r),isTablet:ZG(r)||Rc(),isBrowser:x4(r),isDesktop:x4(r),isAndroid:sK(i),isWinPhone:lK(i),isIOS:cK(i)||Rc(),isChrome:fK(n),isFirefox:hK(n),isSafari:mK(n),isOpera:vK(n),isIE:wK(n),osVersion:uK(i),osName:dK(i),fullBrowserVersion:xK(n),browserVersion:EK(n),browserName:CK(n),mobileVendor:rK(r),mobileModel:nK(r),engineName:AK(s),engineVersion:SK(s),getUA:NK(a),isEdge:E4(n)||O1(a),isYandex:gK(n),deviceType:iK(r),isIOS13:TK(),isIPad13:Rc(),isIPhone13:$K(),isIPod13:kK(),isElectron:IK(),isEdgeChromium:O1(a),isLegacyEdge:E4(n)&&!O1(a),isWindows:aK(i),isMacOs:oK(i),isMIUI:bK(n),isSamsungBrowser:_K(n)}}var RK=QG(Eo),MK=eK(Eo),OK=XG(Eo),q2e=tK(Eo),V2e=yK(js)||Rc(),G2e=pK(js),t8=JG(Eo)||Rc(),jK=YG(Eo),LK=ZG(Eo)||Rc(),DK=x4(Eo),K2e=x4(Eo),FK=sK(eh),UK=lK(eh),BK=cK(eh)||Rc(),Y2e=fK(js),Z2e=hK(js),J2e=mK(js),Q2e=vK(js),WK=wK(js),X2e=uK(eh),eve=dK(eh),tve=xK(js),rve=EK(js),nve=CK(js),ive=rK(Eo),sve=nK(Eo),ave=AK(z$),ove=SK(z$),lve=NK(Pv),cve=E4(js)||O1(Pv),uve=gK(js),dve=iK(Eo),fve=TK(),hve=Rc(),pve=$K(),gve=kK(),mve=IK(),yve=O1(Pv),vve=E4(js)&&!O1(Pv),wve=aK(eh),bve=oK(eh),_ve=bK(js),xve=_K(js),Eve=function(e){if(!e||typeof e!="string"){console.error("No valid user agent string was provided");return}var r=Rv(e),n=r.device,i=r.browser,s=r.os,a=r.engine,o=r.ua;return PK({device:n,browser:i,os:s,engine:a,ua:o})},Cve=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return FK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},Ave=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return DK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},Sve=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return WK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},Ive=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return BK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},Tve=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return t8?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},$ve=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return LK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},kve=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return UK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},Nve=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=ol(e,["renderWithFragment","children","viewClassName","style"]);return jK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},Pve=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return RK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},Rve=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return MK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},Mve=function(e){var r=e.renderWithFragment,n=e.children,i=ol(e,["renderWithFragment","children"]);return OK?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",i,n):null},Ove=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=e.condition,s=ol(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?r?An.createElement(Rs.Fragment,null,n):An.createElement("div",s,n):null};function jve(t){return function(e){T2e(r,e);function r(n){var i;return C2e(this,r),i=k2e(this,tS(r).call(this,n)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(h5(i)),i.onOrientationChange=i.onOrientationChange.bind(h5(i)),i.onPageLoad=i.onPageLoad.bind(h5(i)),i.state={isLandscape:!1,isPortrait:!1},i}return S2e(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":Hy(window))!==void 0&&t8&&(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 An.createElement(t,eS({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),r}(An.Component)}function Lve(){var t=Rs.useState(function(){var s=window.innerWidth>window.innerHeight?90:0;return{isPortrait:s===0,isLandscape:s===90,orientation:s===0?"portrait":"landscape"}}),e=N2e(t,2),r=e[0],n=e[1],i=Rs.useCallback(function(){var s=window.innerWidth>window.innerHeight?90:0,a={isPortrait:s===0,isLandscape:s===90,orientation:s===0?"portrait":"landscape"};r.orientation!==a.orientation&&n(a)},[r.orientation]);return Rs.useEffect(function(){return(typeof window>"u"?"undefined":Hy(window))!==void 0&&t8&&(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 zK(t){var e=t||window.navigator.userAgent;return Rv(e)}function Dve(t){var e=t||window.navigator.userAgent,r=zK(e),n=PK(r);return[n,r]}kt.AndroidView=Cve;kt.BrowserTypes=ja;kt.BrowserView=Ave;kt.ConsoleView=Rve;kt.CustomView=Ove;kt.IEView=Sve;kt.IOSView=Ive;kt.MobileOnlyView=Nve;kt.MobileView=Tve;kt.OsTypes=Ug;kt.SmartTVView=Pve;kt.TabletView=$ve;kt.WearableView=Mve;kt.WinPhoneView=kve;kt.browserName=nve;kt.browserVersion=rve;kt.deviceDetect=H2e;kt.deviceType=dve;kt.engineName=ave;kt.engineVersion=ove;kt.fullBrowserVersion=tve;kt.getSelectorsByUserAgent=Eve;kt.getUA=lve;var Fve=kt.isAndroid=FK;kt.isBrowser=DK;kt.isChrome=Y2e;kt.isChromium=G2e;kt.isConsole=MK;kt.isDesktop=K2e;kt.isEdge=cve;kt.isEdgeChromium=yve;kt.isElectron=mve;kt.isEmbedded=q2e;var Uve=kt.isFirefox=Z2e;kt.isIE=WK;var V$=kt.isIOS=BK;kt.isIOS13=fve;kt.isIPad13=hve;kt.isIPhone13=pve;kt.isIPod13=gve;kt.isLegacyEdge=vve;kt.isMIUI=_ve;kt.isMacOs=bve;var cs=kt.isMobile=t8;kt.isMobileOnly=jK;kt.isMobileSafari=V2e;kt.isOpera=Q2e;var Bve=kt.isSafari=J2e;kt.isSamsungBrowser=xve;kt.isSmartTV=RK;kt.isTablet=LK;kt.isWearable=OK;kt.isWinPhone=UK;kt.isWindows=wve;kt.isYandex=uve;kt.mobileModel=sve;kt.mobileVendor=ive;kt.osName=eve;kt.osVersion=X2e;kt.parseUserAgent=Rv;kt.setUserAgent=D2e;kt.useDeviceData=zK;kt.useDeviceSelectors=Dve;kt.useMobileOrientation=Lve;kt.withOrientationChange=jve;const Mv="abi/5.7.0",Br=new Pe(Mv),x0={};let Zj={calldata:!0,memory:!0,storage:!0},Wve={calldata:!0,memory:!0};function ob(t,e){if(t==="bytes"||t==="string"){if(Zj[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&Wve[e])return!0;return(Zj[e]||e==="payable")&&Br.throwArgumentError("invalid modifier","name",e),!1}function zve(t,e){let r=t;function n(o){Br.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 s={type:"",name:"",state:{allowType:!0}},a=s;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!==Yr.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===Yr.full?", ":",")+")"):r+=this.type,e!==Yr.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Yr.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?zi.fromString(e,r):zi.fromObject(e)}static fromObject(e){return zi.isParamType(e)?e:new zi(x0,{name:e.name||null,type:Qp(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(zi.fromObject):null})}static fromString(e,r){function n(i){return zi.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(zve(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function T2(t,e){return Vve(t).map(r=>zi.fromString(r,e))}class nd{constructor(e,r){e!==x0&&Br.throwError("use a static from method",Pe.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),p5(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return nd.isFragment(e)?e:typeof e=="string"?nd.fromString(e):nd.fromObject(e)}static fromObject(e){if(nd.isFragment(e))return e;switch(e.type){case"function":return Oc.fromObject(e);case"event":return Xu.fromObject(e);case"constructor":return Mc.fromObject(e);case"error":return df.fromObject(e);case"fallback":case"receive":return null}return Br.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"?Xu.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Oc.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Mc.fromString(e.trim()):e.split(" ")[0]==="error"?df.fromString(e.substring(5).trim()):Br.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Xu extends nd{format(e){if(e||(e=Yr.sighash),Yr[e]||Br.throwArgumentError("invalid format type","format",e),e===Yr.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!==Yr.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Yr.full?", ":",")+") ",e!==Yr.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Xu.fromString(e):Xu.fromObject(e)}static fromObject(e){if(Xu.isEventFragment(e))return e;e.type!=="event"&&Br.throwArgumentError("invalid event object","value",e);const r={name:$2(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(zi.fromObject):[],type:"event"};return new Xu(x0,r)}static fromString(e){let r=e.match(k2);r||Br.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:Br.warn("unknown modifier: "+i)}}),Xu.fromObject({name:r[1].trim(),anonymous:n,inputs:T2(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function HK(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Br.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Br.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=nt.from(r[1]),r[0]):t}function qK(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 VK(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&&Br.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Br.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"&&Br.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&&Br.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"&&Br.throwArgumentError("unable to determine stateMutability","value",t),e}class Mc extends nd{format(e){if(e||(e=Yr.sighash),Yr[e]||Br.throwArgumentError("invalid format type","format",e),e===Yr.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===Yr.sighash&&Br.throwError("cannot format a constructor for sighash",Pe.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===Yr.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Mc.fromString(e):Mc.fromObject(e)}static fromObject(e){if(Mc.isConstructorFragment(e))return e;e.type!=="constructor"&&Br.throwArgumentError("invalid constructor object","value",e);let r=VK(e);r.constant&&Br.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(zi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new Mc(x0,n)}static fromString(e){let r={type:"constructor"};e=HK(e,r);let n=e.match(k2);return(!n||n[1].trim()!=="constructor")&&Br.throwArgumentError("invalid constructor string","value",e),r.inputs=T2(n[2].trim(),!1),qK(n[3].trim(),r),Mc.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Oc extends Mc{format(e){if(e||(e=Yr.sighash),Yr[e]||Br.throwArgumentError("invalid format type","format",e),e===Yr.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!==Yr.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Yr.full?", ":",")+") ",e!==Yr.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"?Oc.fromString(e):Oc.fromObject(e)}static fromObject(e){if(Oc.isFunctionFragment(e))return e;e.type!=="function"&&Br.throwArgumentError("invalid function object","value",e);let r=VK(e);const n={type:e.type,name:$2(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(zi.fromObject):[],outputs:e.outputs?e.outputs.map(zi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new Oc(x0,n)}static fromString(e){let r={type:"function"};e=HK(e,r);let n=e.split(" returns ");n.length>2&&Br.throwArgumentError("invalid function string","value",e);let i=n[0].match(k2);if(i||Br.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&$2(r.name),r.inputs=T2(i[2],!1),qK(i[3].trim(),r),n.length>1){let s=n[1].match(k2);(s[1].trim()!=""||s[3].trim()!="")&&Br.throwArgumentError("unexpected tokens","value",e),r.outputs=T2(s[2],!1)}else r.outputs=[];return Oc.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function Jj(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Br.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class df extends nd{format(e){if(e||(e=Yr.sighash),Yr[e]||Br.throwArgumentError("invalid format type","format",e),e===Yr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Yr.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Yr.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?df.fromString(e):df.fromObject(e)}static fromObject(e){if(df.isErrorFragment(e))return e;e.type!=="error"&&Br.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:$2(e.name),inputs:e.inputs?e.inputs.map(zi.fromObject):[]};return Jj(new df(x0,r))}static fromString(e){let r={type:"error"},n=e.match(k2);return n||Br.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&$2(r.name),r.inputs=T2(n[2],!1),Jj(df.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Qp(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const qve=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function $2(t){return(!t||!t.match(qve))&&Br.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const k2=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Vve(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&G$.throwError("value out-of-bounds",Pe.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Ta([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 C4{constructor(e,r,n,i){at(this,"_data",er(e)),at(this,"wordSize",r||32),at(this,"_coerceFunc",n),at(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):C4.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:G$.throwError("data out-of-bounds",Pe.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new C4(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 Kve extends kd{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(Dn(e.readValue().toHexString(),20))}}class Yve extends kd{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 v1=new Pe(Mv);function GK(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||v1.throwError("cannot encode object for signature with missing names",Pe.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]&&v1.throwError("cannot encode object for signature with duplicate names",Pe.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]=!0,r[u]})}else v1.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&v1.throwArgumentError("types/value length mismatch","tuple",r);let i=new nS(t.wordSize),s=new nS(t.wordSize),a=[];e.forEach((l,c)=>{let u=n[c];if(l.dynamic){let f=s.length;l.encode(s,u);let h=i.writeUpdatableValue();a.push(g=>{h(g+f)})}else l.encode(i,u)}),a.forEach(l=>{l(i.length)});let o=t.appendWriter(i);return o+=t.appendWriter(s),o}function KK(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let a=null;if(s.dynamic){let o=t.readValue(),l=n.subReader(o.toNumber());try{a=s.decode(l)}catch(c){if(c.code===Pe.errors.BUFFER_OVERRUN)throw c;a=c,a.baseType=s.name,a.name=s.localName,a.type=s.type}}else try{a=s.decode(t)}catch(o){if(o.code===Pe.errors.BUFFER_OVERRUN)throw o;a=o,a.baseType=s.name,a.name=s.localName,a.type=s.type}a!=null&&r.push(a)});const i=e.reduce((s,a)=>{const o=a.localName;return o&&(s[o]||(s[o]=0),s[o]++),s},{});e.forEach((s,a)=>{let o=s.localName;if(!o||i[o]!==1||(o==="length"&&(o="_length"),r[o]!=null))return;const l=r[a];l instanceof Error?Object.defineProperty(r,o,{enumerable:!0,get:()=>{throw l}}):r[o]=l});for(let s=0;s{throw a}})}return Object.freeze(r)}class Zve extends kd{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&v1.throwError("insufficient data length",Pe.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i{a.dynamic&&(n=!0),i.push(a.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return GK(e,this.coders,r)}decode(e){return e.coerce(this.name,KK(e,this.coders))}}const cb=new Pe(Mv),nwe=new RegExp(/^bytes([0-9]*)$/),iwe=new RegExp(/^(u?int)([0-9]*)$/);class swe{constructor(e){at(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Kve(e.name);case"bool":return new Jve(e.name);case"string":return new rwe(e.name);case"bytes":return new Qve(e.name);case"array":return new Zve(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new lb((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new ewe(e.name)}let r=e.type.match(iwe);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&cb.throwArgumentError("invalid "+r[1]+" bit length","param",e),new twe(n/8,r[1]==="int",e.name)}if(r=e.type.match(nwe),r){let n=parseInt(r[1]);return(n===0||n>32)&&cb.throwArgumentError("invalid bytes length","param",e),new Xve(n,e.name)}return cb.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new C4(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new nS(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(zi.from(i)));return new lb(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&cb.throwError("types/values length mismatch",Pe.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(a=>this._getCoder(zi.from(a))),i=new lb(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(a=>this._getCoder(zi.from(a)));return new lb(i,"_").decode(this._getReader(er(r),n))}}const awe=new swe,Bn=new Pe(Mv);class owe extends Tv{}class lwe extends Tv{}class cwe extends Tv{}class iS extends Tv{static isIndexed(e){return!!(e&&e._isIndexed)}}const uwe={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Qj(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class Xj{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,at(this,"fragments",r.map(n=>nd.from(n)).filter(n=>n!=null)),at(this,"_abiCoder",Dc(new.target,"getAbiCoder")()),at(this,"functions",{}),at(this,"errors",{}),at(this,"events",{}),at(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Bn.warn("duplicate definition - constructor");return}at(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 s=n.format();if(i[s]){Bn.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||at(this,"deploy",Mc.from({payable:!1,type:"constructor"})),at(this,"_isInterface",!0)}format(e){e||(e=Yr.full),e===Yr.sighash&&Bn.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===Yr.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return awe}static getAddress(e){return Ir(e)}static getSighash(e){return Es(y1(e.format()),0,4)}static getEventTopic(e){return y1(e.format())}getFunction(e){if(Vr(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Bn.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?Bn.throwArgumentError("no matching function","name",n):i.length>1&&Bn.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Oc.fromString(e).format()];return r||Bn.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(Vr(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Bn.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?Bn.throwArgumentError("no matching event","name",n):i.length>1&&Bn.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Xu.fromString(e).format()];return r||Bn.throwArgumentError("no matching event","signature",e),r}getError(e){if(Vr(e)){const n=Dc(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}Bn.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?Bn.throwArgumentError("no matching error","name",n):i.length>1&&Bn.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Oc.fromString(e).format()];return r||Bn.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 Dc(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Dc(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)&&Bn.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(Ta([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)&&Bn.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(Ta([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=er(r),i=null,s="",a=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=uwe[c];if(u)a=this._abiCoder.decode(u.inputs,n.slice(4)),o=u.name,l=u.signature,u.reason&&(i=a[0]),o==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(a[0])}`:o==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${a[0]}`);else try{const f=this.getError(c);a=this._abiCoder.decode(f.inputs,n.slice(4)),o=f.name,l=f.format()}catch{}break}}return Bn.throwError("call revert exception"+s,Pe.errors.CALL_EXCEPTION,{method:e.format(),data:Bt(r),errorArgs:a,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&&Bn.throwError("too many arguments for "+e.format(),Pe.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,a)=>s.type==="string"?y1(a):s.type==="bytes"?yi(Bt(a)):(s.type==="bool"&&typeof a=="boolean"&&(a=a?"0x01":"0x00"),s.type.match(/^u?int/)&&(a=nt.from(a).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[a]),Dn(Bt(a),32));for(r.forEach((s,a)=>{let o=e.inputs[a];if(!o.indexed){s!=null&&Bn.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,s);return}s==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?Bn.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,s):Array.isArray(s)?n.push(s.map(l=>i(o,l))):n.push(i(o,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Bn.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((a,o)=>{const l=r[o];if(a.indexed)if(a.type==="string")n.push(y1(l));else if(a.type==="bytes")n.push(yi(l));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([a.type],[l]))}else i.push(a),s.push(l)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let h=this.getEventTopic(e);(!Vr(n[0],32)||n[0].toLowerCase()!==h)&&Bn.throwError("fragment/topic mismatch",Pe.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:h,value:n[0]}),n=n.slice(1)}let i=[],s=[],a=[];e.inputs.forEach((h,g)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(i.push(zi.fromObject({type:"bytes32",name:h.name})),a.push(!0)):(i.push(h),a.push(!1)):(s.push(h),a.push(!1))});let o=n!=null?this._abiCoder.decode(i,Ta(n)):null,l=this._abiCoder.decode(s,r,!0),c=[],u=0,f=0;e.inputs.forEach((h,g)=>{if(h.indexed)if(o==null)c[g]=new iS({_isIndexed:!0,hash:null});else if(a[g])c[g]=new iS({_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 Qj(`property ${JSON.stringify(h.name)}`,m)}}):c[h.name]=m}});for(let h=0;h{throw Qj(`index ${h}`,g)}})}return Object.freeze(c)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new lwe({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 owe({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 cwe({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 dwe="contracts/5.7.0";var E0=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const oi=new Pe(dwe);function A4(t,e){return E0(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&oi.throwArgumentError("invalid address or ENS name","name",r);try{return Ir(r)}catch{}t||oi.throwError("a provider or signer is needed to resolve ENS names",Pe.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&oi.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function g5(t,e,r){return E0(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>g5(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield A4(t,e):r.type==="tuple"?yield g5(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>g5(t,n,r.arrayChildren))):Promise.reject(oi.makeError("invalid value for array",Pe.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function r8(t,e,r){return E0(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Ti(r.pop())),oi.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=hi({override:A4(t.signer,n.from),signer:t.signer.getAddress()}).then(c=>E0(this,void 0,void 0,function*(){return Ir(c.signer)!==c.override&&oi.throwError("Contract with a Signer cannot override from",Pe.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),c.override})):n.from=t.signer.getAddress():n.from&&(n.from=A4(t.provider,n.from));const i=yield hi({args:g5(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:hi(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),a={data:s,to:i.address},o=i.overrides;if(o.nonce!=null&&(a.nonce=nt.from(o.nonce).toNumber()),o.gasLimit!=null&&(a.gasLimit=nt.from(o.gasLimit)),o.gasPrice!=null&&(a.gasPrice=nt.from(o.gasPrice)),o.maxFeePerGas!=null&&(a.maxFeePerGas=nt.from(o.maxFeePerGas)),o.maxPriorityFeePerGas!=null&&(a.maxPriorityFeePerGas=nt.from(o.maxPriorityFeePerGas)),o.from!=null&&(a.from=o.from),o.type!=null&&(a.type=o.type),o.accessList!=null&&(a.accessList=Fg(o.accessList)),a.gasLimit==null&&e.gas!=null){let c=21e3;const u=er(s);for(let f=0;fn[c]!=null);return l.length&&oi.throwError(`cannot override ${l.map(c=>JSON.stringify(c)).join(",")}`,Pe.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),a})}function fwe(t,e){return function(...r){return r8(t,e,r)}}function hwe(t,e){const r=t.signer||t.provider;return function(...n){return E0(this,void 0,void 0,function*(){r||oi.throwError("estimate require a provider or signer",Pe.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield r8(t,e,n);return yield r.estimateGas(i)})}}function pwe(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let a=pd(s),o=null;try{o=t.interface.parseLog(s)}catch{}return o&&(a.args=o.args,a.decode=(l,c)=>t.interface.decodeEventLog(o.eventFragment,l,c),a.event=o.name,a.eventSignature=o.signature),a.removeListener=()=>t.provider,a.getBlock=()=>t.provider.getBlock(i.blockHash),a.getTransaction=()=>t.provider.getTransaction(i.transactionHash),a.getTransactionReceipt=()=>Promise.resolve(i),a}),i))}function ZK(t,e,r){const n=t.signer||t.provider;return function(...i){return E0(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=Ti(i.pop());l.blockTag!=null&&(s=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(s));const a=yield r8(t,e,i),o=yield n.call(a,s);try{let l=t.interface.decodeFunctionResult(e,o);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===Pe.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=a),l}})}}function gwe(t,e){return function(...r){return E0(this,void 0,void 0,function*(){t.signer||oi.throwError("sending a transaction requires a signer",Pe.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield r8(t,e,r),i=yield t.signer.sendTransaction(n);return pwe(t,i),i})}}function eL(t,e,r){return e.constant?ZK(t,e,r):gwe(t,e)}function JK(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 N2{constructor(e,r){at(this,"tag",e),at(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 mwe extends N2{constructor(){super("error",null)}}class tL extends N2{constructor(e,r,n,i){const s={address:e};let a=r.getEventTopic(n);i?(a!==i[0]&&oi.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[a],super(JK(s),s),at(this,"address",e),at(this,"interface",r),at(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=Gve(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class rL extends N2{constructor(e,r){super("*",{address:e}),at(this,"address",e),at(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 ywe{constructor(e,r,n){at(this,"interface",Dc(new.target,"getInterface")(r)),n==null?(at(this,"provider",null),at(this,"signer",null)):Nv.isSigner(n)?(at(this,"provider",n.provider||null),at(this,"signer",n)):K6.isProvider(n)?(at(this,"provider",n),at(this,"signer",null)):oi.throwArgumentError("invalid signer or provider","signerOrProvider",n),at(this,"callStatic",{}),at(this,"estimateGas",{}),at(this,"functions",{}),at(this,"populateTransaction",{}),at(this,"filters",{});{const a={};Object.keys(this.interface.events).forEach(o=>{const l=this.interface.events[o];at(this.filters,o,(...c)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,c)})),a[l.name]||(a[l.name]=[]),a[l.name].push(o)}),Object.keys(a).forEach(o=>{const l=a[o];l.length===1?at(this.filters,o,this.filters[l[0]]):oi.warn(`Duplicate definition of ${o} (${l.join(", ")})`)})}if(at(this,"_runningEvents",{}),at(this,"_wrappedEmits",{}),e==null&&oi.throwArgumentError("invalid contract address or ENS name","addressOrName",e),at(this,"address",e),this.provider)at(this,"resolvedAddress",A4(this.provider,e));else try{at(this,"resolvedAddress",Promise.resolve(Ir(e)))}catch{oi.throwError("provider is required to use ENS name as contract address",Pe.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(a=>{});const i={},s={};Object.keys(this.interface.functions).forEach(a=>{const o=this.interface.functions[a];if(s[a]){oi.warn(`Duplicate ABI entry for ${JSON.stringify(a)}`);return}s[a]=!0;{const l=o.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(a)}this[a]==null&&at(this,a,eL(this,o,!0)),this.functions[a]==null&&at(this.functions,a,eL(this,o,!1)),this.callStatic[a]==null&&at(this.callStatic,a,ZK(this,o,!0)),this.populateTransaction[a]==null&&at(this.populateTransaction,a,fwe(this,o)),this.estimateGas[a]==null&&at(this.estimateGas,a,hwe(this,o))}),Object.keys(i).forEach(a=>{const o=i[a];if(o.length>1)return;a=a.substring(1);const l=o[0];try{this[a]==null&&at(this,a,this[l])}catch{}this.functions[a]==null&&at(this.functions,a,this.functions[l]),this.callStatic[a]==null&&at(this.callStatic,a,this.callStatic[l]),this.populateTransaction[a]==null&&at(this.populateTransaction,a,this.populateTransaction[l]),this.estimateGas[a]==null&&at(this.estimateGas,a,this.estimateGas[l])})}static getContractAddress(e){return VV(e)}static getInterface(e){return Xj.isInterface(e)?e:new Xj(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"&&oi.throwError("contract not deployed",Pe.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||oi.throwError("sending a transactions require a signer",Pe.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Ti(e||{});return["from","to"].forEach(function(n){r[n]!=null&&oi.throwError("cannot override "+n,Pe.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new e8(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&at(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return iS.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 mwe);if(e==="event")return this._normalizeRunningEvent(new N2("event",null));if(e==="*")return this._normalizeRunningEvent(new rL(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new tL(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 tL(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new N2(JK(r),r))}return this._normalizeRunningEvent(new rL(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=pd(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||oi.throwError("events require a provider or a signer with a provider",Pe.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let a=this._wrapEvent(e,s,r);if(a.decodeError==null)try{const o=e.getEmit(a);this.emit(e.filter,...o)}catch(o){a.decodeError=o.error}e.filter!=null&&this.emit("event",a),a.decodeError!=null&&this.emit("error",a.decodeError,a)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=Ti(i.filter);return typeof r=="string"&&Vr(r,32)?(n!=null&&oi.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(a=>a.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 vwe extends ywe{}const wwe="units/5.7.0",bwe=new Pe(wwe),_we=["wei","kwei","mwei","gwei","szabo","finney","ether"];function xwe(t,e){return l5(t,e)}function nL(t,e){if(typeof t!="string"&&bwe.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=_we.indexOf(e);r!==-1&&(e=3*r)}return xc(t,e??18)}function QK(t){return xwe(t,18)}function sS(t){"@babel/helpers - typeof";return sS=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},sS(t)}function Ewe(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}function Cwe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Awe(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&&P2(t,e)}function Swe(t){var e=eY();return function(){var n=R2(t),i;if(e){var s=R2(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return Iwe(this,i)}}function Iwe(t,e){if(e&&(sS(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XK(t)}function XK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aS(t){var e=typeof Map=="function"?new Map:void 0;return aS=function(n){if(n===null||!Twe(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 m5(n,arguments,R2(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),P2(i,n)},aS(t)}function m5(t,e,r){return eY()?m5=Reflect.construct:m5=function(i,s,a){var o=[null];o.push.apply(o,s);var l=Function.bind.apply(i,o),c=new l;return a&&P2(c,a.prototype),c},m5.apply(null,arguments)}function eY(){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 Twe(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function P2(t,e){return P2=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},P2(t,e)}function R2(t){return R2=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},R2(t)}var Gu=function(t){Awe(r,t);var e=Swe(r);function r(n){var i;return Cwe(this,r),i=e.call(this,n),Object.setPrototypeOf(XK(i),r.prototype),i.name=i.constructor.name,i}return Ewe(r)}(aS(Error)),K$=2,$we=17,kwe=3,ea="0-90-9٠-٩۰-۹",Nwe="-‐-―−ー-",Pwe="//",Rwe="..",Mwe="  ­​⁠ ",Owe="()()[]\\[\\]",jwe="~⁓∼~",Hl="".concat(Nwe).concat(Pwe).concat(Rwe).concat(Mwe).concat(Owe).concat(jwe),n8="++";function iL(t,e){t=t.split("-"),e=e.split("-");for(var r=t[0].split("."),n=e[0].split("."),i=0;i<3;i++){var s=Number(r[i]),a=Number(n[i]);if(s>a)return 1;if(a>s)return-1;if(!isNaN(s)&&isNaN(a))return 1;if(isNaN(s)&&!isNaN(a))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]=K$&&Xwe.test(t)}function t3e(t){return Jwe.test(t)}var lL=new RegExp("(?:"+rY()+")$","i");function r3e(t){var e=t.search(lL);if(e<0)return{};for(var r=t.slice(0,e),n=t.match(lL),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 i3e(t,e){if(t){if(typeof t=="string")return cL(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 cL(t,e)}}function cL(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 o3e(t,e){if(t){if(typeof t=="string")return uL(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 uL(t,e)}}function uL(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rs?"TOO_SHORT":i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function u3e(t,e,r){if(e===void 0&&(e={}),r=new Xi(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 iY(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 iY(t,e){switch(o8(t,e)){case"IS_POSSIBLE":return!0;default:return!1}}function yd(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function d3e(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=f3e(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 f3e(t,e){if(t){if(typeof t=="string")return fL(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 fL(t,e)}}function fL(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0}function sY(t){return t.replace(new RegExp("[".concat(Hl,"]+"),"g")," ").trim()}var aY=/(\$\d)/;function oY(t,e,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var s=t.replace(new RegExp(e.pattern()),n?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(aY,e.nationalPrefixFormattingRule()):e.format());return n?sY(s):s}var y3e=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function v3e(t,e,r){var n=new Xi(r);if(n.selectNumberingPlan(t,e),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(y3e.test(n.IDDPrefix()))return n.IDDPrefix()}function w3e(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 b3e(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=_3e(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 _3e(t,e){if(t){if(typeof t=="string")return hL(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 hL(t,e)}}function hL(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){var s=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(e.search(s)!==0)continue}if(yd(e,i.pattern()))return i}}function U9(t,e,r,n){return e?n(t,e,r):t}function A3e(t,e,r,n,i){var s=a8(n,i.metadata);if(s===r){var a=I4(t,e,"NATIONAL",i);return r==="1"?r+" "+a:a}var o=v3e(n,void 0,i.metadata);if(o)return"".concat(o," ").concat(r," ").concat(I4(t,null,"INTERNATIONAL",i))}function yL(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 vL(t){for(var e=1;e0&&a[1]==="0"))return t}}}function lS(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(t);if(n){var i,s,a=n.length-1,o=a>0&&n[a];if(e.nationalPrefixTransformRule()&&o)i=t.replace(r,e.nationalPrefixTransformRule()),a>1&&(s=n[1]);else{var l=n[0];i=t.slice(l.length),o&&(s=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:s}}}return{nationalNumber:t}}function cS(t,e){var r=lS(t,e),n=r.carrierCode,i=r.nationalNumber;if(i!==t){if(!R3e(t,i,e))return{nationalNumber:t};if(e.possibleLengths()&&!M3e(i,e))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:n}}function R3e(t,e,r){return!(yd(t,r.nationalNumberPattern())&&!yd(e,r.nationalNumberPattern()))}function M3e(t,e){switch(o8(t,e)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function cY(t,e,r,n){var i=e?a8(e,n):r;if(t.indexOf(i)===0){n=new Xi(n),n.selectNumberingPlan(e,r);var s=t.slice(i.length),a=cS(s,n),o=a.nationalNumber,l=cS(t,n),c=l.nationalNumber;if(!yd(c,n.nationalNumberPattern())&&yd(o,n.nationalNumberPattern())||o8(c,n)==="TOO_LONG")return{countryCallingCode:i,number:s}}return{number:t}}function uY(t,e,r,n){if(!t)return{};var i;if(t[0]!=="+"){var s=lY(t,e,r,n);if(s&&s!==t)i=!0,t="+"+s;else{if(e||r){var a=cY(t,e,r,n),o=a.countryCallingCode,l=a.number;if(o)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:o,number:l}}return{number:t}}}if(t[1]==="0")return{};n=new Xi(n);for(var c=2;c-1<=kwe&&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 O3e(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=j3e(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 j3e(t,e){if(t){if(typeof t=="string")return wL(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 wL(t,e)}}function wL(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 G3e(t){return t===null?!0:t.length===0?!1:F3e.test(t)||H3e.test(t)}function K3e(t,e){var r=e.extractFormattedPhoneNumber,n=V3e(t);if(!G3e(n))throw new Gu("NOT_A_NUMBER");var i;if(n===null)i=r(t)||"";else{i="",n.charAt(0)===hY&&(i+=n);var s=t.indexOf(_L),a;s>=0?a=s+_L.length:a=0;var o=t.indexOf(dS);i+=t.substring(a,o)}var l=i.indexOf(q3e);if(l>0&&(i=i.substring(0,l)),i!=="")return i}var Y3e=250,Z3e=new RegExp("["+n8+ea+"]"),J3e=new RegExp("[^"+ea+"#]+$");function Q3e(t,e,r){if(e=e||{},r=new Xi(r),e.defaultCountry&&!r.hasCountry(e.defaultCountry))throw e.v2?new Gu("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var n=ebe(t,e.v2,e.extract),i=n.number,s=n.ext,a=n.error;if(!i){if(e.v2)throw a==="TOO_SHORT"?new Gu("TOO_SHORT"):new Gu("NOT_A_NUMBER");return{}}var o=rbe(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 Gu("INVALID_COUNTRY");return{}}if(!c||c.length$we){if(e.v2)throw new Gu("TOO_LONG");return{}}if(e.v2){var g=new Z$(u,c,r.metadata);return l&&(g.country=l),h&&(g.carrierCode=h),s&&(g.ext=s),g.__countryCallingCodeSource=f,g}var m=(e.extended?r.hasSelectedNumberingPlan():l)?yd(c,r.nationalNumberPattern()):!1;return e.extended?{country:l,countryCallingCode:u,carrierCode:h,valid:m,possible:m?!0:!!(e.extended===!0&&r.possibleLengths()&&iY(c,r)),phone:c,ext:s}:m?tbe(l,c,s):{}}function X3e(t,e,r){if(t){if(t.length>Y3e){if(r)throw new Gu("TOO_LONG");return}if(e===!1)return t;var n=t.search(Z3e);if(!(n<0))return t.slice(n).replace(J3e,"")}}function ebe(t,e,r){var n=K3e(t,{extractFormattedPhoneNumber:function(a){return X3e(a,r,e)}});if(!n)return{};if(!e3e(n))return t3e(n)?{error:"TOO_SHORT"}:{};var i=r3e(n);return i.ext?i:{number:n}}function tbe(t,e,r){var n={country:t,phone:e};return r&&(n.ext=r),n}function rbe(t,e,r,n){var i=uY(dL(t),e,r,n.metadata),s=i.countryCallingCodeSource,a=i.countryCallingCode,o=i.number,l;if(a)n.selectNumberingPlan(a);else if(o&&(e||r))n.selectNumberingPlan(e,r),e&&(l=e),a=r||a8(e,n.metadata);else return{};if(!o)return{countryCallingCodeSource:s,countryCallingCode:a};var c=cS(dL(o),n),u=c.nationalNumber,f=c.carrierCode,h=fY(a,{nationalNumber:u,defaultCountry:e,metadata:n});return h&&(l=h,h==="001"||n.country(l)),{country:l,countryCallingCode:a,countryCallingCodeSource:s,nationalNumber:u,carrierCode:f}}function xL(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 EL(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 xbe(t,e){if(t){if(typeof t=="string")return kL(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 kL(t,e)}}function kL(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 NL(t,e){return t[e]===")"&&e++,Ebe(t.slice(0,e))}function Ebe(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 jbe(t,e){if(t){if(typeof t=="string")return ML(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 ML(t,e)}}function ML(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 s=fS(r.split(""),this.matchTree,!0);if(s&&s.match&&delete s.matchedChars,!(s&&s.overflow&&!i))return s}}]),t}();function fS(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(),s=0;s=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 Bbe(t,e){if(t){if(typeof t=="string")return jL(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 jL(t,e)}}function jL(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()&&Gbe.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var i=r.IDDPrefix,s=r.missingPlus;return i?n&&n.spacing===!1?i:i+" ":s?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,i=0,s=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";ic.length)){var u=new RegExp("^"+l+"$"),f=i.replace(/\d/g,hS);u.test(f)&&(c=f);var h=this.getFormatFormat(r,s),g;if(this.shouldTryNationalPrefixFormattingRule(r,{international:s,nationalPrefix:a})){var m=h.replace(aY,r.nationalPrefixFormattingRule());if(S4(r.nationalPrefixFormattingRule())===(a||"")+S4("$1")&&(h=m,g=!0,a))for(var w=a.length;w>0;)h=h.replace(/\d/,$l),w--}var E=c.replace(new RegExp(l),h).replace(new RegExp(hS,"g"),$l);return g||(o?E=y5($l,o.length)+" "+E:a&&(E=y5($l,a.length)+this.getSeparatorAfterNationalPrefix(r)+E)),s&&(E=sY(E)),E}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=Cbe(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],NL(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var i=n.international,s=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var a=r.usesNationalPrefix();if(a&&s||!a&&!i)return!0}}}]),t}();function pY(t,e){return t5e(t)||e5e(t,e)||Xbe(t,e)||Qbe()}function Qbe(){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 Xbe(t,e){if(t){if(typeof t=="string")return DL(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 DL(t,e)}}function DL(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=3;if(n.appendDigits(r),s&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(a){return n.update(a)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,i=r.callingCode;return n&&!i}},{key:"extractCountryCallingCode",value:function(r){var n=uY("+"+r.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode,s=n.number;if(i)return r.setCallingCode(i),r.update({nationalSignificantNumber:s}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&c5e.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var i=lS(r,this.metadata),s=i.nationalPrefix,a=i.nationalNumber,o=i.carrierCode;if(a!==r)return this.onExtractedNationalNumber(s,o,a,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var s=lS(r,this.metadata),a=s.nationalPrefix,o=s.nationalNumber,l=s.carrierCode;if(o!==n)return this.onExtractedNationalNumber(a,l,o,r,i),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,i,s,a){var o,l,c=s.lastIndexOf(i);if(c>=0&&c===s.length-i.length){l=!0;var u=s.slice(0,c);u!==r&&(o=u)}a({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,s=r.digits;if(r.nationalSignificantNumber,!(n||i)){var a=lY(s,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(a!==void 0&&a!==s)return r.update({IDDPrefix:s.slice(0,s.length-a.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=cY(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,s=n.callingCode;r.startInternationalNumber(i,s),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 d5e(t){var e=t.search(o5e);if(!(e<0)){t=t.slice(e);var r;return t[0]==="+"&&(r=!0,t=t.slice(1)),t=t.replace(l5e,""),r&&(t="+"+t),t}}function f5e(t){var e=d5e(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function h5e(t){var e=f5e(t),r=pY(e,2),n=r[0],i=r[1];return a5e.test(n)||(n=""),[n,i]}function p5e(t,e){return v5e(t)||y5e(t,e)||m5e(t,e)||g5e()}function g5e(){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 m5e(t,e){if(t){if(typeof t=="string")return FL(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 FL(t,e)}}function FL(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(fY(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,s=r.country,a=r.nationalSignificantNumber;if(n){if(this.isInternational())return i?"+"+i+a:"+"+n;if(s||i){var o=s?this.metadata.countryCallingCode():i;return"+"+o+a}}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.carrierCode,s=r.callingCode,a=this._getCountry();if(n&&!(!a&&!s)){if(a&&a===this.defaultCountry){var o=new Xi(this.metadata.metadata);o.selectNumberingPlan(a);var l=o.numberingPlan.callingCode(),c=this.metadata.getCountryCodesForCallingCode(l);if(c.length>1){var u=dY(n,{countries:c,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});u&&(a=u)}}var f=new Z$(a||s,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 x5e(t){return new Xi(t).getCountries()}function E5e(t,e,r){if(e[t])return new Z$(t,e[t],r)}const C5e={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"}}},A5e={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},S5e={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},I5e={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"}}},T5e={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},$5e={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},k5e={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"}}},N5e={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},P5e={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},mY={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"}}},yY={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},R5e={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"}}},M5e={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},O5e={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 ma;(ma={}).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",ma.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",ma.INVALID_DATA="invalid_data",ma.LINKED_TO_ANOTHER_USER="linked_to_another_user",ma.ALLOWLIST_REJECTED="allowlist_rejected",ma.OAUTH_USER_DENIED="oauth_user_denied",ma.UNKNOWN_AUTH_ERROR="unknown_auth_error",ma.USER_EXITED_AUTH_FLOW="exited_auth_flow",ma.MUST_BE_AUTHENTICATED="must_be_authenticated",ma.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",ma.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",ma.CLIENT_REQUEST_TIMEOUT="client_request_timeout",ma.INVALID_CREDENTIALS="invalid_credentials";let j5e=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}},L5e=class extends j5e{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 z9=class extends L5e{constructor(e){var n,i,s;super(e.message,e.code,e.data);let r=Object.values(qi).find(a=>a.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:(s=e.message)!=null&&s.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=qi.E32002_WALLET_LOCKED))}};const qs=t=>nt.from(t);function pS(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 D5e(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=qs(t.nonce).toNumber()),t.gasLimit!==void 0&&(e.gasLimit=qs(t.gasLimit)),t.gasPrice!==void 0&&(e.gasPrice=qs(t.gasPrice)),t.value!==void 0&&(e.value=qs(t.value)),t.maxFeePerGas!==void 0&&(e.maxFeePerGas=qs(t.maxFeePerGas)),t.maxPriorityFeePerGas!==void 0&&(e.maxPriorityFeePerGas=qs(t.maxPriorityFeePerGas)),e}const vY=t=>[C5e.id,A5e.id,S5e.id].includes(t),F5e=async(t,e)=>{if(!vY(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=pS(n),t.maxPriorityFeePerGas=pS(nt.from(0))}}catch(r){throw Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return t},wY=t=>[56,97].includes(t),U5e=async(t,e)=>{var r;if(!wY(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},B5e=["function getL1Fee(bytes memory _data) external view returns (uint256)"],l8=t=>[I5e.id,T5e.id,$5e.id,k5e.id,N5e.id,P5e.id,R5e.id,O5e.id,M5e.id,81457,168587773].includes(t),W5e=async(t,e)=>{if(!l8(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=pS(n)}}catch(r){throw Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return t};async function z5e(t,e){if(!t.chainId||t.chainId&&!l8(t.chainId))return nt.from(0);let r=nt.from(0);try{let n=new vwe("0x420000000000000000000000000000000000000F",B5e,e),i=D5e(t),s=Gye(i);r=await n.getL1Fee(s)}catch{}return r}var bY={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Xt,function(){var r=function(s,a){if(a=a||{},typeof s!="function")throw new i("fetch must be a function");if(typeof a!="object")throw new i("defaults must be an object");if(a.retries!==void 0&&!n(a.retries))throw new i("retries must be a positive integer");if(a.retryDelay!==void 0&&!n(a.retryDelay)&&typeof a.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(a.retryOn!==void 0&&!Array.isArray(a.retryOn)&&typeof a.retryOn!="function")throw new i("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return a=Object.assign(o,a),function(c,u){var f=a.retries,h=a.retryDelay,g=a.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 E=function(_){var A=typeof Request<"u"&&c instanceof Request?c.clone():c;s(A,u).then(function(C){if(Array.isArray(g)&&g.indexOf(C.status)===-1)m(C);else if(typeof g=="function")try{return Promise.resolve(g(_,null,C)).then(function(R){R?v(_,null,C):m(C)}).catch(w)}catch(R){w(R)}else _=0}function i(s){this.name="ArgumentError",this.message=s}return r})})(bY);var H5e=bY.exports;const q5e=wo(H5e),_Y={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 V5e=q5e(fetch,{retries:3,retryDelay:500});const xY=t=>[mY.id,yY.id,_Y.id].includes(t);let H9=t=>({maxPriorityFee:nL(t.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:nL(t.maxFee.toFixed(9),"gwei").toHexString()}),G5e=t=>({safeLow:H9(t.safeLow),standard:H9(t.standard),fast:H9(t.fast)});const K5e=async t=>{let e="";switch(t){case mY.id:e="https://gasstation.polygon.technology/v2";break;case yY.id:e="https://gasstation-testnet.polygon.technology/v2";break;case _Y.id:e="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${t} does not support polygon gas stations`)}let r=await V5e(e),n=await r.json();if(r.status>399)throw n;return G5e(n)};async function Y5e(t){if(!xY(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 K5e(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 Z5e=async(t,e)=>{var r,n,i;if(t.type===void 0&&(t.type=2),t.type===2){if(!t.maxFeePerGas||!t.maxPriorityFeePerGas){let s=await e.getFeeData();t.maxFeePerGas||(t.maxFeePerGas=(r=s.maxFeePerGas)==null?void 0:r.toHexString()),t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=(n=s.maxPriorityFeePerGas)==null?void 0:n.toHexString())}}else if(!t.gasPrice){let s=await e.getFeeData();t.gasPrice=(i=s.gasPrice)==null?void 0:i.toHexString()}return t};async function J$(t,e){if(!t.gasLimit)throw new z9("gasLimit was not successfully set for transaction.");let r=qs(t.gasLimit),n=nt.from(0);if(t.type==2){if(!t.maxFeePerGas)throw new z9("maxFeePerGas was not successfully set for transaction of type 2.");n=qs(t.maxFeePerGas)}else{if(!t.gasPrice)throw new z9("gasPrice was not successfully set for transaction of type 0 or 1.");n=qs(t.gasPrice)}let i=r.mul(n),s=nt.from(0);if(t.chainId&&l8(t.chainId))try{s=await z5e(t,e),i=i.add(s)}catch{}return{totalGasEstimate:i,l1ExecutionFeeEstimate:s}}async function J5e(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:s}){try{let a={...i,value:void 0};return(await s.estimateGas(a)).toHexString()}catch(a){return console.warn(`Gas estimation failed with error: ${a} 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:s}){try{let a={...i,from:void 0};return(await s.estimateGas(a)).toHexString()}catch(a){return console.warn(`Gas estimation failed with error: ${a} when omitting the 'from' address`),null}}({txRequest:t,provider:e})),!n)throw r;return n}}function EY(t){return/^-?0x[a-f0-9]+$/i.test(t)}function Q5e(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",s=typeof n=="bigint",a=typeof n=="string"&&EY(n);return i||s||a}(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 Q$(t,e,r){if(e.chainId=Number(e.chainId),Q5e(e),e.from||(e.from=t),!e.nonce){let n=new e8(t,r);e.nonce=await n.getTransactionCount("pending")}return e.gasLimit||(e.gas?(e.gasLimit=e.gas,delete e.gas):e.gasLimit=await J5e(e,r)),typeof e.type=="string"&&EY(e.type)&&(e.type=Number(e.type)),[23294,23295].includes(e.chainId)&&(e.type=0),(e=xY(e.chainId)?await Y5e(e):vY(e.chainId)?await F5e(e,r):l8(e.chainId)?await W5e(e,r):wY(e.chainId)?await U5e(e,r):await Z5e(e,r)).type===0&&delete e.accessList,e.type!==2&&(delete e.maxPriorityFeePerGas,delete e.maxFeePerGas),e}var CY={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 s(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 a(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=a4e.encode(e));const r=32768,n=[];for(let i=0;io4e(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),c4e=t=>{const e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{let e=t;e instanceof Uint8Array&&(e=AY.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return c4e(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class d4e 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 Ah extends d4e{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function f4e(t){return typeof t=="object"&&t!==null}function h4e(t){if(!f4e(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 T4=l4e,p4e=u4e;function BL(t){if(typeof t!="string")throw new Ah("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:r}=t.split(".");if(r===5)throw new Ah("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Ah("Invalid JWT");if(!e)throw new Ah("JWTs must contain a payload");let n;try{n=p4e(e)}catch{throw new Ah("Failed to base64url decode the payload")}let i;try{i=JSON.parse(AY.decode(n))}catch{throw new Ah("Failed to parse the decoded payload as JSON")}if(!h4e(i))throw new Ah("Invalid JWT Claims Set");return i}/*! js-cookie v3.0.5 | MIT */function db(t){for(var e=1;e"u")){a=db({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var l in a)a[l]&&(o+="; "+l,a[l]!==!0&&(o+="="+a[l].split(";")[0]));return document.cookie=i+"="+t.write(s,i)+o}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],a={},o=0;oy4e(String(t),e),q9=(t,e)=>`+${X$(e)} ${t}`,b4e=t=>`*${t.replaceAll("-","").slice(-4)}`,_4e=t=>new O2(t),x4e=v4e().map(t=>({code:t,callCode:X$(t)})),E4e=t=>{var r;let e=(r=w4e(t,m4e))==null?void 0:r.formatInternational();return e==null?void 0:e.substring(e.indexOf(" ")+1)},C4e=t=>{let e=new O2;e.input(t);let r=e.getCountry()||"US",n=e.getCallingCode()||"1";return{countryCode:r,phone:t.replace("+"+n,"")}},A4e=(t,e=!0)=>t.reduce((r,n)=>({...r,[n]:e}),{});let S4e={buy:"CARD",send:"CRYPTO_ACCOUNT"},I4e={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 T4e({input:t,amount:e,blockchain:r,asset:n,experience:i}){let s=new URL("https://pay.coinbase.com/buy/select-asset");return s.searchParams.set("appId",t.app_id),s.searchParams.set("sessionToken",t.session_token),s.searchParams.set("defaultExperience",i),s.searchParams.set("presetCryptoAmount",e.startsWith(".")?`0${e}`:e),s.searchParams.set("defaultNetwork",r),s.searchParams.set("defaultPaymentMethod",S4e[i]),s.searchParams.set("defaultAsset",I4e[n]),s.searchParams.set("partnerUserId",t.partner_user_id),{url:s}}const $4e="1.0.7";let ll=class mS extends Error{constructor(e,r={}){var a;const n=r.cause instanceof mS?r.cause.details:(a=r.cause)!=null&&a.message?r.cause.message:r.details,i=r.cause instanceof mS&&r.cause.docsPath||r.docsPath,s=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${$4e}`].join(` +`);super(s),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 th(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const IY=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,TY=/^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)?$/,$Y=/^\(.+?\).*?$/,WL=/^tuple(?(\[(\d*)\])*)$/;function yS(t){let e=t.type;if(WL.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 N4e(t){return kY.test(t)}function P4e(t){return th(kY,t)}const NY=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function R4e(t){return NY.test(t)}function M4e(t){return th(NY,t)}const PY=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function O4e(t){return PY.test(t)}function j4e(t){return th(PY,t)}const RY=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function MY(t){return RY.test(t)}function L4e(t){return th(RY,t)}const OY=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function D4e(t){return OY.test(t)}function F4e(t){return th(OY,t)}const U4e=/^fallback\(\) external(?:\s(?payable{1}))?$/;function B4e(t){return U4e.test(t)}const W4e=/^receive\(\) external payable$/;function z4e(t){return W4e.test(t)}const H4e=new Set(["indexed"]),vS=new Set(["calldata","memory","storage"]);class q4e extends ll{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 V4e extends ll{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 G4e extends ll{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class K4e extends ll{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 Y4e extends ll{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 Z4e extends ll{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 J4e extends ll{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 _y extends ll{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Q4e extends ll{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class X4e extends ll{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 e6e extends ll{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 t6e extends ll{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 r6e(t,e,r){let n="";if(r)for(const i of Object.entries(r)){if(!i)continue;let s="";for(const a of i[1])s+=`[${a.type}${a.name?`:${a.name}`:""}]`;n+=`(${i[0]}{${s}})`}return e?`${e}:${t}${n}`:t}const V9=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 n6e(t,e={}){if(O4e(t)){const r=j4e(t);if(!r)throw new _y({signature:t,type:"function"});const n=Ol(r.parameters),i=[],s=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$_]*))?$/,s6e=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,a6e=/^u?int$/;function Dh(t,e){var f,h;const r=r6e(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(V9.has(r))return V9.get(r);const n=$Y.test(t),i=th(n?s6e:i6e,t);if(!i)throw new G4e({param:t});if(i.name&&l6e(i.name))throw new K4e({param:t,name:i.name});const s=i.name?{name:i.name}:{},a=i.modifier==="indexed"?{indexed:!0}:{},o=(e==null?void 0:e.structs)??{};let l,c={};if(n){l="tuple";const g=Ol(i.type),m=[],w=g.length;for(let E=0;E[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function LY(t,e,r=new Set){const n=[],i=t.length;for(let s=0;se(t,s)}function su(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new A6e(t.type);return`${t.name}(${d8(t.inputs,{includeName:e})})`}function d8(t,{includeName:e=!1}={}){return t?t.map(r=>f6e(r,{includeName:e})).join(e?", ":","):""}function f6e(t,{includeName:e}){return t.type.startsWith("tuple")?`(${d8(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}function Zl(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function ei(t){return Zl(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const DY="2.22.1";let Zm={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${DY}`},Je=class wS extends Error{constructor(e,r={}){var o;const n=(()=>{var l;return r.cause instanceof wS?r.cause.details:(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),i=r.cause instanceof wS&&r.cause.docsPath||r.docsPath,s=(o=Zm.getDocsUrl)==null?void 0:o.call(Zm,{...r,docsPath:i}),a=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...Zm.version?[`Version: ${Zm.version}`]:[]].join(` +`);super(a,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=DY}walk(e){return FY(this,e)}};function FY(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?FY(t.cause,e):e?null:t}class h6e extends Je{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 zL extends Je{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 UY extends Je{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${d8(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 Ov extends Je{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class p6e extends Je{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 g6e extends Je{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${ei(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class m6e extends Je{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` +`),{name:"AbiEncodingLengthMismatchError"})}}class BY extends Je{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 y6e extends Je{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class WY extends Je{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 HL extends Je{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 $4 extends Je{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 v6e extends Je{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 w6e extends Je{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 b6e extends Je{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${su(e.abiItem)}\`, and`,`\`${r.type}\` in \`${su(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class _6e extends Je{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}}class j2 extends Je{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: (${d8(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 f8 extends Je{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${su(e,{includeName:!0})}".`].join(` +`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class x6e extends Je{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 E6e extends Je{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 C6e extends Je{constructor(e){super([`Value "${e}" is not a valid array.`].join(` +`),{name:"InvalidArrayError"})}}class A6e extends Je{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`),{name:"InvalidDefinitionTypeError"})}}class S6e extends Je{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}class zY extends Je{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 HY=class extends Je{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 qL extends Je{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 Bg(t,{dir:e,size:r=32}={}){return typeof t=="string"?Nf(t,{dir:e,size:r}):I6e(t,{dir:e,size:r})}function Nf(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new HY({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function I6e(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new HY({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;ie)throw new k6e({givenSize:ei(t),maxSize:e})}function oo(t,e={}){const{signed:r}=e;e.size&&sc(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<e.toString(16).padStart(2,"0"));function ur(t,e={}){return typeof t=="number"||typeof t=="bigint"?lr(t,e):typeof t=="string"?rg(t,e):typeof t=="boolean"?VY(t,e):vi(t,e)}function VY(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(sc(r,{size:e.size}),Bg(r,{size:e.size})):r}function vi(t,e={}){let r="";for(let i=0;is||i=ku.zero&&t<=ku.nine)return t-ku.zero;if(t>=ku.A&&t<=ku.F)return t-(ku.A-10);if(t>=ku.a&&t<=ku.f)return t-(ku.a-10)}function Jl(t,e={}){let r=t;e.size&&(sc(r,{size:e.size}),r=Bg(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,s=new Uint8Array(i);for(let a=0,o=0;a0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function k4(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 GY(t,e){ek(t);const r=e.outputLen;if(t.length>KL&hb)}:{h:Number(t>>KL&hb)|0,l:Number(t&hb)|0}}function F6e(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,B6e=(t,e,r)=>e<>>32-r,W6e=(t,e,r)=>e<>>64-r,z6e=(t,e,r)=>t<>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const H6e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),G9=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),yc=(t,e)=>t<<32-e|t>>>e,YL=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,q6e=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function ZL(t){for(let e=0;et().update(tk(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const ZY=[],JY=[],QY=[],G6e=BigInt(0),Jm=BigInt(1),K6e=BigInt(2),Y6e=BigInt(7),Z6e=BigInt(256),J6e=BigInt(113);for(let t=0,e=Jm,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],ZY.push(2*(5*n+r)),JY.push((t+1)*(t+2)/2%64);let i=G6e;for(let s=0;s<7;s++)e=(e<>Y6e)*J6e)%Z6e,e&K6e&&(i^=Jm<<(Jm<r>32?W6e(t,e,r):U6e(t,e,r),QL=(t,e,r)=>r>32?z6e(t,e,r):B6e(t,e,r);function e8e(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,l=(a+2)%10,c=r[l],u=r[l+1],f=JL(c,u,1)^r[o],h=QL(c,u,1)^r[o+1];for(let g=0;g<50;g+=10)t[a+g]^=f,t[a+g+1]^=h}let i=t[2],s=t[3];for(let a=0;a<24;a++){const o=JY[a],l=JL(i,s,o),c=QL(i,s,o),u=ZY[a];i=t[u],s=t[u+1],t[u]=l,t[u+1]=c}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)r[o]=t[a+o];for(let o=0;o<10;o++)t[a+o]^=~r[(o+2)%10]&r[(o+4)%10]}t[0]^=Q6e[n],t[1]^=X6e[n]}r.fill(0)}let t8e=class XY extends KY{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,GL(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=H6e(this.state)}keccak(){YL||ZL(this.state32),e8e(this.state32,this.rounds),YL||ZL(this.state32),this.posOut=0,this.pos=0}update(e){k4(this);const{blockLen:r,state:n}=this;e=tk(e);const i=e.length;for(let s=0;s=n&&this.keccak();const a=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return GL(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(GY(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:s,enableXOF:a}=this;return e||(e=new XY(r,n,i,a,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}};const r8e=(t,e,r)=>YY(()=>new t8e(e,t,r)),n8e=r8e(1,136,256/8);function Vi(t,e){const r=e||"hex",n=n8e(Zl(t,{strict:!1})?Wg(t):t);return r==="bytes"?n:ur(n)}const i8e=t=>Vi(Wg(t));function s8e(t){return i8e(t)}function a8e(t){let e=!0,r="",n=0,i="",s=!1;for(let a=0;a{const e=typeof t=="string"?t:k4e(t);return a8e(e)};function eZ(t){return s8e(o8e(t))}const h8=eZ;class ta extends Je{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 p8 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 K9=new p8(8192);function jv(t,e){if(K9.has(`${t}.${e}`))return K9.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),n=Vi(n0(r),"bytes"),i=r.split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&i[a]&&(i[a]=i[a].toUpperCase()),(n[a>>1]&15)>=8&&i[a+1]&&(i[a+1]=i[a+1].toUpperCase());const s=`0x${i.join("")}`;return K9.set(`${t}.${e}`,s),s}function rk(t,e){if(!Sn(t,{strict:!1}))throw new ta({address:t});return jv(t,e)}const l8e=/^0x[a-fA-F0-9]{40}$/,Y9=new p8(8192);function Sn(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(Y9.has(n))return Y9.get(n);const i=l8e.test(t)?t.toLowerCase()===t?!0:r?jv(t)===t:!0:!1;return Y9.set(n,i),i}function vd(t){return typeof t[0]=="string"?du(t):c8e(t)}function c8e(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 du(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function C0(t,e,r,{strict:n}={}){return Zl(t,{strict:!1})?iZ(t,e,r,{strict:n}):nZ(t,e,r,{strict:n})}function tZ(t,e){if(typeof e=="number"&&e>0&&e>ei(t)-1)throw new zY({offset:e,position:"start",size:ei(t)})}function rZ(t,e,r){if(typeof e=="number"&&typeof r=="number"&&ei(t)!==r-e)throw new zY({offset:r,position:"end",size:ei(t)})}function nZ(t,e,r,{strict:n}={}){tZ(t,e);const i=t.slice(e,r);return n&&rZ(i,e,r),i}function iZ(t,e,r,{strict:n}={}){tZ(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&rZ(i,e,r),i}const u8e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,sZ=/^(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 zg(t,e){if(t.length!==e.length)throw new m6e({expectedLength:t.length,givenLength:e.length});const r=d8e({params:t,values:e}),n=ik(r);return n.length===0?"0x":n}function d8e({params:t,values:e}){const r=[];for(let n=0;n0?vd([o,a]):o}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:vd(s.map(({encoded:a})=>a))}}function p8e(t,{param:e}){const[,r]=e.type.split("bytes"),n=ei(t);if(!r){let i=t;return n%32!==0&&(i=Nf(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:vd([Nf(lr(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new g6e({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:Nf(t,{dir:"right"})}}function g8e(t){if(typeof t!="boolean")throw new Je(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Nf(VY(t))}}function m8e(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 sk(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const g8=t=>C0(eZ(t),0,4);function Lv(t){const{abi:e,args:r=[],name:n}=t,i=Zl(n,{strict:!1}),s=e.filter(o=>i?o.type==="function"?g8(o)===n:o.type==="event"?h8(o)===n:!1:"name"in o&&o.name===n);if(s.length===0)return;if(s.length===1)return s[0];let a;for(const o of s){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?bS(c,f):!1})){if(a&&"inputs"in a&&a.inputs){const c=aZ(o.inputs,a.inputs,r);if(c)throw new b6e({abiItem:o,type:c[0]},{abiItem:a,type:c[1]})}a=o}}return a||s[0]}function bS(t,e){const r=typeof t,n=e.type;switch(n){case"address":return Sn(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,s)=>bS(Object.values(t)[s],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=>bS(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function aZ(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return aZ(i.components,s.components,r[n]);const a=[i.type,s.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?Sn(r[n],{strict:!1}):a.includes("address")&&a.includes("bytes")?Sn(r[n],{strict:!1}):!1)return a}}const XL="/docs/contract/encodeEventTopics";function Dv(t){var l;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const c=Lv({abi:e,name:r});if(!c)throw new HL(r,{docsPath:XL});i=c}if(i.type!=="event")throw new HL(void 0,{docsPath:XL});const s=su(i),a=h8(s);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)=>eD({param:f,value:u[h][m]})):u[h]?eD({param:f,value:u[h]}):null))??[])}return[a,...o]}function eD({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Vi(Wg(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new S6e(t.type);return zg([t],[e])}function m8(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:s,response:a,status:o,transport:l})=>{o==="success"&&e===s&&(r[a]=l.request)})),s=>r[s]||t.request}async function oZ(t,e){const{address:r,abi:n,args:i,eventName:s,fromBlock:a,strict:o,toBlock:l}=e,c=m8(t,{method:"eth_newFilter"}),u=s?Dv({abi:n,args:i,eventName:s}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof a=="bigint"?lr(a):a,toBlock:typeof l=="bigint"?lr(l):l,topics:u}]});return{abi:n,args:i,eventName:s,id:f,request:c(f),strict:!!o,type:"event"}}function sa(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const tD="/docs/contract/encodeFunctionData";function w8e(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const s=Lv({abi:e,args:r,name:n});if(!s)throw new $4(n,{docsPath:tD});i=s}if(i.type!=="function")throw new $4(void 0,{docsPath:tD});return{abi:[i],functionName:g8(su(i))}}function ac(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var o;return t.abi.length===1&&((o=t.functionName)!=null&&o.startsWith("0x"))?t:w8e(t)})(),i=r[0],s=n,a="inputs"in i&&i.inputs?zg(i.inputs,e??[]):void 0;return du([s,a??"0x"])}const lZ={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."},b8e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},_8e={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class rD extends Je{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class cZ extends Je{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class x8e extends Je{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const E8e={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 x8e({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new cZ({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new rD({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 rD({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 ak(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(E8e);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function C8e(t,e={}){typeof e.size<"u"&&sc(t,{size:e.size});const r=vi(t,e);return oo(r,e)}function A8e(t,e={}){let r=t;if(typeof e.size<"u"&&(sc(r,{size:e.size}),r=ql(r)),r.length>1||r[0]>1)throw new T6e(r);return!!r[0]}function ld(t,e={}){typeof e.size<"u"&&sc(t,{size:e.size});const r=vi(t,e);return au(r,e)}function S8e(t,e={}){let r=t;return typeof e.size<"u"&&(sc(r,{size:e.size}),r=ql(r,{dir:"right"})),new TextDecoder().decode(r)}function Hg(t,e){const r=typeof e=="string"?Jl(e):e,n=ak(r);if(ei(r)===0&&t.length>0)throw new Ov;if(ei(e)&&ei(e)<32)throw new UY({data:typeof e=="string"?e:vi(e),params:t,size:ei(e)});let i=0;const s=[];for(let a=0;a48?C8e(i,{signed:r}):ld(i,{signed:r}),32]}function P8e(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:a})=>!a),i=n?[]:{};let s=0;if(L2(e)){const a=ld(t.readBytes(_S)),o=r+a;for(let l=0;la.type==="error"&&n===g8(su(a)));if(!s)throw new BY(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Hg(s.inputs,C0(r,4)):void 0,errorName:s.name}}const Zi=(t,e,r)=>JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r);function uZ({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,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?Zi(e[s]):e[s]}`).join(", ")})`}const dZ={gwei:9,wei:18},O8e={ether:-9,wei:9};function y8(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function Fv(t,e="wei"){return y8(t,dZ[e])}function Ra(t,e="wei"){return y8(t,O8e[e])}class j8e extends Je{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class L8e extends Je{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function iD(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} +`,"")}function D8e(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+=FD(n.state)),n.stateDiff&&(i+=` stateDiff: -`,i+=FD(n.stateDiff)),i},` State Override: -`).slice(0,-1)}function Dv(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 U4e extends Je{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 B4e extends Je{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class W4e extends Je{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Dv(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 z4e extends Je{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 H4e extends Je{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=Dv({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"&&`${jv(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Mo(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${Mo(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Mo(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 BY extends Je{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let o="Transaction";n&&s!==void 0&&(o=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(o=`Transaction at block number "${r}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class WY extends Je{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 q4e extends Je{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const V4e=t=>t,Z$=t=>t;class zY extends Je{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h,stateOverride:g}){var E;const m=r?so(r):void 0;let w=Dv({from:m==null?void 0:m.address,to:f,value:typeof h<"u"&&`${jv(h)} ${((E=i==null?void 0:i.nativeCurrency)==null?void 0:E.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Mo(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${Mo(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Mo(c)} gwei`,nonce:u});g&&(w+=` -${F4e(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 G4e extends Je{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const l=Mv({abi:r,args:n,name:o}),c=l?FY({abiItem:l,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=l?nu(l,{includeName:!0}):void 0,f=Dv({address:i&&V4e(i),function:u,args:c&&c!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${c}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,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=o,this.sender=a}}class gS extends Je{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,l;if(r&&r!=="0x")try{o=O4e({abi:e,data:r});const{abiItem:u,errorName:f,args:h}=o;if(f==="Error")l=h[0];else if(f==="Panic"){const[g]=h;l=DY[g]}else{const g=u?nu(u,{includeName:!0}):void 0,m=u&&h?FY({abiItem:u,args:h,includeFunctionName:!1,includeName:!1}):void 0;a=[g?`Error: ${g}`:"",m&&m!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(u){s=u}else i&&(l=i);let c;s instanceof mY&&(c=s.signature,a=[`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:s,metaMessages:a,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=o,this.reason=l,this.signature=c}}class K4e extends Je{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 Y4e extends Je{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 f8 extends Je{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 Hy extends Je{constructor({body:e,cause:r,details:n,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${Z$(o)}`,e&&`Request body: ${Zi(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=s,this.url=o}}class J$ extends Je{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${Z$(n)}`,`Request body: ${Zi(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 UD extends Je{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Z$(r)}`,`Request body: ${Zi(e)}`],name:"TimeoutError"})}}const Z4e=-1;class Wo extends Je{constructor(e,{code:r,docsPath:n,metaMessages:i,name:s,shortMessage:o}){super(o,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof J$?e.code:r??Z4e}}class zg extends Wo{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class O2 extends Wo{constructor(e){super(e,{code:O2.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(O2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class j2 extends Wo{constructor(e){super(e,{code:j2.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(j2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class D2 extends Wo{constructor(e,{method:r}={}){super(e,{code:D2.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(D2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class L2 extends Wo{constructor(e){super(e,{code:L2.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(L2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class x0 extends Wo{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 E0 extends Wo{constructor(e){super(e,{code:E0.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(E0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class F2 extends Wo{constructor(e){super(e,{code:F2.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(F2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class U2 extends Wo{constructor(e){super(e,{code:U2.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(U2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class B2 extends Wo{constructor(e){super(e,{code:B2.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(B2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class W2 extends Wo{constructor(e,{method:r}={}){super(e,{code:W2.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not implemented.`})}}Object.defineProperty(W2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class tg extends Wo{constructor(e){super(e,{code:tg.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(tg,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class z2 extends Wo{constructor(e){super(e,{code:z2.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(z2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class O1 extends zg{constructor(e){super(e,{code:O1.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(O1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class H2 extends zg{constructor(e){super(e,{code:H2.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(H2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class q2 extends zg{constructor(e,{method:r}={}){super(e,{code:q2.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(q2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class V2 extends zg{constructor(e){super(e,{code:V2.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(V2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class G2 extends zg{constructor(e){super(e,{code:G2.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(G2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class K2 extends zg{constructor(e){super(e,{code:K2.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(K2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class J4e extends Wo{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Q4e=3;function C0(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const a=t instanceof f8?t:t instanceof Je?t.walk(m=>"data"in m)||t.walk():{},{code:l,data:c,details:u,message:f,shortMessage:h}=a,g=t instanceof Pv?new K4e({functionName:s}):[Q4e,x0.code].includes(l)&&(c||u||f||h)?new gS({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:a instanceof J$?u:h??f}):t;return new G4e(g,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}function X4e(t){const e=Vi(`0x${t.substring(4)}`).substring(26);return Rv(`0x${e}`)}async function e8e({hash:t,signature:e}){const r=Zl(t)?t:ur(t),{secp256k1:n}=await Oo(async()=>{const{secp256k1:o}=await Promise.resolve().then(()=>bxe);return{secp256k1:o}},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=BD(g);return new n.Signature(la(c),la(u)).addRecoveryBit(m)}const o=Zl(e)?e:ur(e),a=iu(`0x${o.slice(130)}`),l=BD(a);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function BD(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 HY({hash:t,signature:e}){return X4e(await e8e({hash:t,signature:e}))}function jf(t,e="hex"){const r=qY(t),n=Y$(new Uint8Array(r.length));return r.encode(n),e==="hex"?vi(n.bytes):n.bytes}function qY(t){return Array.isArray(t)?t8e(t.map(e=>qY(e))):r8e(t)}function t8e(t){const e=t.reduce((i,s)=>i+s.length,0),r=VY(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:s}of t)s(i)}}}function r8e(t){const e=typeof t=="string"?Jl(t):t,r=VY(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 VY(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 Je("Length is too large.")}function n8e(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,s=Vi(cu(["0x05",jf([e?lr(e):"0x",r,n?lr(n):"0x"])]));return i==="bytes"?Jl(s):s}async function GY(t){const{authorization:e,signature:r}=t;return HY({hash:n8e(e),signature:r??e})}class i8e extends Je{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=Dv({from:r==null?void 0:r.address,to:f,value:typeof h<"u"&&`${jv(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Mo(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${Mo(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Mo(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 y1 extends Je{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(y1,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(y1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class A0 extends Je{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Mo(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(A0,"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 mS extends Je{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Mo(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(mS,"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 yS extends Je{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(yS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class vS extends Je{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(vS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class wS extends Je{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(wS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class bS extends Je{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(bS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class _S extends Je{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(_S,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class xS extends Je{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(xS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class ES extends Je{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(ES,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Y2 extends Je{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Mo(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Mo(n)} gwei`:""}).`].join(` -`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(Y2,"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 Lv extends Je{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function h8(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof Je?t.walk(i=>(i==null?void 0:i.code)===y1.code):t;return n instanceof Je?new y1({cause:t,message:n.details}):y1.nodeMessage.test(r)?new y1({cause:t,message:t.details}):A0.nodeMessage.test(r)?new A0({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):mS.nodeMessage.test(r)?new mS({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):yS.nodeMessage.test(r)?new yS({cause:t,nonce:e==null?void 0:e.nonce}):vS.nodeMessage.test(r)?new vS({cause:t,nonce:e==null?void 0:e.nonce}):wS.nodeMessage.test(r)?new wS({cause:t,nonce:e==null?void 0:e.nonce}):bS.nodeMessage.test(r)?new bS({cause:t}):_S.nodeMessage.test(r)?new _S({cause:t,gas:e==null?void 0:e.gas}):xS.nodeMessage.test(r)?new xS({cause:t,gas:e==null?void 0:e.gas}):ES.nodeMessage.test(r)?new ES({cause:t}):Y2.nodeMessage.test(r)?new Y2({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Lv({cause:t})}function s8e(t,{docsPath:e,...r}){const n=(()=>{const i=h8(t,r);return i instanceof Lv?t:i})();return new i8e(n,{docsPath:e,...r})}function p8(t,{format:e}){if(!e)return{};const r={};function n(s){const o=Object.keys(s);for(const a of o)a in t&&(r[a]=t[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&n(s[a])}const i=e(t||{});return n(i),r}function Q$(t,e){return({exclude:r,format:n})=>({exclude:r,format:i=>{const s=e(i);if(r)for(const o of r)delete s[o];return{...s,...n(i)}},type:t})}const o8e={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Hg(t){const e={};return typeof t.authorizationList<"u"&&(e.authorizationList=a8e(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=>vi(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=o8e[t.type]),typeof t.value<"u"&&(e.value=lr(t.value)),e}function a8e(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 WD(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new SD({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new SD({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function l8e(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:s}=t,o={};if(s!==void 0&&(o.code=s),e!==void 0&&(o.balance=lr(e)),r!==void 0&&(o.nonce=lr(r)),n!==void 0&&(o.state=WD(n)),i!==void 0){if(o.state)throw new L4e;o.stateDiff=WD(i)}return o}function X$(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!Mn(r,{strict:!1}))throw new to({address:r});if(e[r])throw new D4e({address:r});e[r]=l8e(n)}return e}const g8=2n**256n-1n;function H0(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,o=e?so(e):void 0;if(o&&!Mn(o.address))throw new to({address:o.address});if(s&&!Mn(s))throw new to({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new U4e;if(n&&n>g8)throw new A0({maxFeePerGas:n});if(i&&n&&i>n)throw new Y2({maxFeePerGas:n,maxPriorityFeePerGas:i})}class c8e extends Je{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class ek extends Je{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class u8e extends Je{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Mo(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class KY extends Je{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 YY={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function m8(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?iu(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?iu(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?YY[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=f8e(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 d8e=Q$("transaction",m8);function f8e(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 tk(t){const e=(t.transactions??[]).map(r=>typeof r=="string"?r:m8(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 h8e=Q$("block",tk);async function Lc(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,h;const s=n??"latest",o=i??!1,a=r!==void 0?lr(r):void 0;let l=null;if(e?l=await t.request({method:"eth_getBlockByHash",params:[e,o]},{dedupe:!0}):l=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]},{dedupe:!!a}),!l)throw new KY({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)||tk)(l)}async function rk(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function p8e(t,e){return ZY(t,e)}async function ZY(t,e){var s,o;const{block:r,chain:n=t.chain,request:i}=e||{};try{const a=((s=n==null?void 0:n.fees)==null?void 0:s.maxPriorityFeePerGas)??((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee);if(typeof a=="function"){const c=r||await nr(t,Lc,"getBlock")({}),u=await a({block:c,client:t,request:i});if(u===null)throw new Error;return u}if(typeof a<"u")return a;const l=await t.request({method:"eth_maxPriorityFeePerGas"});return la(l)}catch{const[a,l]=await Promise.all([r?Promise.resolve(r):nr(t,Lc,"getBlock")({}),nr(t,rk,"getGasPrice")({})]);if(typeof a.baseFeePerGas!="bigint")throw new ek;const c=l-a.baseFeePerGas;return c<0n?0n:c}}async function g8e(t,e){return CS(t,e)}async function CS(t,e){var h,g;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=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(o<1)throw new c8e;const l=10**(((h=o.toString().split(".")[1])==null?void 0:h.length)??0),c=m=>m*BigInt(Math.ceil(o*l))/BigInt(l),u=r||await nr(t,Lc,"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:s});if(m!==null)return m}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new ek;const m=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await ZY(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,rk,"getGasPrice")({}))}}async function JY(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 iu(i)}function nk(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=>Jl(s)):t.blobs,i=[];for(const s of n)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return r==="bytes"?i:i.map(s=>vi(s))}function ik(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>Jl(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>Jl(o)):t.commitments,s=[];for(let o=0;ovi(o))}function m8e(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,c=n?0:4;t.setUint32(e+l,o,n),t.setUint32(e+c,a,n)}const y8e=(t,e,r)=>t&e^~t&r,v8e=(t,e,r)=>t&e^t&r^e&r;let w8e=class extends EY{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=U9(this.buffer)}update(e){A6(this);const{view:r,buffer:n,blockLen:i}=this;e=H$(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=mc(g,17)^mc(g,19)^g>>>10;Yd[f]=w+Yd[f-7]+m+Yd[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=mc(a,6)^mc(a,11)^mc(a,25),g=u+h+y8e(a,l,c)+b8e[f]+Yd[f]|0,w=(mc(n,2)^mc(n,13)^mc(n,22))+v8e(n,i,s)|0;u=c,c=l,l=a,a=o+g|0,o=s,s=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,l,c,u)}roundClean(){Yd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const x8e=CY(()=>new _8e);function E8e(t,e){return x8e(Zl(t,{strict:!1})?Ug(t):t)}function C8e(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=E8e(e);return i.set([r],0),n==="bytes"?i:vi(i)}function QY(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const s of e)i.push(C8e({commitment:s,to:n,version:r}));return i}const zD=6,XY=32,sk=4096,eZ=XY*sk,HD=eZ*zD-1-1*sk*zD,tZ=1;class A8e extends Je{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class rZ extends Je{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class S8e extends Je{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class I8e extends Je{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${tZ}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function T8e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?Jl(t.data):t.data,n=ei(r);if(!n)throw new rZ;if(n>HD)throw new A8e({maxSize:HD,size:n});const i=[];let s=!0,o=0;for(;s;){const a=Y$(new Uint8Array(eZ));let l=0;for(;la.bytes):i.map(a=>vi(a.bytes))}function nZ(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??T8e({data:e,to:n}),s=t.commitments??nk({blobs:i,kzg:r,to:n}),o=t.proofs??ik({blobs:i,commitments:s,kzg:r,to:n}),a=[];for(let l=0;l"u"&&f)if(l){const v=await E();h.nonce=await l.consume({address:f.address,chainId:v,client:t})}else h.nonce=await nr(t,JY,"getTransactionCount")({address:f.address,blockTag:"pending"});if((c.includes("fees")||c.includes("type"))&&typeof u>"u")try{h.type=iZ(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:_,maxPriorityFeePerGas:A}=await CS(t,{block:v,chain:i,request:h});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(h.gas=await nr(t,ok,"estimateGas")({...h,account:f&&{address:f.address,type:"json-rpc"}})),H0(h),delete h.parameters,h}async function oZ(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?lr(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}async function ok(t,e){var i,s,o;const{account:r=t.account}=e,n=r?so(r):void 0;try{let b=function(P){const{block:L,request:O,rpcStateOverride:j}=P;return t.request({method:"eth_estimateGas",params:j?[O,L??"latest",j]:L?[O,L]:[O]})};const{accessList:a,authorizationList:l,blobs:c,blobVersionedHashes:u,blockNumber:f,blockTag:h,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:E,maxFeePerGas:v,maxPriorityFeePerGas:_,nonce:A,value:C,stateOverride:R,...B}=await y8(t,{...e,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),U=(f?lr(f):void 0)||h,G=X$(R),oe=await(async()=>{if(B.to)return B.to;if(l&&l.length>0)return await GY({authorization:l[0]}).catch(()=>{throw new Je("`to` is required. Could not infer from `authorizationList`")})})();H0(e);const K=(o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format,k=(K||Hg)({...p8(B,{format:K}),from:n==null?void 0:n.address,accessList:a,authorizationList:l,blobs:c,blobVersionedHashes:u,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:E,maxFeePerGas:v,maxPriorityFeePerGas:_,nonce:A,to:oe,value:C});let x=BigInt(await b({block:U,request:k,rpcStateOverride:G}));if(l){const P=await oZ(t,{address:k.from}),L=await Promise.all(l.map(async O=>{const{contractAddress:j}=O,I=await b({block:U,request:{authorizationList:void 0,data:g,from:n==null?void 0:n.address,to:j,value:lr(P)},rpcStateOverride:G}).catch(()=>100000n);return 2n*BigInt(I)}));x+=L.reduce((O,j)=>O+j,0n)}return x}catch(a){throw s8e(a,{...e,account:n,chain:t.chain})}}async function $8e(t,e){const{abi:r,address:n,args:i,functionName:s,dataSuffix:o,...a}=e,l=oc({abi:r,args:i,functionName:s});try{return await nr(t,ok,"estimateGas")({data:`${l}${o?o.replace("0x",""):""}`,to:n,...a})}catch(c){const u=a.account?so(a.account):void 0;throw C0(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:u==null?void 0:u.address})}}function ak(t,e){if(!Mn(t,{strict:!1}))throw new to({address:t});if(!Mn(e,{strict:!1}))throw new to({address:e});return t.toLowerCase()===e.toLowerCase()}const qD="/docs/contract/decodeEventLog";function lk(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[o,...a]=i;if(!o)throw new v6e({docsPath:qD});const l=e.length===1?e[0]:e.find(w=>w.type==="event"&&o===a8(nu(w)));if(!(l&&"name"in l)||l.type!=="event")throw new yY(o,{docsPath:qD});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=Wg(m,r);if(w)if(f)h=[...h,...w];else for(let E=0;E0?h:void 0}}function k8e({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(Wg([t],e)||[])[0]}function ck(t){const{abi:e,args:r,logs:n,strict:i=!0}=t,s=(()=>{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})();return n.map(o=>{var a;try{const l=e.find(u=>u.type==="event"&&o.topics[0]===a8(u));if(!l)return null;const c=lk({...o,abi:[l],strict:i});return s&&!s.includes(c.eventName)||!N8e({args:c.args,inputs:l.inputs,matchArgs:r})?null:{...c,...o}}catch(l){let c,u;if(l instanceof yY)return null;if(l instanceof R2||l instanceof o8){if(i)return null;c=l.abiItem.name,u=(a=l.abiItem.inputs)==null?void 0:a.some(f=>!("name"in f&&f.name))}return{...o,args:u?[]:{},eventName:c}}}).filter(Boolean)}function N8e(t){const{args:e,inputs:r,matchArgs:n}=t;if(!n)return!0;if(!e)return!1;function i(s,o,a){try{return s.type==="address"?ak(o,a):s.type==="string"||s.type==="bytes"?Vi(Ug(o))===a:o===a}catch{return!1}}return Array.isArray(e)&&Array.isArray(n)?n.every((s,o)=>{if(s==null)return!0;const a=r[o];return a?(Array.isArray(s)?s:[s]).some(c=>i(a,c,e[o])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([s,o])=>{if(o==null)return!0;const a=r.find(c=>c.name===s);return a?(Array.isArray(o)?o:[o]).some(c=>i(a,c,e[s])):!1}):!1}function yd(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 uk(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:s,events:o,args:a,strict:l}={}){const c=l??!1,u=o??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(w=>Ov({abi:[w],eventName:w.name,args:o?void 0:a}))],s&&(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=>yd(m));return u?ck({abi:u,args:a,logs:g,strict:c}):g}async function aZ(t,e){const{abi:r,address:n,args:i,blockHash:s,eventName:o,fromBlock:a,toBlock:l,strict:c}=e,u=o?Mv({abi:r,name:o}):void 0,f=u?void 0:r.filter(h=>h.type==="event");return nr(t,uk,"getLogs")({address:n,args:i,blockHash:s,event:u,events:f,fromBlock:a,toBlock:l,strict:c})}const z9="/docs/contract/decodeFunctionResult";function q0(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const a=Mv({abi:e,args:r,name:n});if(!a)throw new C6(n,{docsPath:z9});s=a}if(s.type!=="function")throw new C6(void 0,{docsPath:z9});if(!s.outputs)throw new w6e(s.name,{docsPath:z9});const o=Wg(s.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const AS=[{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"}],lZ=[{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"}],cZ=[...lZ,{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"}]}],P8e=[...lZ,{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"}]}],VD=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],GD=[{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"}]}],KD=[{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"}],R8e="0x82ad56cb",M8e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",O8e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",j8e="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";class SS extends Je{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 D8e extends Je{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 L8e extends Je{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 uZ extends Je{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class v8 extends Je{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const H9="/docs/contract/encodeDeployData";function w8(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(o=>"type"in o&&o.type==="constructor");if(!i)throw new p6e({docsPath:H9});if(!("inputs"in i))throw new CD({docsPath:H9});if(!i.inputs||i.inputs.length===0)throw new CD({docsPath:H9});const s=Bg(i.inputs,r);return cu([n,s])}function qg({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 SS({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new SS({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function dZ(t,{docsPath:e,...r}){const n=(()=>{const i=h8(t,r);return i instanceof Lv?t:i})();return new zY(n,{docsPath:e,...r})}function fZ(){let t=()=>{},e=()=>{};return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const q9=new Map;function hZ({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const u=l();o();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;gq9.delete(e),a=()=>l().map(({args:u})=>u),l=()=>q9.get(e)||[],c=u=>q9.set(e,[...l(),u]);return{flush:o,async schedule(u){const{promise:f,resolve:h,reject:g}=fZ();return(r==null?void 0:r([...a(),u]))&&s(),l().length>0?(c({args:u,resolve:h,reject:g}),f):(c({args:u,resolve:h,reject:g}),setTimeout(s,n),f)}}}async function b8(t,e){var K,N,k,b;const{account:r=t.account,batch:n=!!((K=t.batch)!=null&&K.multicall),blockNumber:i,blockTag:s="latest",accessList:o,blobs:a,code:l,data:c,factory:u,factoryData:f,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:E,nonce:v,to:_,value:A,stateOverride:C,...R}=e,B=r?so(r):void 0;if(l&&(u||f))throw new Je("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&_)throw new Je("Cannot provide both `code` & `to` as parameters.");const S=l&&c,U=u&&f&&_&&c,G=S||U,oe=S?B8e({code:l,data:c}):U?W8e({data:c,factory:u,factoryData:f,to:_}):c;try{H0(e);const P=(i?lr(i):void 0)||s,L=X$(C),O=(b=(k=(N=t.chain)==null?void 0:N.formatters)==null?void 0:k.transactionRequest)==null?void 0:b.format,I=(O||Hg)({...p8(R,{format:O}),from:B==null?void 0:B.address,accessList:o,blobs:a,data:oe,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:E,nonce:v,to:G?void 0:_,value:A});if(n&&F8e({request:I})&&!L)try{return await U8e(t,{...I,blockNumber:i,blockTag:s})}catch(M){if(!(M instanceof uZ)&&!(M instanceof SS))throw M}const D=await t.request({method:"eth_call",params:L?[I,P,L]:[I,P]});return D==="0x"?{data:void 0}:{data:D}}catch(x){const P=z8e(x),{offchainLookup:L,offchainLookupSignature:O}=await Oo(async()=>{const{offchainLookup:j,offchainLookupSignature:I}=await import("./ccip-DpKvcgrn.js");return{offchainLookup:j,offchainLookupSignature:I}},[]);if(t.ccipRead!==!1&&(P==null?void 0:P.slice(0,10))===O&&_)return{data:await L(t,{data:P,to:_})};throw G&&(P==null?void 0:P.slice(0,10))==="0x101bb98d"?new Y4e({factory:u}):dZ(x,{...e,account:B,chain:t.chain})}}function F8e({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(R8e)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function U8e(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:s="latest",data:o,multicallAddress:a,to:l}=e;let c=a;if(!c){if(!t.chain)throw new uZ;c=qg({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?lr(i):void 0)||s,{schedule:h}=hZ({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(E){return E.reduce((_,{data:A})=>_+(A.length-2),0)>r*2},fn:async E=>{const v=E.map(C=>({allowFailure:!0,callData:C.data,target:C.to})),_=oc({abi:AS,args:[v],functionName:"aggregate3"}),A=await t.request({method:"eth_call",params:[{data:_,to:c},f]});return q0({abi:AS,args:[v],functionName:"aggregate3",data:A||"0x"})}}),[{returnData:g,success:m}]=await h({data:o,to:l});if(!m)throw new f8({data:g});return g==="0x"?{data:void 0}:{data:g}}function B8e(t){const{code:e,data:r}=t;return w8({abi:i8(["constructor(bytes, bytes)"]),bytecode:M8e,args:[e,r]})}function W8e(t){const{data:e,factory:r,factoryData:n,to:i}=t;return w8({abi:i8(["constructor(address, bytes, address, bytes)"]),bytecode:O8e,args:[i,e,r,n]})}function z8e(t){var r;if(!(t instanceof Je))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 vd(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=oc({abi:r,args:i,functionName:s});try{const{data:l}=await nr(t,b8,"call")({...o,data:a,to:n});return q0({abi:r,args:i,functionName:s,data:l||"0x"})}catch(l){throw C0(l,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function H8e(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,l=a.account?so(a.account):t.account,c=oc({abi:r,args:i,functionName:o});try{const{data:u}=await nr(t,b8,"call")({batch:!1,data:`${c}${s?s.replace("0x",""):""}`,to:n,...a,account:l}),f=q0({abi:r,args:i,functionName:o,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:s,functionName:o,...a,account:l}}}catch(u){throw C0(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:l==null?void 0:l.address})}}const V9=new Map,YD=new Map;let q8e=0;function Df(t,e,r){const n=++q8e,i=()=>V9.get(t)||[],s=()=>{const u=i();V9.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=i();if(!u.some(h=>h.id===n))return;const f=YD.get(t);u.length===1&&f&&f(),s()},a=i();if(V9.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;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"&&YD.set(t,c),o}async function IS(t){return new Promise(e=>setTimeout(e,t))}function Uv(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const l=await(r==null?void 0:r(a))??n;await IS(l);const c=async()=>{i&&(await t({unpoll:s}),await IS(n),c())};c()})(),s}const V8e=new Map,G8e=new Map;function K8e(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,V8e),n=e(t,G8e);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function Y8e(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=K8e(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function Bv(t,{cacheTime:e=t.cacheTime}={}){const r=await Y8e(()=>t.request({method:"eth_blockNumber"}),{cacheKey:Z8e(t.uid),cacheTime:e});return BigInt(r)}async function _8(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(s=>yd(s));return!("abi"in e)||!e.abi?i:ck({abi:e.abi,logs:i,strict:r})}async function x8(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function J8e(t,e){const{abi:r,address:n,args:i,batch:s=!0,eventName:o,fromBlock:a,onError:l,onLogs:c,poll:u,pollingInterval:f=t.pollingInterval,strict:h}=e;return(typeof u<"u"?u:typeof a=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"))?(()=>{const E=h??!1,v=Zi(["watchContractEvent",n,i,s,t.uid,o,f,E,a]);return Df(v,{onLogs:c,onError:l},_=>{let A;a!==void 0&&(A=a-1n);let C,R=!1;const B=Uv(async()=>{var S;if(!R){try{C=await nr(t,jY,"createContractEventFilter")({abi:r,address:n,args:i,eventName:o,strict:E,fromBlock:a})}catch{}R=!0;return}try{let U;if(C)U=await nr(t,_8,"getFilterChanges")({filter:C});else{const G=await nr(t,Bv,"getBlockNumber")({});A&&A{C&&await nr(t,x8,"uninstallFilter")({filter:C}),B()}})})():(()=>{const E=h??!1,v=Zi(["watchContractEvent",n,i,s,t.uid,o,f,E]);let _=!0,A=()=>_=!1;return Df(v,{onLogs:c,onError:l},C=>((async()=>{try{const R=(()=>{if(t.transport.type==="fallback"){const U=t.transport.transports.find(G=>G.config.type==="webSocket");return U?U.value:t.transport}return t.transport})(),B=o?Ov({abi:r,eventName:o,args:i}):[],{unsubscribe:S}=await R.subscribe({params:["logs",{address:n,topics:B}],onData(U){var oe;if(!_)return;const G=U.result;try{const{eventName:K,args:N}=lk({abi:r,data:G.data,topics:G.topics,strict:h}),k=yd(G,{args:N,eventName:K});C.onLogs([k])}catch(K){let N,k;if(K instanceof R2||K instanceof o8){if(h)return;N=K.abiItem.name,k=(oe=K.abiItem.inputs)==null?void 0:oe.some(x=>!("name"in x&&x.name))}const b=yd(G,{args:k?[]:{},eventName:N});C.onLogs([b])}},onError(U){var G;(G=C.onError)==null||G.call(C,U)}});A=S,_||A()}catch(R){l==null||l(R)}})(),()=>A()))})()}class Wv extends Je{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 G9 extends Je{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function pZ({chain:t,currentChainId:e}){if(!t)throw new L8e;if(e!==t.id)throw new D8e({chain:t,currentChainId:e})}function Q8e(t,{docsPath:e,...r}){const n=(()=>{const i=h8(t,r);return i instanceof Lv?t:i})();return new H4e(n,{docsPath:e,...r})}async function dk(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const K9=new l8(128);async function fk(t,e){var v,_,A,C;const{account:r=t.account,chain:n=t.chain,accessList:i,authorizationList:s,blobs:o,data:a,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,value:m,...w}=e;if(typeof r>"u")throw new Wv({docsPath:"/docs/actions/wallet/sendTransaction"});const E=r?so(r):null;try{H0(e);const R=await(async()=>{if(e.to)return e.to;if(s&&s.length>0)return await GY({authorization:s[0]}).catch(()=>{throw new Je("`to` is required. Could not infer from `authorizationList`.")})})();if((E==null?void 0:E.type)==="json-rpc"||E===null){let B;n!==null&&(B=await nr(t,Fv,"getChainId")({}),pZ({currentChainId:B,chain:n}));const S=(A=(_=(v=t.chain)==null?void 0:v.formatters)==null?void 0:_.transactionRequest)==null?void 0:A.format,G=(S||Hg)({...p8(w,{format:S}),accessList:i,authorizationList:s,blobs:o,chainId:B,data:a,from:E==null?void 0:E.address,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,to:R,value:m}),oe=K9.get(t.uid),K=oe?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:K,params:[G]},{retryCount:0})}catch(N){if(oe===!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:[G]},{retryCount:0}).then(b=>(K9.set(t.uid,!0),b)).catch(b=>{const x=b;throw x.name==="MethodNotFoundRpcError"||x.name==="MethodNotSupportedRpcError"?(K9.set(t.uid,!1),k):x});throw k}}if((E==null?void 0:E.type)==="local"){const B=await nr(t,y8,"prepareTransactionRequest")({account:E,accessList:i,authorizationList:s,blobs:o,chain:n,data:a,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,nonceManager:E.nonceManager,parameters:[...sZ,"sidecars"],value:m,...w,to:R}),S=(C=n==null?void 0:n.serializers)==null?void 0:C.transaction,U=await E.signTransaction(B,{serializer:S});return await nr(t,dk,"sendRawTransaction")({serializedTransaction:U})}throw(E==null?void 0:E.type)==="smart"?new G9({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new G9({docsPath:"/docs/actions/wallet/sendTransaction",type:E==null?void 0:E.type})}catch(R){throw R instanceof G9?R:Q8e(R,{...e,account:E,chain:e.chain||void 0})}}async function X8e(t,e){const{abi:r,account:n=t.account,address:i,args:s,dataSuffix:o,functionName:a,...l}=e;if(typeof n>"u")throw new Wv({docsPath:"/docs/contract/writeContract"});const c=n?so(n):null,u=oc({abi:r,args:s,functionName:a});try{return await nr(t,fk,"sendTransaction")({data:`${u}${o?o.replace("0x",""):""}`,to:i,account:c,...l})}catch(f){throw C0(f,{abi:r,address:i,args:s,docsPath:"/docs/contract/writeContract",functionName:a,sender:c==null?void 0:c.address})}}class e_e extends Je{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 t_e(t,e){const{address:r,factory:n,factoryData:i}=e;try{const[s,o,a,l,c,u,f]=await nr(t,vd,"readContract")({abi:r_e,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:o,version:a,chainId:Number(l),verifyingContract:c,salt:u},extensions:f,fields:s}}catch(s){const o=s;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new e_e({address:r}):o}}const r_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 n_e(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:s,blockExplorers:o}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:lr(r),chainName:n,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:o?Object.values(o).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}const TS=256;let db=TS,fb;function gZ(t=11){if(!fb||db+t>TS*2){fb="",db=0;for(let e=0;e{const _=v(E);for(const C in m)delete _[C];const A={...E,..._};return Object.assign(A,{extend:w(A)})}}return Object.assign(m,{extend:w(m)})}const hb=new l8(8192);function i_e(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(hb.get(r))return hb.get(r);const n=t().finally(()=>hb.delete(r));return hb.set(r,n),n}function $S(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const l=async({error:c})=>{const u=typeof e=="function"?e({count:a,error:c}):e;u&&await IS(u),o({count:a+1})};try{const c=await t();i(c)}catch(c){if(a{const{dedupe:i=!1,retryDelay:s=150,retryCount:o=3,uid:a}={...e,...n},l=i?Vi(eg(`${a}.${Zi(r)}`)):void 0;return i_e(()=>$S(async()=>{try{return await t(r)}catch(c){const u=c;switch(u.code){case O2.code:throw new O2(u);case j2.code:throw new j2(u);case D2.code:throw new D2(u,{method:r.method});case L2.code:throw new L2(u);case x0.code:throw new x0(u);case E0.code:throw new E0(u);case F2.code:throw new F2(u);case U2.code:throw new U2(u);case B2.code:throw new B2(u);case W2.code:throw new W2(u,{method:r.method});case tg.code:throw new tg(u);case z2.code:throw new z2(u);case O1.code:throw new O1(u);case H2.code:throw new H2(u);case q2.code:throw new q2(u);case V2.code:throw new V2(u);case G2.code:throw new G2(u);case K2.code:throw new K2(u);case 5e3:throw new O1(u);default:throw c instanceof Je?c:new J4e(u)}}},{delay:({count:c,error:u})=>{var f;if(u&&u instanceof Hy){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===tg.code||t.code===x0.code:t instanceof Hy&&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 yZ({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){const l=gZ();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:s_e(r,{retryCount:n,retryDelay:i,uid:l}),value:a}}function vZ(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>yZ({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}class a_e extends Je{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 l_e(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function c_e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const ZD=c_e();function u_e(t,e={}){return{async request(r){var f;const{body:n,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:o=e.timeout??1e4}=r,a={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:l,method:c,signal:u}=a;try{const h=await l_e(async({signal:m})=>{const w={...a,body:Array.isArray(n)?Zi(n.map(A=>({jsonrpc:"2.0",id:A.id??ZD.take(),...A}))):Zi({jsonrpc:"2.0",id:n.id??ZD.take(),...n}),headers:{"Content-Type":"application/json",...l},method:c||"POST",signal:u||(o>0?m:null)},E=new Request(t,w),v=await(i==null?void 0:i(E,w))??{...w,url:t};return await fetch(v.url??t,v)},{errorInstance:new UD({body:n,url:t}),timeout:o,signal:!0});s&&await s(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 Hy({body:n,details:Zi(g.error)||h.statusText,headers:h.headers,status:h.status,url:t});return g}catch(h){throw h instanceof Hy||h instanceof UD?h:new Hy({body:n,cause:h,url:t})}}}}function Ql(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",onFetchRequest:o,onFetchResponse:a,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,E=t||(c==null?void 0:c.rpcUrls.default.http[0]);if(!E)throw new a_e;const v=u_e(E,{fetchOptions:n,onRequest:o,onResponse:a,timeout:w});return yZ({key:i,name:s,async request({method:_,params:A}){const C={method:_,params:A},{schedule:R}=hZ({id:E,wait:g,shouldSplitBatch(G){return G.length>h},fn:G=>v.request({body:G}),sort:(G,oe)=>G.id-oe.id}),B=async G=>r?R(G):[await v.request({body:G})],[{error:S,result:U}]=await B(C);if(S)throw new J$({body:C,error:S,url:E});return U},retryCount:m,retryDelay:l,timeout:w,type:"http"},{fetchOptions:n,url:E})}}function hk(t,e){var n,i,s,o,a,l;if(!(t instanceof Je))return!1;const r=t.walk(c=>c instanceof gS);return r instanceof gS?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((s=r.data)==null?void 0:s.errorName)==="ResolverNotContract"||((o=r.data)==null?void 0:o.errorName)==="ResolverError"||((a=r.data)==null?void 0:a.errorName)==="HttpError"||(l=r.reason)!=null&&l.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===DY[50]):!1}function wZ(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return Zl(e)?e:null}function g5(t){let e=new Uint8Array(32).fill(0);if(!t)return vi(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=wZ(r[n]),s=i?Ug(i):Vi(Xh(r[n]),"bytes");e=Vi(md([e,s]),"bytes")}return vi(e)}function d_e(t){return`[${t.slice(2)}]`}function f_e(t){const e=new Uint8Array(32).fill(0);return t?wZ(t)||Vi(Xh(t)):vi(e)}function E8(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(Xh(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=Xh(d_e(f_e(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function h_e(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let l=a;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=qg({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c=oc({abi:GD,functionName:"addr",...n!=null?{args:[g5(i),BigInt(n)]}:{args:[g5(i)]}}),u={address:l,abi:cZ,functionName:"resolve",args:[ur(E8(i)),c],blockNumber:e,blockTag:r},f=nr(t,vd,"readContract"),h=s?await f({...u,args:[...u.args,s]}):await f(u);if(h[0]==="0x")return null;const g=q0({abi:GD,args:n!=null?[g5(i),BigInt(n)]:void 0,functionName:"addr",data:h[0]});return g==="0x"||ql(g)==="0x00"?null:g}catch(c){if(o)throw c;if(hk(c,"resolve"))return null;throw c}}class p_e extends Je{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 Zm extends Je{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class pk extends Je{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 g_e extends Je{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const m_e=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,y_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\-.]+))?(?\/.*)?$/,v_e=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,w_e=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function b_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 JD(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function bZ({uri:t,gatewayUrls:e}){const r=v_e.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=JD(e==null?void 0:e.ipfs,"https://ipfs.io"),i=JD(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(m_e),{protocol:o,subpath:a,target:l,subtarget:c=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||y_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(o==="ar:/"&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let h=t.replace(w_e,"");if(h.startsWith("i.json());return await gk({gatewayUrls:t,uri:_Z(r)})}catch{throw new pk({uri:e})}}async function gk({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=bZ({uri:e,gatewayUrls:t});if(n||await b_e(r))return r;throw new pk({uri:e})}function x_e(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,l]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Zm({reason:"Only EIP-155 supported"});if(!o)throw new Zm({reason:"Chain ID not found"});if(!l)throw new Zm({reason:"Contract address not found"});if(!i)throw new Zm({reason:"Token ID not found"});if(!a)throw new Zm({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:a.toLowerCase(),contractAddress:l,tokenID:i}}async function E_e(t,{nft:e}){if(e.namespace==="erc721")return vd(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 vd(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 g_e({namespace:e.namespace})}async function C_e(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?A_e(t,{gatewayUrls:e,record:r}):gk({uri:r,gatewayUrls:e})}async function A_e(t,{gatewayUrls:e,record:r}){const n=x_e(r),i=await E_e(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=bZ({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const c=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(c);return gk({uri:_Z(u),gatewayUrls:e})}let l=n.tokenID;return n.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),__e({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,l)})}async function xZ(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let l=a;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=qg({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c={address:l,abi:cZ,functionName:"resolve",args:[ur(E8(n)),oc({abi:VD,functionName:"text",args:[g5(n),i]})],blockNumber:e,blockTag:r},u=nr(t,vd,"readContract"),f=s?await u({...c,args:[...c.args,s]}):await u(c);if(f[0]==="0x")return null;const h=q0({abi:VD,functionName:"text",data:f[0]});return h===""?null:h}catch(c){if(o)throw c;if(hk(c,"resolve"))return null;throw c}}async function S_e(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const l=await nr(t,xZ,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!l)return null;try{return await C_e(t,{record:l,gatewayUrls:n})}catch{return null}}async function I_e(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:s,universalResolverAddress:o}){let a=o;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=qg({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const l=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const c={address:a,abi:P8e,functionName:"reverse",args:[ur(E8(l))],blockNumber:r,blockTag:n},u=nr(t,vd,"readContract"),[f,h]=i?await u({...c,args:[...c.args,i]}):await u(c);return e.toLowerCase()!==h.toLowerCase()?null:f}catch(c){if(s)throw c;if(hk(c,"reverse"))return null;throw c}}async function T_e(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=qg({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await nr(t,vd,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ur(E8(n))],blockNumber:e,blockTag:r});return o}async function $_e(t,e){var E,v,_;const{account:r=t.account,blockNumber:n,blockTag:i="latest",blobs:s,data:o,gas:a,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g,...m}=e,w=r?so(r):void 0;try{H0(e);const C=(n?lr(n):void 0)||i,R=(_=(v=(E=t.chain)==null?void 0:E.formatters)==null?void 0:v.transactionRequest)==null?void 0:_.format,S=(R||Hg)({...p8(m,{format:R}),from:w==null?void 0:w.address,blobs:s,data:o,gas:a,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g}),U=await t.request({method:"eth_createAccessList",params:[S,C]});return{accessList:U.accessList,gasUsed:BigInt(U.gasUsed)}}catch(A){throw dZ(A,{...e,account:w,chain:t.chain})}}async function k_e(t){const e=u8(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function EZ(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const l=i??(n?[n]:void 0),c=u8(t,{method:"eth_newFilter"});let u=[];l&&(u=[l.flatMap(g=>Ov({abi:[g],eventName:g.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?lr(s):s,toBlock:typeof a=="bigint"?lr(a):a,...u.length?{topics:u}:{}}]});return{abi:l,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:c(f),strict:!!o,toBlock:a,type:"event"}}async function CZ(t){const e=u8(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function N_e(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}async function P_e(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?lr(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]},{dedupe:!!i}),iu(s)}async function QD(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?lr(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]},{dedupe:!!i});if(s!=="0x")return s}function R_e(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 M_e(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?lr(r):void 0,o=await t.request({method:"eth_feeHistory",params:[lr(e),s||n,i]},{dedupe:!!s});return R_e(o)}async function O_e(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>yd(s));return e.abi?ck({abi:e.abi,logs:i,strict:r}):i}function j_e(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}class D_e extends Je{constructor({domain:e}){super(`Invalid domain "${Zi(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class L_e extends Je{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 F_e extends Je{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function U_e(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:kZ({domain:e}),...t.types};$Z({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(B_e({domain:e,types:i})),n!=="EIP712Domain"&&s.push(AZ({data:r,primaryType:n,types:i})),Vi(md(s))}function B_e({domain:t,types:e}){return AZ({data:t,primaryType:"EIP712Domain",types:e})}function AZ({data:t,primaryType:e,types:r}){const n=SZ({data:t,primaryType:e,types:r});return Vi(n)}function SZ({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[W_e({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=TZ({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return Bg(n,i)}function W_e({primaryType:t,types:e}){const r=ur(z_e({primaryType:t,types:e}));return Vi(r)}function z_e({primaryType:t,types:e}){let r="";const n=IZ({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return r}function IZ({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 s of e[i])IZ({primaryType:s.type,types:e},r);return r}function TZ({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Vi(SZ({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Vi(n)];if(r==="string")return[{type:"bytes32"},Vi(ur(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>TZ({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},Vi(Bg(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function H_e(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(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},o=i.EIP712Domain?e?s(i.EIP712Domain,e):{}:{},a=(()=>{if(n!=="EIP712Domain")return s(i[n],r)})();return Zi({domain:o,message:a,primaryType:n,types:i})}function $Z(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(o,a)=>{for(const l of o){const{name:c,type:u}=l,f=a[c],h=u.match(MY);if(h&&(typeof f=="number"||typeof f=="bigint")){const[w,E,v]=h;lr(f,{signed:E==="int",size:Number.parseInt(v)/8})}if(u==="address"&&typeof f=="string"&&!Mn(f))throw new to({address:f});const g=u.match(d4e);if(g){const[w,E]=g;if(E&&ei(f)!==Number.parseInt(E))throw new x6e({expectedSize:Number.parseInt(E),givenSize:ei(f)})}const m=i[u];m&&(q_e(u),s(m,f))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new D_e({domain:e});s(i.EIP712Domain,e)}if(n!=="EIP712Domain")if(i[n])s(i[n],r);else throw new L_e({primaryType:n,types:i})}function kZ({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 q_e(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new F_e({type:t})}function V_e(t){const{abi:e,data:r}=t,n=_0(r,0,4),i=e.find(s=>s.type==="function"&&n===c8(nu(s)));if(!i)throw new b6e(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?Wg(i.inputs,_0(r,4)):void 0}}const G_e={"0x0":"reverted","0x1":"success"};function NZ(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=>yd(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?iu(t.transactionIndex):null,status:t.status?G_e[t.status]:null,type:t.type?YY[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const K_e=Q$("transactionReceipt",NZ),Y_e=`Ethereum Signed Message: -`;function Z_e(t){const e=typeof t=="string"?eg(t):typeof t.raw=="string"?t.raw:vi(t.raw),r=eg(`${Y_e}${ei(e)}`);return md([r,e])}function PZ(t,e){return Vi(Z_e(t),e)}const RZ="0x6492649264926492649264926492649264926492649264926492649264926492";function J_e(t){return RY(t,-32)===RZ}function Q_e(t){const{address:e,data:r,signature:n,to:i="hex"}=t,s=cu([Bg([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,r,n]),RZ]);return i==="hex"?s:Jl(s)}function X_e(t){const{authorizationList:e}=t;if(e)for(const r of e){const{contractAddress:n,chainId:i}=r;if(!Mn(n))throw new to({address:n});if(i<0)throw new v8({chainId:i})}mk(t)}function e7e(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new rZ;for(const r of e){const n=ei(r),i=iu(_0(r,0,1));if(n!==32)throw new S8e({hash:r,size:n});if(i!==tZ)throw new I8e({hash:r,version:i})}}mk(t)}function mk(t){const{chainId:e,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=t;if(e<=0)throw new v8({chainId:e});if(i&&!Mn(i))throw new to({address:i});if(n&&n>g8)throw new A0({maxFeePerGas:n});if(r&&n&&r>n)throw new Y2({maxFeePerGas:n,maxPriorityFeePerGas:r})}function t7e(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:s}=t;if(e<=0)throw new v8({chainId:e});if(s&&!Mn(s))throw new to({address:s});if(r||i)throw new Je("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>g8)throw new A0({maxFeePerGas:n})}function r7e(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:s}=t;if(s&&!Mn(s))throw new to({address:s});if(typeof e<"u"&&e<=0)throw new v8({chainId:e});if(r||i)throw new Je("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>g8)throw new A0({maxFeePerGas:n})}function n7e(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{contractAddress:n,chainId:i,nonce:s,...o}=r;e.push([i?ur(i):"0x",n,s?ur(s):"0x",...zv({},o)])}return e}function C8(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(B=>vi(B)),C=t.kzg,R=nk({blobs:A,kzg:C});if(typeof h>"u"&&(h=QY({commitments:R})),typeof g>"u"){const B=ik({blobs:A,commitments:R,kzg:C});g=nZ({blobs:A,commitments:R,proofs:B})}}const m=C8(u),w=[ur(r),i?ur(i):"0x",c?ur(c):"0x",l?ur(l):"0x",n?ur(n):"0x",s??"0x",o?ur(o):"0x",f??"0x",m,a?ur(a):"0x",h??[],...zv(t,e)],E=[],v=[],_=[];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 B4e({v:e.v});return g})(),f=ql(e.r),h=ql(e.s);c=[...c,ur(u),f==="0x00"?"0x":f,h==="0x00"?"0x":h]}else r>0&&(c=[...c,ur(r),"0x","0x"]);return jf(c)}function zv(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 s=ql(r.r),o=ql(r.s);return[typeof i=="number"?i?ur(1):"0x":n===0n?"0x":n===1n?ur(1):n===27n?"0x":ur(1),s==="0x00"?"0x":s,o==="0x00"?"0x":o]}class u7e extends Je{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function d7e(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new u7e({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[s,o,a]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],l=Math.round(+`${o}.${a}`);l>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${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 MZ(t,e="wei"){return d7e(t,UY[e])}function f7e(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function h7e(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?iu(t.nonce):void 0,storageProof:t.storageProof?f7e(t.storageProof):void 0}}async function p7e(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const s=n??"latest",o=r!==void 0?lr(r):void 0,a=await t.request({method:"eth_getProof",params:[e,i,o||s]});return h7e(a)}async function g7e(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?lr(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function yk(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var u,f,h;const o=n||"latest",a=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(s)]},{dedupe:!0}):(a||o)&&(l=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,lr(s)]},{dedupe:!!a})),!l)throw new BY({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((h=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:h.format)||m8)(l)}async function m7e(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([nr(t,Bv,"getBlockNumber")({}),e?nr(t,yk,"getTransaction")({hash:e}):void 0]),s=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return s?n-s+1n:0n}async function kS(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new WY({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||NZ)(r)}async function y7e(t,e){var E;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:s,multicallAddress:o,stateOverride:a}=e,l=e.contracts,c=n??(typeof((E=t.batch)==null?void 0:E.multicall)=="object"&&t.batch.multicall.batchSize||1024);let u=o;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=qg({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=(B.length-2)/2,f[h]=[]),f[h]=[...f[h],{allowFailure:!0,callData:B,target:A}]}catch(B){const S=C0(B,{abi:_,address:A,args:C,docsPath:"/docs/contract/multicall",functionName:R});if(!r)throw S;f[h]=[...f[h],{allowFailure:!0,callData:"0x",target:A}]}}const m=await Promise.allSettled(f.map(v=>nr(t,vd,"readContract")({abi:AS,address:u,args:[v],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:a}))),w=[];for(let v=0;ve.toString(16).padStart(2,"0"));function ng(t){Hv(t);let e="";for(let r=0;r=$u._0&&t<=$u._9)return t-$u._0;if(t>=$u.A&&t<=$u.F)return t-($u.A-10);if(t>=$u.a&&t<=$u.f)return t-($u.a-10)}function ig(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,s=0;itypeof t=="bigint"&&A8<=t;function I8(t,e,r){return Y9(t)&&Y9(e)&&Y9(r)&&e<=t&&tA8;t>>=S8,e+=1);return e}function E7e(t,e){return t>>BigInt(e)&S8}function C7e(t,e,r){return t|(r?S8:A8)<(v7e<new Uint8Array(t),eL=t=>Uint8Array.from(t);function jZ(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=Z9(t),i=Z9(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...f)=>r(i,n,...f),l=(f=Z9())=>{i=a(eL([0]),f),n=a(),f.length!==0&&(i=a(eL([1]),f),n=a())},c=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{o(),l(f);let g;for(;!(g=h(c()));)l();return o(),g}}const A7e={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"||S0(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 qv(t,e,r={}){const n=(i,s,o)=>{const a=A7e[s];if(typeof a!="function")throw new Error("invalid validator function");const l=t[i];if(!(o&&l===void 0)&&!a(l,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+l)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const S7e=()=>{throw new Error("not implemented")};function NS(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}const I7e=Object.freeze(Object.defineProperty({__proto__:null,aInRange:t0,abool:rg,abytes:Hv,bitGet:E7e,bitLen:OZ,bitMask:_k,bitSet:C7e,bytesToHex:ng,bytesToNumberBE:e0,bytesToNumberLE:wk,concatBytes:Z2,createHmacDrbg:jZ,ensureBytes:Nl,equalBytes:_7e,hexToBytes:ig,hexToNumber:vk,inRange:I8,isBytes:S0,memoized:NS,notImplemented:S7e,numberToBytesBE:sg,numberToBytesLE:bk,numberToHexUnpadded:v1,numberToVarBytesBE:b7e,utf8ToBytes:x7e,validateObject:qv},Symbol.toStringTag,{value:"Module"})),T7e="0.1.1";function $7e(){return T7e}class J2 extends Error{constructor(e,r={}){const n=(()=>{var l;if(r.cause instanceof J2){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 J2&&r.cause.docsPath||r.docsPath,o=`https://oxlib.sh${i??""}`,a=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i?["",n?`Details: ${n}`:void 0,i?`See: ${o}`:void 0]:[]].filter(l=>typeof l=="string").join(` -`);super(a,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@${$7e()}`}),this.cause=r.cause,this.details=n,this.docs=o,this.docsPath=i,this.shortMessage=e}walk(e){return DZ(this,e)}}function DZ(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?DZ(t.cause,e):e?null:t}function k7e(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 R7e({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function Vu(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let s;n?r?s=(1n<s||i{const v=E,_=v.account?so(v.account):void 0,A={...v,data:v.abi?oc(v):v.data,from:v.from??(_==null?void 0:_.address)};return H0(A),Hg(A)}),w=h.stateOverrides?X$(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:s,traceTransfers:o,validation:a},u]})).map((h,g)=>({...tk(h),calls:h.calls.map((m,w)=>{var oe,K;const{abi:E,args:v,functionName:_,to:A}=i[g].calls[w],C=((oe=m.error)==null?void 0:oe.data)??m.returnData,R=BigInt(m.gasUsed),B=(K=m.logs)==null?void 0:K.map(N=>yd(N)),S=m.status==="0x1"?"success":"failure",U=E?q0({abi:E,data:C,functionName:_}):null,G=(()=>{var k;if(S==="success")return;let N;if(((k=m.error)==null?void 0:k.data)==="0x"?N=new Pv:m.error&&(N=new f8(m.error)),!!N)return C0(N,{abi:E??[],address:A,args:v,functionName:_??""})})();return{data:C,gasUsed:R,logs:B,status:S,...S==="success"?{result:U}:{error:G}}})}))}catch(l){const c=l,u=h8(c,{});throw u instanceof Lv?c:u}}function tL(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function D7e(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function T8(t,...e){if(!D7e(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 L7e(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");tL(t.outputLen),tL(t.blockLen)}function S6(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 F7e(t,e){T8(t);const r=e.outputLen;if(t.lengthnew DataView(t.buffer,t.byteOffset,t.byteLength),yc=(t,e)=>t<<32-e|t>>>e;function U7e(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function xk(t){return typeof t=="string"&&(t=U7e(t)),T8(t),t}function B7e(...t){let e=0;for(let n=0;nt().update(xk(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function z7e(t=32){if(Mp&&typeof Mp.getRandomValues=="function")return Mp.getRandomValues(new Uint8Array(t));if(Mp&&typeof Mp.randomBytes=="function")return Mp.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function H7e(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,c=n?0:4;t.setUint32(e+l,o,n),t.setUint32(e+c,a,n)}const q7e=(t,e,r)=>t&e^~t&r,V7e=(t,e,r)=>t&e^t&r^e&r;class G7e extends LZ{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=J9(this.buffer)}update(e){S6(this);const{view:r,buffer:n,blockLen:i}=this;e=xk(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=yc(g,17)^yc(g,19)^g>>>10;Jd[f]=w+Jd[f-7]+m+Jd[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=yc(a,6)^yc(a,11)^yc(a,25),g=u+h+q7e(a,l,c)+K7e[f]+Jd[f]|0,w=(yc(n,2)^yc(n,13)^yc(n,22))+V7e(n,i,s)|0;u=c,c=l,l=a,a=o+g|0,o=s,s=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,l,c,u)}roundClean(){Jd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Z7e=W7e(()=>new Y7e);let FZ=class extends LZ{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,L7e(e);const n=xk(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,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;onew FZ(t,e).update(r).digest();UZ.create=(t,e)=>new FZ(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Gi=BigInt(0),ui=BigInt(1),jh=BigInt(2),J7e=BigInt(3),PS=BigInt(4),rL=BigInt(5),nL=BigInt(8);function Eo(t,e){const r=t%e;return r>=Gi?r:e+r}function Q7e(t,e,r){if(eGi;)e&ui&&(n=n*t%r),t=t*t%r,e>>=ui;return n}function Da(t,e,r){let n=t;for(;e-- >Gi;)n*=n,n%=r;return n}function RS(t,e){if(t===Gi)throw new Error("invert: expected non-zero number");if(e<=Gi)throw new Error("invert: expected positive modulus, got "+e);let r=Eo(t,e),n=e,i=Gi,s=ui;for(;r!==Gi;){const a=n/r,l=n%r,c=i-s*a;n=r,r=l,i=s,s=c}if(n!==ui)throw new Error("invert: does not exist");return Eo(i,e)}function X7e(t){const e=(t-ui)/jh;let r,n,i;for(r=t-ui,n=0;r%jh===Gi;r/=jh,n++);for(i=jh;i1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const o=(t+ui)/PS;return function(l,c){const u=l.pow(c,o);if(!l.eql(l.sqr(u),c))throw new Error("Cannot find square root");return u}}const s=(r+ui)/jh;return function(a,l){if(a.pow(l,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let c=n,u=a.pow(a.mul(a.ONE,i),r),f=a.pow(l,s),h=a.pow(l,r);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let g=1;for(let w=a.sqr(h);g(n[i]="function",n),e);return qv(t,r)}function nxe(t,e,r){if(rGi;)r&ui&&(n=t.mul(n,i)),i=t.sqr(i),r>>=ui;return n}function ixe(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function BZ(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function WZ(t,e,r=!1,n={}){if(t<=Gi)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=BZ(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:_k(i),ZERO:Gi,ONE:ui,create:l=>Eo(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return Gi<=l&&ll===Gi,isOdd:l=>(l&ui)===ui,neg:l=>Eo(-l,t),eql:(l,c)=>l===c,sqr:l=>Eo(l*l,t),add:(l,c)=>Eo(l+c,t),sub:(l,c)=>Eo(l-c,t),mul:(l,c)=>Eo(l*c,t),pow:(l,c)=>nxe(a,l,c),div:(l,c)=>Eo(l*RS(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>RS(l,t),sqrt:n.sqrt||(l=>(o||(o=exe(t)),o(a,l))),invertBatch:l=>ixe(a,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>r?bk(l,s):sg(l,s),fromBytes:l=>{if(l.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+l.length);return r?wk(l):e0(l)}});return Object.freeze(a)}function zZ(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 HZ(t){const e=zZ(t);return e+Math.ceil(e/2)}function sxe(t,e,r=!1){const n=t.length,i=zZ(e),s=HZ(e);if(n<16||n1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const o=r?e0(t):wk(t),a=Eo(o,e-ui)+ui;return r?bk(a,i):sg(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const iL=BigInt(0),pb=BigInt(1);function Q9(t,e){const r=e.negate();return t?r:e}function qZ(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function X9(t,e){qZ(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function oxe(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 axe(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 eE=new WeakMap,VZ=new WeakMap;function tE(t){return VZ.get(t)||1}function lxe(t,e){return{constTimeNegate:Q9,hasPrecomputes(r){return tE(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>iL;)n&pb&&(i=i.add(s)),s=s.double(),n>>=pb;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=X9(n,e),o=[];let a=r,l=a;for(let c=0;c>=f,m>o&&(m-=u,i+=pb);const w=g,E=g+Math.abs(m)-1,v=h%2!==0,_=m<0;m===0?l=l.add(Q9(v,n[w])):a=a.add(Q9(_,n[E]))}return{p:a,f:l}},wNAFUnsafe(r,n,i,s=t.ZERO){const{windows:o,windowSize:a}=X9(r,e),l=BigInt(2**r-1),c=2**r,u=BigInt(r);for(let f=0;f>=u,g>a&&(g-=c,i+=pb),g===0)continue;let m=n[h+Math.abs(g)-1];g<0&&(m=m.negate()),s=s.add(m)}return s},getPrecomputes(r,n,i){let s=eE.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&eE.set(n,i(s))),s},wNAFCached(r,n,i){const s=tE(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const o=tE(r);return o===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(o,this.getPrecomputes(o,r,i),n,s)},setWindowSize(r,n){qZ(n,e),VZ.set(r,n),eE.delete(r)}}}function cxe(t,e,r,n){if(oxe(r,t),axe(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=OZ(BigInt(r.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<=0;f-=o){l.fill(i);for(let g=0;g>BigInt(f)&BigInt(a));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}=Gu;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=v1(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?v1(i.length/2|128):"";return v1(t)+s+i+e},decode(t,e){const{Err:r}=Gu;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++],s=!!(i&128);let o=0;if(!s)o=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)o=o<<8|u;if(n+=l,o<128)throw new r("tlv.decode(long): not minimal encoding")}const a=e.subarray(n,n+o);if(a.length!==o)throw new r("tlv.decode: wrong value length");return{v:a,l:e.subarray(n+o)}}},_int:{encode(t){const{Err:e}=Gu;if(t{const _=E.toAffine();return Z2(Uint8Array.from([4]),r.toBytes(_.x),r.toBytes(_.y))}),s=e.fromBytes||(w=>{const E=w.subarray(1),v=r.fromBytes(E.subarray(0,r.BYTES)),_=r.fromBytes(E.subarray(r.BYTES,2*r.BYTES));return{x:v,y:_}});function o(w){const{a:E,b:v}=e,_=r.sqr(w),A=r.mul(_,w);return r.add(r.add(A,r.mul(w,E)),v)}if(!r.eql(r.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function a(w){return I8(w,Li,e.n)}function l(w){const{allowedPrivateKeyLengths:E,nByteLength:v,wrapPrivateKey:_,n:A}=e;if(E&&typeof w!="bigint"){if(S0(w)&&(w=ng(w)),typeof w!="string"||!E.includes(w.length))throw new Error("invalid private key");w=w.padStart(v*2,"0")}let C;try{C=typeof w=="bigint"?w:e0(Nl("private key",w,v))}catch{throw new Error("invalid private key, expected hex or "+v+" bytes, got "+typeof w)}return _&&(C=Eo(C,A)),t0("private key",C,Li,A),C}function c(w){if(!(w instanceof h))throw new Error("ProjectivePoint expected")}const u=NS((w,E)=>{const{px:v,py:_,pz:A}=w;if(r.eql(A,r.ONE))return{x:v,y:_};const C=w.is0();E==null&&(E=C?r.ONE:r.inv(A));const R=r.mul(v,E),B=r.mul(_,E),S=r.mul(A,E);if(C)return{x:r.ZERO,y:r.ZERO};if(!r.eql(S,r.ONE))throw new Error("invZ was invalid");return{x:R,y:B}}),f=NS(w=>{if(w.is0()){if(e.allowInfinityPoint&&!r.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:E,y:v}=w.toAffine();if(!r.isValid(E)||!r.isValid(v))throw new Error("bad point: x or y not FE");const _=r.sqr(v),A=o(E);if(!r.eql(_,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(E,v,_){if(this.px=E,this.py=v,this.pz=_,E==null||!r.isValid(E))throw new Error("x required");if(v==null||!r.isValid(v))throw new Error("y required");if(_==null||!r.isValid(_))throw new Error("z required");Object.freeze(this)}static fromAffine(E){const{x:v,y:_}=E||{};if(!E||!r.isValid(v)||!r.isValid(_))throw new Error("invalid affine point");if(E instanceof h)throw new Error("projective point not allowed");const A=C=>r.eql(C,r.ZERO);return A(v)&&A(_)?h.ZERO:new h(v,_,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(E){const v=r.invertBatch(E.map(_=>_.pz));return E.map((_,A)=>_.toAffine(v[A])).map(h.fromAffine)}static fromHex(E){const v=h.fromAffine(s(Nl("pointHex",E)));return v.assertValidity(),v}static fromPrivateKey(E){return h.BASE.multiply(l(E))}static msm(E,v){return cxe(h,n,E,v)}_setWindowSize(E){m.setWindowSize(this,E)}assertValidity(){f(this)}hasEvenY(){const{y:E}=this.toAffine();if(r.isOdd)return!r.isOdd(E);throw new Error("Field doesn't support isOdd")}equals(E){c(E);const{px:v,py:_,pz:A}=this,{px:C,py:R,pz:B}=E,S=r.eql(r.mul(v,B),r.mul(C,A)),U=r.eql(r.mul(_,B),r.mul(R,A));return S&&U}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:E,b:v}=e,_=r.mul(v,oL),{px:A,py:C,pz:R}=this;let B=r.ZERO,S=r.ZERO,U=r.ZERO,G=r.mul(A,A),oe=r.mul(C,C),K=r.mul(R,R),N=r.mul(A,C);return N=r.add(N,N),U=r.mul(A,R),U=r.add(U,U),B=r.mul(E,U),S=r.mul(_,K),S=r.add(B,S),B=r.sub(oe,S),S=r.add(oe,S),S=r.mul(B,S),B=r.mul(N,B),U=r.mul(_,U),K=r.mul(E,K),N=r.sub(G,K),N=r.mul(E,N),N=r.add(N,U),U=r.add(G,G),G=r.add(U,G),G=r.add(G,K),G=r.mul(G,N),S=r.add(S,G),K=r.mul(C,R),K=r.add(K,K),G=r.mul(K,N),B=r.sub(B,G),U=r.mul(K,oe),U=r.add(U,U),U=r.add(U,U),new h(B,S,U)}add(E){c(E);const{px:v,py:_,pz:A}=this,{px:C,py:R,pz:B}=E;let S=r.ZERO,U=r.ZERO,G=r.ZERO;const oe=e.a,K=r.mul(e.b,oL);let N=r.mul(v,C),k=r.mul(_,R),b=r.mul(A,B),x=r.add(v,_),P=r.add(C,R);x=r.mul(x,P),P=r.add(N,k),x=r.sub(x,P),P=r.add(v,A);let L=r.add(C,B);return P=r.mul(P,L),L=r.add(N,b),P=r.sub(P,L),L=r.add(_,A),S=r.add(R,B),L=r.mul(L,S),S=r.add(k,b),L=r.sub(L,S),G=r.mul(oe,P),S=r.mul(K,b),G=r.add(S,G),S=r.sub(k,G),G=r.add(k,G),U=r.mul(S,G),k=r.add(N,N),k=r.add(k,N),b=r.mul(oe,b),P=r.mul(K,P),k=r.add(k,b),b=r.sub(N,b),b=r.mul(oe,b),P=r.add(P,b),N=r.mul(k,P),U=r.add(U,N),N=r.mul(L,P),S=r.mul(x,S),S=r.sub(S,N),N=r.mul(x,k),G=r.mul(L,G),G=r.add(G,N),new h(S,U,G)}subtract(E){return this.add(E.negate())}is0(){return this.equals(h.ZERO)}wNAF(E){return m.wNAFCached(this,E,h.normalizeZ)}multiplyUnsafe(E){const{endo:v,n:_}=e;t0("scalar",E,Qu,_);const A=h.ZERO;if(E===Qu)return A;if(this.is0()||E===Li)return this;if(!v||m.hasPrecomputes(this))return m.wNAFCachedUnsafe(this,E,h.normalizeZ);let{k1neg:C,k1:R,k2neg:B,k2:S}=v.splitScalar(E),U=A,G=A,oe=this;for(;R>Qu||S>Qu;)R&Li&&(U=U.add(oe)),S&Li&&(G=G.add(oe)),oe=oe.double(),R>>=Li,S>>=Li;return C&&(U=U.negate()),B&&(G=G.negate()),G=new h(r.mul(G.px,v.beta),G.py,G.pz),U.add(G)}multiply(E){const{endo:v,n:_}=e;t0("scalar",E,Li,_);let A,C;if(v){const{k1neg:R,k1:B,k2neg:S,k2:U}=v.splitScalar(E);let{p:G,f:oe}=this.wNAF(B),{p:K,f:N}=this.wNAF(U);G=m.constTimeNegate(R,G),K=m.constTimeNegate(S,K),K=new h(r.mul(K.px,v.beta),K.py,K.pz),A=G.add(K),C=oe.add(N)}else{const{p:R,f:B}=this.wNAF(E);A=R,C=B}return h.normalizeZ([A,C])[0]}multiplyAndAddUnsafe(E,v,_){const A=h.BASE,C=(B,S)=>S===Qu||S===Li||!B.equals(A)?B.multiplyUnsafe(S):B.multiply(S),R=C(this,v).add(C(E,_));return R.is0()?void 0:R}toAffine(E){return u(this,E)}isTorsionFree(){const{h:E,isTorsionFree:v}=e;if(E===Li)return!0;if(v)return v(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:E,clearCofactor:v}=e;return E===Li?this:v?v(h,this):this.multiplyUnsafe(e.h)}toRawBytes(E=!0){return rg("isCompressed",E),this.assertValidity(),i(h,this,E)}toHex(E=!0){return rg("isCompressed",E),ng(this.toRawBytes(E))}}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=lxe(h,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}function pxe(t){const e=GZ(t);return qv(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function gxe(t){const e=pxe(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function o(b){return Eo(b,n)}function a(b){return RS(b,n)}const{ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:u,isWithinCurveOrder:f}=hxe({...e,toBytes(b,x,P){const L=x.toAffine(),O=r.toBytes(L.x),j=Z2;return rg("isCompressed",P),P?j(Uint8Array.from([x.hasEvenY()?2:3]),O):j(Uint8Array.from([4]),O,r.toBytes(L.y))},fromBytes(b){const x=b.length,P=b[0],L=b.subarray(1);if(x===i&&(P===2||P===3)){const O=e0(L);if(!I8(O,Li,r.ORDER))throw new Error("Point is not on curve");const j=u(O);let I;try{I=r.sqrt(j)}catch(X){const le=X instanceof Error?": "+X.message:"";throw new Error("Point is not on curve"+le)}const D=(I&Li)===Li;return(P&1)===1!==D&&(I=r.neg(I)),{x:O,y:I}}else if(x===s&&P===4){const O=r.fromBytes(L.subarray(0,r.BYTES)),j=r.fromBytes(L.subarray(r.BYTES,2*r.BYTES));return{x:O,y:j}}else{const O=i,j=s;throw new Error("invalid Point, expected length of "+O+", or uncompressed "+j+", got "+x)}}}),h=b=>ng(sg(b,e.nByteLength));function g(b){const x=n>>Li;return b>x}function m(b){return g(b)?o(-b):b}const w=(b,x,P)=>e0(b.slice(x,P));class E{constructor(x,P,L){this.r=x,this.s=P,this.recovery=L,this.assertValidity()}static fromCompact(x){const P=e.nByteLength;return x=Nl("compactSignature",x,P*2),new E(w(x,0,P),w(x,P,2*P))}static fromDER(x){const{r:P,s:L}=Gu.toSig(Nl("DER",x));return new E(P,L)}assertValidity(){t0("r",this.r,Li,n),t0("s",this.s,Li,n)}addRecoveryBit(x){return new E(this.r,this.s,x)}recoverPublicKey(x){const{r:P,s:L,recovery:O}=this,j=B(Nl("msgHash",x));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const I=O===2||O===3?P+e.n:P;if(I>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const D=O&1?"03":"02",M=l.fromHex(D+h(I)),X=a(I),le=o(-j*X),H=o(L*X),ee=l.BASE.multiplyAndAddUnsafe(M,le,H);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new E(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return ig(this.toDERHex())}toDERHex(){return Gu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ig(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(b){try{return c(b),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const b=HZ(e.n);return sxe(e.randomBytes(b),e.n)},precompute(b=8,x=l.BASE){return x._setWindowSize(b),x.multiply(BigInt(3)),x}};function _(b,x=!0){return l.fromPrivateKey(b).toRawBytes(x)}function A(b){const x=S0(b),P=typeof b=="string",L=(x||P)&&b.length;return x?L===i||L===s:P?L===2*i||L===2*s:b instanceof l}function C(b,x,P=!0){if(A(b))throw new Error("first arg must be private key");if(!A(x))throw new Error("second arg must be public key");return l.fromHex(x).multiply(c(b)).toRawBytes(P)}const R=e.bits2int||function(b){if(b.length>8192)throw new Error("input is too large");const x=e0(b),P=b.length*8-e.nBitLength;return P>0?x>>BigInt(P):x},B=e.bits2int_modN||function(b){return o(R(b))},S=_k(e.nBitLength);function U(b){return t0("num < 2^"+e.nBitLength,b,Qu,S),sg(b,e.nByteLength)}function G(b,x,P=oe){if(["recovered","canonical"].some(te=>te in P))throw new Error("sign() legacy options not supported");const{hash:L,randomBytes:O}=e;let{lowS:j,prehash:I,extraEntropy:D}=P;j==null&&(j=!0),b=Nl("msgHash",b),sL(P),I&&(b=Nl("prehashed msgHash",L(b)));const M=B(b),X=c(x),le=[U(X),U(M)];if(D!=null&&D!==!1){const te=D===!0?O(r.BYTES):D;le.push(Nl("extraEntropy",te))}const H=Z2(...le),ee=M;function Z(te){const re=R(te);if(!f(re))return;const W=a(re),q=l.BASE.multiply(re).toAffine(),J=o(q.x);if(J===Qu)return;const me=o(W*o(ee+J*X));if(me===Qu)return;let be=(q.x===J?0:2)|Number(q.y&Li),Ce=me;return j&&g(me)&&(Ce=m(me),be^=1),new E(J,Ce,be)}return{seed:H,k2sig:Z}}const oe={lowS:e.lowS,prehash:!1},K={lowS:e.lowS,prehash:!1};function N(b,x,P=oe){const{seed:L,k2sig:O}=G(b,x,P),j=e;return jZ(j.hash.outputLen,j.nByteLength,j.hmac)(L,O)}l.BASE._setWindowSize(8);function k(b,x,P,L=K){var be;const O=b;x=Nl("msgHash",x),P=Nl("publicKey",P);const{lowS:j,prehash:I,format:D}=L;if(sL(L),"strict"in L)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 M=typeof O=="string"||S0(O),X=!M&&!D&&typeof O=="object"&&O!==null&&typeof O.r=="bigint"&&typeof O.s=="bigint";if(!M&&!X)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let le,H;try{if(X&&(le=new E(O.r,O.s)),M){try{D!=="compact"&&(le=E.fromDER(O))}catch(Ce){if(!(Ce instanceof Gu.Err))throw Ce}!le&&D!=="der"&&(le=E.fromCompact(O))}H=l.fromHex(P)}catch{return!1}if(!le||j&&le.hasHighS())return!1;I&&(x=e.hash(x));const{r:ee,s:Z}=le,te=B(x),re=a(Z),W=o(te*re),q=o(ee*re),J=(be=l.BASE.multiplyAndAddUnsafe(H,W,q))==null?void 0:be.toAffine();return J?o(J.x)===ee:!1}return{CURVE:e,getPublicKey:_,getSharedSecret:C,sign:N,verify:k,ProjectivePoint:l,Signature:E,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function mxe(t){return{hash:t,hmac:(e,...r)=>UZ(t,e,B7e(...r)),randomBytes:z7e}}function yxe(t,e){const r=n=>gxe({...t,...mxe(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const KZ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),aL=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),vxe=BigInt(1),MS=BigInt(2),lL=(t,e)=>(t+e/MS)/e;function wxe(t){const e=KZ,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=Da(u,r,e)*u%e,h=Da(f,r,e)*u%e,g=Da(h,MS,e)*c%e,m=Da(g,i,e)*g%e,w=Da(m,s,e)*m%e,E=Da(w,a,e)*w%e,v=Da(E,l,e)*E%e,_=Da(v,a,e)*w%e,A=Da(_,r,e)*u%e,C=Da(A,o,e)*m%e,R=Da(C,n,e)*c%e,B=Da(R,MS,e);if(!OS.eql(OS.sqr(B),t))throw new Error("Cannot find square root");return B}const OS=WZ(KZ,void 0,void 0,{sqrt:wxe}),Ek=yxe({a:BigInt(0),b:BigInt(7),Fp:OS,n:aL,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=aL,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-vxe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=lL(s*t,e),l=lL(-n*t,e);let c=Eo(t-a*r-l*i,e),u=Eo(-a*n-l*s,e);const f=c>o,h=u>o;if(f&&(c=e-c),h&&(u=e-u),c>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},Z7e);BigInt(0);Ek.ProjectivePoint;const bxe=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Ek},Symbol.toStringTag,{value:"Module"}));function _xe({r:t,s:e,to:r="hex",v:n,yParity:i}){const s=(()=>{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")})(),o=`0x${new Ek.Signature(la(t),la(e)).toCompactHex()}${s===0?"1b":"1c"}`;return r==="hex"?o:Jl(o)}async function Ck(t,e){var f,h,g;const{address:r,factory:n,factoryData:i,hash:s,signature:o,universalSignatureVerifierAddress:a=(g=(h=(f=t.chain)==null?void 0:f.contracts)==null?void 0:h.universalSignatureVerifier)==null?void 0:g.address,...l}=e,c=Zl(o)?o:typeof o=="object"&&"r"in o&&"s"in o?_xe(o):vi(o),u=await(async()=>!n&&!i||J_e(c)?c:Q_e({address:n,data:i,signature:c}))();try{const m=a?{to:a,data:oc({abi:KD,functionName:"isValidSig",args:[r,s,u]}),...l}:{data:w8({abi:KD,args:[r,s,u],bytecode:j8e}),...l},{data:w}=await nr(t,b8,"call")(m);return P6e(w??"0x0")}catch(m){try{if(ak(q$(r),await HY({hash:s,signature:o})))return!0}catch{}if(m instanceof zY)return!1;throw m}}async function xxe(t,{address:e,message:r,factory:n,factoryData:i,signature:s,...o}){const a=PZ(r);return Ck(t,{address:e,factory:n,factoryData:i,hash:a,signature:s,...o})}async function Exe(t,e){const{address:r,factory:n,factoryData:i,signature:s,message:o,primaryType:a,types:l,domain:c,...u}=e,f=U_e({message:o,primaryType:a,types:l,domain:c});return Ck(t,{address:r,factory:n,factoryData:i,hash:f,signature:s,...u})}function YZ(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:o=t.pollingInterval}){const a=typeof s<"u"?s:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let l;return a?(()=>{const f=Zi(["watchBlockNumber",t.uid,e,r,o]);return Df(f,{onBlockNumber:n,onError:i},h=>Uv(async()=>{var g;try{const m=await nr(t,Bv,"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:o}))})():(()=>{const f=Zi(["watchBlockNumber",t.uid,e,r]);return Df(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(_=>_.config.type==="webSocket");return v?v.value:t.transport}return t.transport})(),{unsubscribe:E}=await w.subscribe({params:["newHeads"],onData(v){var A;if(!g)return;const _=la((A=v.result)==null?void 0:A.number);h.onBlockNumber(_,l),l=_},onError(v){var _;(_=h.onError)==null||_.call(h,v)}});m=E,g||m()}catch(w){i==null||i(w)}})(),()=>m()})})()}async function Cxe(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:o=({count:l})=>~~(1<w(new q4e({hash:r})),a):void 0,v=Df(l,{onReplaced:n,resolve:m,reject:w},_=>{const A=nr(t,YZ,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(C){const R=S=>{clearTimeout(E),A(),S(),v()};let B=C;if(!h)try{if(f){if(e>1&&(!f.blockNumber||B-f.blockNumber+1n_.resolve(f));return}if(c||(h=!0,await $S(async()=>{c=await nr(t,yk,"getTransaction")({hash:r}),c.blockNumber&&(B=c.blockNumber)},{delay:o,retryCount:s}),h=!1),f=await nr(t,kS,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||B-f.blockNumber+1n_.resolve(f))}catch(S){if(S instanceof BY||S instanceof WY){if(!c){h=!1;return}try{u=c,h=!0;const U=await $S(()=>nr(t,Lc,"getBlock")({blockNumber:B,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:K})=>K instanceof KY});h=!1;const G=U.transactions.find(({from:K,nonce:N})=>K===u.from&&N===u.nonce);if(!G||(f=await nr(t,kS,"getTransactionReceipt")({hash:G.hash}),e>1&&(!f.blockNumber||B-f.blockNumber+1n{var K;(K=_.onReplaced)==null||K.call(_,{reason:oe,replacedTransaction:u,transaction:G,transactionReceipt:f}),_.resolve(f)})}catch(U){R(()=>_.reject(U))}}else R(()=>_.reject(S))}}})});return g}function Axe(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:o,poll:a,pollingInterval:l=t.pollingInterval}){const c=typeof a<"u"?a:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),u=o??!1;let f;return c?(()=>{const m=Zi(["watchBlocks",t.uid,e,r,n,u,l]);return Df(m,{onBlock:i,onError:s},w=>Uv(async()=>{var E;try{const v=await nr(t,Lc,"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 _=(f==null?void 0:f.number)+1n;_f.number)&&(w.onBlock(v,f),f=v)}catch(v){(E=w.onError)==null||E.call(w,v)}},{emitOnBegin:n,interval:l}))})():(()=>{let m=!0,w=!0,E=()=>m=!1;return(async()=>{try{n&&nr(t,Lc,"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(C=>C.config.type==="webSocket");return A?A.value:t.transport}return t.transport})(),{unsubscribe:_}=await v.subscribe({params:["newHeads"],async onData(A){if(!m)return;const C=await nr(t,Lc,"getBlock")({blockNumber:A.blockNumber,includeTransactions:u}).catch(()=>{});m&&(i(C,f),w=!1,f=C)},onError(A){s==null||s(A)}});E=_,m||E()}catch(v){s==null||s(v)}})(),()=>E()})()}function Sxe(t,{address:e,args:r,batch:n=!0,event:i,events:s,fromBlock:o,onError:a,onLogs:l,poll:c,pollingInterval:u=t.pollingInterval,strict:f}){const h=typeof c<"u"?c:typeof o=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),g=f??!1;return h?(()=>{const E=Zi(["watchEvent",e,r,n,t.uid,i,u,o]);return Df(E,{onLogs:l,onError:a},v=>{let _;o!==void 0&&(_=o-1n);let A,C=!1;const R=Uv(async()=>{var B;if(!C){try{A=await nr(t,EZ,"createEventFilter")({address:e,args:r,event:i,events:s,strict:g,fromBlock:o})}catch{}C=!0;return}try{let S;if(A)S=await nr(t,_8,"getFilterChanges")({filter:A});else{const U=await nr(t,Bv,"getBlockNumber")({});_&&_!==U?S=await nr(t,uk,"getLogs")({address:e,args:r,event:i,events:s,fromBlock:_+1n,toBlock:U}):S=[],_=U}if(S.length===0)return;if(n)v.onLogs(S);else for(const U of S)v.onLogs([U])}catch(S){A&&S instanceof E0&&(C=!1),(B=v.onError)==null||B.call(v,S)}},{emitOnBegin:!0,interval:u});return async()=>{A&&await nr(t,x8,"uninstallFilter")({filter:A}),R()}})})():(()=>{let E=!0,v=()=>E=!1;return(async()=>{try{const _=(()=>{if(t.transport.type==="fallback"){const B=t.transport.transports.find(S=>S.config.type==="webSocket");return B?B.value:t.transport}return t.transport})(),A=s??(i?[i]:void 0);let C=[];A&&(C=[A.flatMap(S=>Ov({abi:[S],eventName:S.name,args:r}))],i&&(C=C[0]));const{unsubscribe:R}=await _.subscribe({params:["logs",{address:e,topics:C}],onData(B){var U;if(!E)return;const S=B.result;try{const{eventName:G,args:oe}=lk({abi:A??[],data:S.data,topics:S.topics,strict:g}),K=yd(S,{args:oe,eventName:G});l([K])}catch(G){let oe,K;if(G instanceof R2||G instanceof o8){if(f)return;oe=G.abiItem.name,K=(U=G.abiItem.inputs)==null?void 0:U.some(k=>!("name"in k&&k.name))}const N=yd(S,{args:K?[]:{},eventName:oe});l([N])}},onError(B){a==null||a(B)}});v=R,E||v()}catch(_){a==null||a(_)}})(),()=>v()})()}function Ixe(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const c=Zi(["watchPendingTransactions",t.uid,e,s]);return Df(c,{onTransactions:n,onError:r},u=>{let f;const h=Uv(async()=>{var g;try{if(!f)try{f=await nr(t,CZ,"createPendingTransactionFilter")({});return}catch(w){throw h(),w}const m=await nr(t,_8,"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:s});return async()=>{f&&await nr(t,x8,"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 Txe(t){var f,h,g;const{scheme:e,statement:r,...n}=((f=t.match($xe))==null?void 0:f.groups)??{},{chainId:i,expirationTime:s,issuedAt:o,notBefore:a,requestId:l,...c}=((h=t.match(kxe))==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)}:{},...s?{expirationTime:new Date(s)}:{},...o?{issuedAt:new Date(o)}:{},...a?{notBefore:new Date(a)}:{},...l?{requestId:l}:{},...u?{resources:u}:{},...e?{scheme:e}:{},...r?{statement:r}:{}}}const $xe=/^(?:(?[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)?/,kxe=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;function Nxe(t){const{address:e,domain:r,message:n,nonce:i,scheme:s,time:o=new Date}=t;if(r&&n.domain!==r||i&&n.nonce!==i||s&&n.scheme!==s||n.expirationTime&&o>=n.expirationTime||n.notBefore&&ob8(t,e),createAccessList:e=>$_e(t,e),createBlockFilter:()=>k_e(t),createContractEventFilter:e=>jY(t,e),createEventFilter:e=>EZ(t,e),createPendingTransactionFilter:()=>CZ(t),estimateContractGas:e=>$8e(t,e),estimateGas:e=>ok(t,e),getBalance:e=>oZ(t,e),getBlobBaseFee:()=>N_e(t),getBlock:e=>Lc(t,e),getBlockNumber:e=>Bv(t,e),getBlockTransactionCount:e=>P_e(t,e),getBytecode:e=>QD(t,e),getChainId:()=>Fv(t),getCode:e=>QD(t,e),getContractEvents:e=>aZ(t,e),getEip712Domain:e=>t_e(t,e),getEnsAddress:e=>h_e(t,e),getEnsAvatar:e=>S_e(t,e),getEnsName:e=>I_e(t,e),getEnsResolver:e=>T_e(t,e),getEnsText:e=>xZ(t,e),getFeeHistory:e=>M_e(t,e),estimateFeesPerGas:e=>g8e(t,e),getFilterChanges:e=>_8(t,e),getFilterLogs:e=>O_e(t,e),getGasPrice:()=>rk(t),getLogs:e=>uk(t,e),getProof:e=>p7e(t,e),estimateMaxPriorityFeePerGas:e=>p8e(t,e),getStorageAt:e=>g7e(t,e),getTransaction:e=>yk(t,e),getTransactionConfirmations:e=>m7e(t,e),getTransactionCount:e=>JY(t,e),getTransactionReceipt:e=>kS(t,e),multicall:e=>y7e(t,e),prepareTransactionRequest:e=>y8(t,e),readContract:e=>vd(t,e),sendRawTransaction:e=>dk(t,e),simulate:e=>j7e(t,e),simulateContract:e=>H8e(t,e),verifyMessage:e=>xxe(t,e),verifySiweMessage:e=>Pxe(t,e),verifyTypedData:e=>Exe(t,e),uninstallFilter:e=>x8(t,e),waitForTransactionReceipt:e=>Cxe(t,e),watchBlocks:e=>Axe(t,e),watchBlockNumber:e=>YZ(t,e),watchContractEvent:e=>J8e(t,e),watchEvent:e=>Sxe(t,e),watchPendingTransactions:e=>Ixe(t,e)}}function Xl(t){const{key:e="public",name:r="Public Client"}=t;return mZ({...t,key:e,name:r,type:"publicClient"}).extend(Ak)}function Rxe(t,e){const{abi:r,args:n,bytecode:i,...s}=e,o=w8({abi:r,args:n,bytecode:i});return fk(t,{...s,data:o})}async function Mxe(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=>Rv(n))}async function Oxe(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function jxe(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>q$(r))}async function Dxe(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function Lxe(t,{account:e=t.account,message:r}){if(!e)throw new Wv({docsPath:"/docs/actions/wallet/signMessage"});const n=so(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?eg(r):r.raw instanceof Uint8Array?ur(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function Fxe(t,e){var c,u,f,h;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new Wv({docsPath:"/docs/actions/wallet/signTransaction"});const s=so(r);H0({account:s,...e});const o=await nr(t,Fv,"getChainId")({});n!==null&&pZ({currentChainId:o,chain:n});const a=(n==null?void 0:n.formatters)||((c=t.chain)==null?void 0:c.formatters),l=((u=a==null?void 0:a.transactionRequest)==null?void 0:u.format)||Hg;return s.signTransaction?s.signTransaction({...i,chainId:o},{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(o),from:s.address}]},{retryCount:0})}async function Uxe(t,e){const{account:r=t.account,domain:n,message:i,primaryType:s}=e;if(!r)throw new Wv({docsPath:"/docs/actions/wallet/signTypedData"});const o=so(r),a={EIP712Domain:kZ({domain:n}),...e.types};if($Z({domain:n,message:i,primaryType:s,types:a}),o.signTypedData)return o.signTypedData({domain:n,message:i,primaryType:s,types:a});const l=H_e({domain:n,message:i,primaryType:s,types:a});return t.request({method:"eth_signTypedData_v4",params:[o.address,l]},{retryCount:0})}async function Bxe(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:lr(e)}]},{retryCount:0})}async function Wxe(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function zxe(t){return{addChain:e=>n_e(t,e),deployContract:e=>Rxe(t,e),getAddresses:()=>Mxe(t),getChainId:()=>Fv(t),getPermissions:()=>Oxe(t),prepareTransactionRequest:e=>y8(t,e),requestAddresses:()=>jxe(t),requestPermissions:e=>Dxe(t,e),sendRawTransaction:e=>dk(t,e),sendTransaction:e=>fk(t,e),signMessage:e=>Lxe(t,e),signTransaction:e=>Fxe(t,e),signTypedData:e=>Uxe(t,e),switchChain:e=>Bxe(t,e),watchAsset:e=>Wxe(t,e),writeContract:e=>X8e(t,e)}}function ZZ(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;return mZ({...t,key:e,name:r,transport:n,type:"walletClient"}).extend(zxe)}function cL(t){return t?`${t.slice(0,5)}…${t.slice(-4)}`:""}function Hxe({wei:t,precision:e=3}){return parseFloat(jv(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"")}function uL({amount:t,decimals:e}){return d8(BigInt(t),e)}const qxe=/"(?:_|\\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*:/,Vxe=/"(?: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*:/,Gxe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Kxe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Yxe(t);return}return e}function Yxe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function by(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(!Gxe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(qxe.test(t)||Vxe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Kxe)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const Zxe=/#/g,Jxe=/&/g,Qxe=/\//g,Xxe=/=/g,Sk=/\+/g,e9e=/%5e/gi,t9e=/%60/gi,r9e=/%7c/gi,n9e=/%20/gi;function i9e(t){return encodeURI(""+t).replace(r9e,"|")}function jS(t){return i9e(typeof t=="string"?t:JSON.stringify(t)).replace(Sk,"%2B").replace(n9e,"+").replace(Zxe,"%23").replace(Jxe,"%26").replace(t9e,"`").replace(e9e,"^").replace(Qxe,"%2F")}function rE(t){return jS(t).replace(Xxe,"%3D")}function JZ(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function s9e(t){return JZ(t.replace(Sk," "))}function o9e(t){return JZ(t.replace(Sk," "))}function a9e(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=s9e(n[1]);if(i==="__proto__"||i==="constructor")continue;const s=o9e(n[2]||"");e[i]===void 0?e[i]=s:Array.isArray(e[i])?e[i].push(s):e[i]=[e[i],s]}return e}function l9e(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(r=>`${rE(t)}=${jS(r)}`).join("&"):`${rE(t)}=${jS(e)}`:rE(t)}function c9e(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>l9e(e,t[e])).filter(Boolean).join("&")}const u9e=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,d9e=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,f9e=/^([/\\]\s*){2,}[^/\\]/,h9e=/^\.?\//;function QZ(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?u9e.test(t):d9e.test(t)||(e.acceptRelative?f9e.test(t):!1)}function p9e(t="",e){return t.endsWith("/")}function g9e(t="",e){return(p9e(t)?t.slice(0,-1):t)||"/"}function m9e(t="",e){return t.endsWith("/")?t:t+"/"}function y9e(t,e){if(w9e(e)||QZ(t))return t;const r=g9e(e);return t.startsWith(r)?t:_9e(r,t)}function v9e(t,e){const r=x9e(t),n={...a9e(r.search),...e};return r.search=c9e(n),E9e(r)}function w9e(t){return!t||t==="/"}function b9e(t){return t&&t!=="/"}function _9e(t,...e){let r=t||"";for(const n of e.filter(i=>b9e(i)))if(r){const i=n.replace(h9e,"");r=m9e(r)+i}else r=n;return r}const XZ=Symbol.for("ufo:protocolRelative");function x9e(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(!QZ(t,{acceptRelative:!0}))return dL(t);const[,n="",i,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,o="",a=""]=s.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:c,hash:u}=dL(a);return{protocol:n.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:o,pathname:l,search:c,hash:u,[XZ]:!n}}function dL(t=""){const[e="",r="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:n}}function E9e(t){const e=t.pathname||"",r=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",n=t.hash||"",i=t.auth?t.auth+"@":"",s=t.host||"";return(t.protocol||t[XZ]?(t.protocol||"")+"//":"")+i+s+e+r+n}class eJ extends Error{constructor(e,r){super(e,r),this.name="FetchError",r!=null&&r.cause&&!this.cause&&(this.cause=r.cause)}}function C9e(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)}`,s=t.response?`${t.response.status} ${t.response.statusText}`:"",o=`${i}: ${s}${e?` ${e}`:""}`,a=new eJ(o,t.error?{cause:t.error}:void 0);for(const g of["request","options","response"])Object.defineProperty(a,g,{get(){return t[g]}});for(const[g,m]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,g,{get(){return t.response&&t.response[m]}});return a}const A9e=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function fL(t="GET"){return A9e.has(t.toUpperCase())}function S9e(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 I9e=new Set(["image/svg","application/xml","application/xhtml","application/html"]),T9e=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function $9e(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return T9e.test(e)?"json":I9e.has(e)||e.startsWith("text/")?"text":"blob"}function k9e(t,e,r,n){const i=N9e((e==null?void 0:e.headers)??(t==null?void 0:t.headers),r==null?void 0:r.headers,n);let s;return(r!=null&&r.query||r!=null&&r.params||e!=null&&e.params||e!=null&&e.query)&&(s={...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:s,params:s,headers:i}}function N9e(t,e,r){if(!e)return new r(t);const n=new r(e);if(t)for(const[i,s]of Symbol.iterator in t||Array.isArray(t)?t:new r(t))n.set(i,s);return n}async function gb(t,e){if(e)if(Array.isArray(e))for(const r of e)await r(t);else await e(t)}const P9e=new Set([408,409,425,429,500,502,503,504]),R9e=new Set([101,204,205,304]);function tJ(t={}){const{fetch:e=globalThis.fetch,Headers:r=globalThis.Headers,AbortController:n=globalThis.AbortController}=t;async function i(a){const l=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!l){let u;typeof a.options.retry=="number"?u=a.options.retry:u=fL(a.options.method)?0:1;const f=a.response&&a.response.status||500;if(u>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(f):P9e.has(f))){const h=typeof a.options.retryDelay=="function"?a.options.retryDelay(a):a.options.retryDelay||0;return h>0&&await new Promise(g=>setTimeout(g,h)),s(a.request,{...a.options,retry:u-1})}}const c=C9e(a);throw Error.captureStackTrace&&Error.captureStackTrace(c,s),c}const s=async function(l,c={}){const u={request:l,options:k9e(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 gb(u,u.options.onRequest),typeof u.request=="string"&&(u.options.baseURL&&(u.request=y9e(u.request,u.options.baseURL)),u.options.query&&(u.request=v9e(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&&fL(u.options.method)&&(S9e(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 gb(u,u.options.onRequestError),await i(u)}finally{f&&clearTimeout(f)}if((u.response.body||u.response._bodyInit)&&!R9e.has(u.response.status)&&u.options.method!=="HEAD"){const g=(u.options.parseResponse?"json":u.options.responseType)||$9e(u.response.headers.get("content-type")||"");switch(g){case"json":{const m=await u.response.text(),w=u.options.parseResponse||by;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 gb(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await gb(u,u.options.onResponseError),await i(u)):u.response},o=async function(l,c){return(await s(l,c))._data};return o.raw=s,o.native=(...a)=>e(...a),o.create=(a={},l={})=>tJ({...t,...l,defaults:{...t.defaults,...l.defaults,...a}}),o}const I6=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")}(),M9e=I6.fetch?(...t)=>I6.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),O9e=I6.Headers,j9e=I6.AbortController,rJ=tJ({fetch:M9e,Headers:O9e,AbortController:j9e});var ar;let Lo=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}},Ha=class extends Lo{constructor(e,r,n,i,s,o){super(n,i,s),this.type=e,this.status=r,this.data=o}},Ee=class extends Lo{constructor(e,r,n){super(e,r,n),this.type="client_error"}},D9e=class extends Ee{constructor(){super("Request timed out",void 0,"client_request_timeout")}},Nn=class extends Lo{constructor(e,r,n){super(e,r,n),this.type="connector_error"}};const Hr=t=>{if(t instanceof Lo)return t;if(!(t instanceof eJ))return bn(t);if(!t.response)return new Ha("api_error",null,t.message,t);let{type:e,message:r,error:n,code:i}=t.data;return new Ha(e||"ApiError",t.response.status,r||n,t,i,t.data)},bn=t=>t instanceof Lo?t:t instanceof Error?new Ee(t.message,t):new Ee(`Internal error: ${t}`);var Se=((ar={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",ar.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",ar.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",ar.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",ar.INVALID_DATA="invalid_data",ar.INVALID_CAPTCHA="invalid_captcha",ar.LINKED_TO_ANOTHER_USER="linked_to_another_user",ar.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",ar.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",ar.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",ar.USER_EXITED_UPDATE_FLOW="exited_update_flow",ar.ALLOWLIST_REJECTED="allowlist_rejected",ar.OAUTH_USER_DENIED="oauth_user_denied",ar.OAUTH_UNEXPECTED="oauth_unexpected",ar.UNKNOWN_AUTH_ERROR="unknown_auth_error",ar.USER_EXITED_AUTH_FLOW="exited_auth_flow",ar.USER_EXITED_LINK_FLOW="exited_link_flow",ar.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",ar.MUST_BE_AUTHENTICATED="must_be_authenticated",ar.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",ar.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",ar.CLIENT_REQUEST_TIMEOUT="client_request_timeout",ar.INVALID_CREDENTIALS="invalid_credentials",ar.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",ar.UNKNOWN_MFA_ERROR="unknown_mfa_error",ar.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",ar.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",ar.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",ar.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",ar.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",ar.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",ar.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",ar.TRANSACTION_FAILURE="transaction_failure",ar.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",ar.NOT_SUPPORTED="not_supported",ar.CAPTCHA_TIMEOUT="captcha_timeout",ar.INVALID_MESSAGE="invalid_message",ar.UNABLE_TO_SIGN="unable_to_sign",ar.CAPTCHA_FAILURE="captcha_failure",ar.CAPTCHA_DISABLED="captcha_disabled",ar.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",ar.TOO_MANY_REQUESTS="too_many_requests",ar.USER_LIMIT_REACHED="max_accounts_reached",ar.DISALLOWED_LOGIN_METHOD="disallowed_login_method",ar.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",ar.PASSKEY_NOT_ALLOWED="passkey_not_allowed",ar.USER_DOES_NOT_EXIST="user_does_not_exist",ar.INSUFFICIENT_BALANCE="insufficient_balance",ar.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",ar);let Op=class extends Ee{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},kf=class extends Ee{constructor(e="Embedded wallet error",r){super(e,r,"unknown_embedded_wallet_error")}},L9e=class extends Ee{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},Vv=class extends Ee{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 nJ="/api/v1/sessions",iJ="/api/v1/sessions/logout",F9e="/api/v1/sessions/fork",sJ="/api/v1/sessions/fork/recover",U9e="/api/v1/siwe/init",B9e="/api/v1/siwe/authenticate",W9e="/api/v1/siwe/link",z9e="/api/v1/siwe/link_smart_wallet",H9e="/api/v1/siwe/unlink",q9e="/api/v1/siwe/transfer",V9e="/api/v1/siws/init",G9e="/api/v1/siws/authenticate",K9e="/api/v1/siws/link",Y9e="/api/v1/siws/unlink",Z9e="/api/v1/farcaster/init",J9e="/api/v1/farcaster/authenticate",Q9e="/api/v1/farcaster/link",X9e="/api/v1/farcaster/status",eEe="/api/v1/farcaster/unlink",tEe="/api/v1/farcaster/transfer",rEe="/api/v1/passwordless/init",nEe="/api/v1/passwordless/authenticate",iEe="/api/v1/passwordless/link",sEe="/api/v1/passwordless/unlink",oEe="/api/v1/passwordless/update",aEe="/api/v1/passwordless/transfer",lEe="/api/v1/passwordless_sms/init",cEe="/api/v1/passwordless_sms/link",uEe="/api/v1/passwordless_sms/unlink",dEe="/api/v1/passwordless_sms/authenticate",fEe="/api/v1/passwordless_sms/update",hEe="/api/v1/passwordless_sms/transfer",oJ="/api/v1/oauth/init",aJ="/api/v1/oauth/authenticate",lJ="/api/v1/oauth/link",pEe="/api/v1/oauth/unlink",gEe="/api/v1/oauth/transfer",mEe="/api/v1/recovery/oauth/init",yEe="/api/v1/recovery/oauth/init_icloud",vEe="/api/v1/recovery/oauth/authenticate",wEe="/api/v1/passkeys/link/init",bEe="/api/v1/passkeys/authenticate/init",_Ee="/api/v1/passkeys/link",xEe="/api/v1/passkeys/authenticate",EEe="/api/v1/passkeys/unlink",CEe="/api/v1/telegram/authenticate",AEe="/api/v1/telegram/link",SEe="/api/v1/telegram/unlink",IEe="/api/v1/telegram/transfer",TEe="/api/v1/mfa/passwordless_sms/init",$Ee="/api/v1/mfa/passkeys/init",kEe="/api/v1/users/me/accept_terms",cJ="/api/v1/analytics_events",NEe="/api/v1/custom_jwt_account/authenticate",PEe="/api/v1/guest/authenticate",REe="/api/v1/plugins/moonpay_on_ramp/sign",MEe="/api/v1/funding/coinbase_on_ramp/init",OEe="/api/v1/funding/coinbase_on_ramp/status",jEe="/api/v1/wallets/revoke";let uJ=class{async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(NEe,{token:this.meta.token})}catch(e){throw Hr(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}};function $8(t){return t?{"privy-ui":"t"}:void 0}let w1=class{async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new Ee("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(nEe,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Hr(e)}}async link(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new Ee("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(iEe,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw Hr(e)}}async sendCodeEmail({email:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new Ee("Auth flow has no API instance");if(e&&(this.meta.email=e),r&&(this.meta.captchaToken=r),!this.meta.email)throw new Ee("Email must be set when initialzing authentication.");let i=$8(n);try{return await this.api.post(rEe,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw Hr(s)}}constructor({email:e,captchaToken:r,disableSignup:n}){this.meta={email:e,captchaToken:r,disableSignup:n??!1}}},DEe=class extends w1{async link(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new Ee("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(oEe,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw Hr(e)}}constructor(e,r,n){super({email:r,captchaToken:n}),this.meta={email:r,captchaToken:n,oldAddress:e,disableSignup:!1}}},LEe=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={}}},dJ=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 DS(){try{let t="privy:__session_storage__test",e=new dJ;return e.put(t,"blobby"),e.del(t),!0}catch{return!1}}var Dt=typeof window<"u"&&window.localStorage?new dJ:new LEe;function FEe(){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 fJ=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,hJ=(t,e)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!e)return!0;if(t.isBraveWallet&&!t._events&&!t._state||fJ(t)!=="MetaMask")return!1;if(t.providers){for(let r of t.providers)if(!hJ(r))return!1}return!0},k8=()=>{var t,e,r,n,i,s;if("phantom"in window){let o=window;if((e=(t=o==null?void 0:o.phantom)==null?void 0:t.ethereum)!=null&&e.isPhantom&&((n=(r=o==null?void 0:o.phantom)==null?void 0:r.ethereum)!=null&&n.chainId)||(s=(i=o==null?void 0:o.phantom)==null?void 0:i.solana)!=null&&s.isPhantom)return!0}return!1},pJ=()=>{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},UEe=(t,e)=>{let r=[],n=[];for(let[i,s]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,}))$/),BEe=(t,e)=>{let r=t.slice(0),n=[];for(;r.length;)n.push(r.splice(0,e));return n},Ys=(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)}`},nE=(t,e=3,r=4)=>Ys(t,e,r,"solana"),mJ=t=>new Promise(e=>setTimeout(e,t));function WEe(t,{interval:e=100,timeout:r=5e3}={}){return new Promise((n,i)=>{let s,o=0,a=()=>{o>=r?i("Max attempts reached without result"):(s=t(),o+=e,s==null?setTimeout(a,e):n(s))};a()})}const LS=(t,e={})=>{let r=e.delayMs||150,n=e.maxAttempts||270;return new Promise(async(i,s)=>{var l;let o=!1,a=0;for(;!o&&a{o=!0,i(c)},(...c)=>{o=!0,s(...c)}),a+=1,await mJ(r)}o||s(Error("Exceeded max attempts before resolving function"))})},yJ=(t,e,r={},n={})=>{let i=new URL(e,t);for(let[o,a]of Object.entries(r))a!==void 0&&i.searchParams.set(o,a);let s=Object.entries(n);if(s.length>0){let o=new URLSearchParams;for(let[a,l]of s)o.append(a,l);i.hash=o.toString()}return i.href},zEe=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),T6=t=>typeof t=="string"?t:"0x"+t.toString(16);async function HEe({store:t,walletList:e,externalWalletConfig:r,walletChainType:n,timeout:i=3e3}){let s=!1,o=window;return new Promise(a=>{function l(){if(s)return;s=!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 FEe()){let h=fJ(f);if(!c.some(g=>g.info.name===h)){if(hJ(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})}}a(u)}o.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},i))})}function m5(t){return`eip155:${String(Number(t))}`}const qEe=(t,e,r,n)=>{let i=Number(t),s=e.find(o=>o.id===i);if(!s)throw new Nn(`Unsupported chainId ${t}`,4901);return Lf(s,r,n)},Lf=(t,e,r)=>{var o,a,l;let n,i=t.id,s=Number(t.id);if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])n=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[s])n=e.rpcUrls[s];else if((o=t.rpcUrls.privy)!=null&&o.http[0]){let c=new URL(t.rpcUrls.privy.http[0]);c.searchParams.append("privyAppId",r),n=c.toString()}else n=(a=t.rpcUrls.public)!=null&&a.http[0]?t.rpcUrls.public.http[0]:(l=t.rpcUrls.default)==null?void 0:l.http[0];if(!n)throw new Nn(`No RPC url found for ${i}`);return n},VEe=(t,e)=>{var i;let r=Number(t),n=e.find(s=>s.id===r);if(!n)throw new Nn(`Unsupported chainId ${t}`,4901);return(i=n.blockExplorers)==null?void 0:i.default.url},og=(t,e,r,n)=>{var o,a,l;let i=Number(t),s=e.find(c=>c.id===i);if(!s)throw new Nn(`Unsupported chainId ${t}`,4901);return new mye(s.rpcUrls.privyWalletOverride&&s.rpcUrls.privyWalletOverride.http[0]?s.rpcUrls.privyWalletOverride.http[0]:r.rpcUrls&&r.rpcUrls[i]?r.rpcUrls[i]:(o=s.rpcUrls.privy)!=null&&o.http[0]?{url:s.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}:(a=s.rpcUrls.public)!=null&&a.http[0]?s.rpcUrls.public.http[0]:(l=s.rpcUrls.default)==null?void 0:l.http[0])},FS=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 GEe(t,{min:e,max:r}){return Math.min(Math.max(t,e),r)}const iE=t=>{let e;try{e=new URL(t).hostname}catch{return}for(let[r,n]of Object.entries(US))if(e.includes(n.hostname))return{walletClientType:r,entry:n}},US={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 vJ(t){return{name:t.displayName||"",universalLink:t.mobile.universal,deepLink:t.mobile.native}}function KEe(t,e){let r=vJ(e);if(r.deepLink)return _J(r.deepLink,t);if(r.universalLink)return Ik(r.universalLink,t);throw new Ee(`Unsupported wallet ${e.id}`)}function YEe(t,e){let r=vJ(e);if(r.universalLink)return Ik(r.universalLink,t)}let wJ="WALLETCONNECT_DEEPLINK_CHOICE";function ZEe(){try{localStorage.removeItem(wJ)}catch{}}function JEe({href:t,name:e}){try{localStorage.setItem(wJ,JSON.stringify({href:t,name:e}))}catch{}}function bJ(t){return t.startsWith("http://")||t.startsWith("https://")}function _J(t,e){if(bJ(t))return Ik(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 Ik(t,e){if(!bJ(t))return _J(t,e);let r=t;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function xJ(t,e){window.open(t,e,"noreferrer noopener")}let Ks=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}},hL=class{get meta(){return this._meta}async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.channelToken)throw new Ee("Auth flow must be initialized first");try{let e=await this.api.post(J9e,{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 Ee("No response from authentication");return e}catch(e){throw Hr(e)}}async link(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(Q9e,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw Hr(e)}}async _startChannelOnce(){if(!this.api)throw new Ee("Auth flow has no API instance");let e=await this.api.post(Z9e,{token:this.captchaToken});cs&&!O$&&e.connect_uri&&xJ(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new Ee("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.channelToken)throw new Ee("Auth flow must be initialized first");let e=await this.api.get(X9e,{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 Ks(this._startChannelOnce.bind(this)),this.pollForReady=new Ks(this._pollForReady.bind(this)),this._meta.disableSignup=r}};const QEe="34357d3c125c2bcf2ce2bc3309d98715",BS="https://auth.privy.io",XEe=2e4,Rn=1400,Tk=2500,N8=4e3,eCe="1.98.4",_y="privy:token",pL="privy-token",sE="privy:refresh_token",tCe="privy-refresh-token",y5="privy:pat",gL="privy:id_token",mL="privy-id-token",oE="privy-session",WS="privy:session_transfer_token",zS="privy:caid",EJ=t=>`privy:guest:${t}`,mb=t=>`privy:cross-app:${t}`,$6="privy:state_code",xy="privy:code_verifier",k6="privy:headless_oauth",N6="privy:oauth_disable_signup",aE=t=>`privy:wallet:${t}`,yL="privy:connectors",CJ="privy:connections",P8=12e4,Q2=1,vL="0x1",$k=3e4,rCe="https://api.moonpay.com/v1",nCe="https://api.moonpay.com/v1",iCe="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",sCe="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",oCe="deprecated";async function aCe(t){let e=new TextEncoder().encode(t);return new Uint8Array(await crypto.subtle.digest("SHA-256",e))}function HS(t){return crypto.getRandomValues(new Uint8Array(t))}let AJ=class{getOrCreateGuestCredential(e){let r=EJ(e);if(DS()){if(Dt.get(r))return Dt.get(r);{let n=E6(HS(32));return Dt.put(r,n),n}}return E6(HS(32))}async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(PEe,{guest_credential:this.meta.guestCredential})}catch(e){throw Hr(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}},yb=class{async initAuthenticationFlow(e){if(!this.api)throw new Ee("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new Ee("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){var r,n;let e=await Oo(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new Ee("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new Ee("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(xEe,{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 Ee("Passkey request timed out or rejected by user.",void 0,Se.PASSKEY_NOT_ALLOWED):Hr(i)}}async link(){var r,n;let e=await Oo(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new Ee("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new Ee("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let i=this.meta.initLinkResponse.options,s=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(i));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(_Ee,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(s)})}catch(i){throw i.name==="NotAllowedError"?new Ee("Passkey request timed out or rejected by user.",void 0,Se.PASSKEY_NOT_ALLOWED):Hr(i)}}async _initAuthenticateOnce(e){if(!this.api)throw new Ee("Auth flow has no API instance");let r=$8(e);return await this.api.post(bEe,{token:this.meta.captchaToken},{headers:{...r}})}async _initLinkOnce(){if(!this.api)throw new Ee("Auth flow has no API instance");return await this.api.post(wEe,{})}_transformInitLinkOptionsToCamelCase(e){var r,n,i,s,o,a,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:(s=e.authenticator_selection)==null?void 0:s.resident_key,userVerification:(o=e.authenticator_selection)==null?void 0:o.user_verification},attestation:e.attestation,extensions:{appid:(a=e.extensions)==null?void 0:a.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,s;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:((r=e.allow_credentials)==null?void 0:r.map(o=>({id:o.id,type:o.type,transports:o.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:(s=e.extensions)==null?void 0:s.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 Ks(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Ks(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:r}}};const qS=({address:t,chainId:e,nonce:r})=>`${window.location.host} wants you to sign in with your Ethereum account: +`,i+=iD(n.state)),n.stateDiff&&(i+=` stateDiff: +`,i+=iD(n.stateDiff)),i},` State Override: +`).slice(0,-1)}function Uv(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 F8e extends Je{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 U8e extends Je{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class B8e extends Je{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Uv(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 W8e extends Je{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 z8e extends Je{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=Uv({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"&&`${Fv(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof o<"u"&&`${Ra(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${Ra(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Ra(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 fZ extends Je{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let a="Transaction";n&&s!==void 0&&(a=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(a=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(a=`Transaction at block number "${r}" at index "${s}"`),i&&(a=`Transaction with hash "${i}"`),super(`${a} could not be found.`,{name:"TransactionNotFoundError"})}}class hZ extends Je{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 H8e extends Je{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const q8e=t=>t,ok=t=>t;class pZ extends Je{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h,stateOverride:g}){var E;const m=r?sa(r):void 0;let w=Uv({from:m==null?void 0:m.address,to:f,value:typeof h<"u"&&`${Fv(h)} ${((E=i==null?void 0:i.nativeCurrency)==null?void 0:E.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof o<"u"&&`${Ra(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${Ra(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Ra(c)} gwei`,nonce:u});g&&(w+=` +${D8e(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 V8e extends Je{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:a,sender:o}){const l=Lv({abi:r,args:n,name:a}),c=l?uZ({abiItem:l,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=l?su(l,{includeName:!0}):void 0,f=Uv({address:i&&q8e(i),function:u,args:c&&c!=="()"&&`${[...Array((a==null?void 0:a.length)??0).keys()].map(()=>" ").join("")}${c}`,sender:o});super(e.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:e,docsPath:s,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=a,this.sender=o}}class xS extends Je{constructor({abi:e,data:r,functionName:n,message:i}){let s,a,o,l;if(r&&r!=="0x")try{a=M8e({abi:e,data:r});const{abiItem:u,errorName:f,args:h}=a;if(f==="Error")l=h[0];else if(f==="Panic"){const[g]=h;l=lZ[g]}else{const g=u?su(u,{includeName:!0}):void 0,m=u&&h?uZ({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){s=u}else i&&(l=i);let c;s instanceof BY&&(c=s.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:s,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=a,this.reason=l,this.signature=c}}class G8e extends Je{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 K8e extends Je{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 v8 extends Je{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 Vy extends Je{constructor({body:e,cause:r,details:n,headers:i,status:s,url:a}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${ok(a)}`,e&&`Request body: ${Zi(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=s,this.url=a}}class lk extends Je{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${ok(n)}`,`Request body: ${Zi(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 sD extends Je{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${ok(r)}`,`Request body: ${Zi(e)}`],name:"TimeoutError"})}}const Y8e=-1;class Ba extends Je{constructor(e,{code:r,docsPath:n,metaMessages:i,name:s,shortMessage:a}){super(a,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof lk?e.code:r??Y8e}}class qg extends Ba{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class D2 extends Ba{constructor(e){super(e,{code:D2.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(D2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class F2 extends Ba{constructor(e){super(e,{code:F2.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(F2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class U2 extends Ba{constructor(e,{method:r}={}){super(e,{code:U2.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(U2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class B2 extends Ba{constructor(e){super(e,{code:B2.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(B2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class A0 extends Ba{constructor(e){super(e,{code:A0.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(A0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class S0 extends Ba{constructor(e){super(e,{code:S0.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(S0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class W2 extends Ba{constructor(e){super(e,{code:W2.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(W2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class z2 extends Ba{constructor(e){super(e,{code:z2.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(z2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class H2 extends Ba{constructor(e){super(e,{code:H2.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(H2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class q2 extends Ba{constructor(e,{method:r}={}){super(e,{code:q2.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not implemented.`})}}Object.defineProperty(q2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class ng extends Ba{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 V2 extends Ba{constructor(e){super(e,{code:V2.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(V2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class L1 extends qg{constructor(e){super(e,{code:L1.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(L1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class G2 extends qg{constructor(e){super(e,{code:G2.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(G2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class K2 extends qg{constructor(e,{method:r}={}){super(e,{code:K2.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(K2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Y2 extends qg{constructor(e){super(e,{code:Y2.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Y2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Z2 extends qg{constructor(e){super(e,{code:Z2.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Z2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class J2 extends qg{constructor(e){super(e,{code:J2.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(J2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Z8e extends Ba{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const J8e=3;function I0(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:a}){const o=t instanceof v8?t:t instanceof Je?t.walk(m=>"data"in m)||t.walk():{},{code:l,data:c,details:u,message:f,shortMessage:h}=o,g=t instanceof Ov?new G8e({functionName:s}):[J8e,A0.code].includes(l)&&(c||u||f||h)?new xS({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:o instanceof lk?u:h??f}):t;return new V8e(g,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:a})}function Q8e(t){const e=Vi(`0x${t.substring(4)}`).substring(26);return jv(`0x${e}`)}async function X8e({hash:t,signature:e}){const r=Zl(t)?t:ur(t),{secp256k1:n}=await Ma(async()=>{const{secp256k1:a}=await Promise.resolve().then(()=>w9e);return{secp256k1:a}},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=aD(g);return new n.Signature(oo(c),oo(u)).addRecoveryBit(m)}const a=Zl(e)?e:ur(e),o=au(`0x${a.slice(130)}`),l=aD(o);return n.Signature.fromCompact(a.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function aD(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 gZ({hash:t,signature:e}){return Q8e(await X8e({hash:t,signature:e}))}function Ff(t,e="hex"){const r=mZ(t),n=ak(new Uint8Array(r.length));return r.encode(n),e==="hex"?vi(n.bytes):n.bytes}function mZ(t){return Array.isArray(t)?e_e(t.map(e=>mZ(e))):t_e(t)}function e_e(t){const e=t.reduce((i,s)=>i+s.length,0),r=yZ(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:s}of t)s(i)}}}function t_e(t){const e=typeof t=="string"?Jl(t):t,r=yZ(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 yZ(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 Je("Length is too large.")}function r_e(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,s=Vi(du(["0x05",Ff([e?lr(e):"0x",r,n?lr(n):"0x"])]));return i==="bytes"?Jl(s):s}async function vZ(t){const{authorization:e,signature:r}=t;return gZ({hash:r_e(e),signature:r??e})}class n_e extends Je{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=Uv({from:r==null?void 0:r.address,to:f,value:typeof h<"u"&&`${Fv(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof o<"u"&&`${Ra(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${Ra(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Ra(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 w1 extends Je{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(w1,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(w1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class T0 extends Je{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Ra(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(T0,"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 ES extends Je{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Ra(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(ES,"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 CS extends Je{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(CS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class AS extends Je{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(AS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class SS extends Je{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(SS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class IS extends Je{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(IS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class TS extends Je{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(TS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class $S extends Je{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($S,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class kS extends Je{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(kS,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Q2 extends Je{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Ra(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Ra(n)} gwei`:""}).`].join(` +`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(Q2,"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 Bv extends Je{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function w8(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof Je?t.walk(i=>(i==null?void 0:i.code)===w1.code):t;return n instanceof Je?new w1({cause:t,message:n.details}):w1.nodeMessage.test(r)?new w1({cause:t,message:t.details}):T0.nodeMessage.test(r)?new T0({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):ES.nodeMessage.test(r)?new ES({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):CS.nodeMessage.test(r)?new CS({cause:t,nonce:e==null?void 0:e.nonce}):AS.nodeMessage.test(r)?new AS({cause:t,nonce:e==null?void 0:e.nonce}):SS.nodeMessage.test(r)?new SS({cause:t,nonce:e==null?void 0:e.nonce}):IS.nodeMessage.test(r)?new IS({cause:t}):TS.nodeMessage.test(r)?new TS({cause:t,gas:e==null?void 0:e.gas}):$S.nodeMessage.test(r)?new $S({cause:t,gas:e==null?void 0:e.gas}):kS.nodeMessage.test(r)?new kS({cause:t}):Q2.nodeMessage.test(r)?new Q2({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Bv({cause:t})}function i_e(t,{docsPath:e,...r}){const n=(()=>{const i=w8(t,r);return i instanceof Bv?t:i})();return new n_e(n,{docsPath:e,...r})}function b8(t,{format:e}){if(!e)return{};const r={};function n(s){const a=Object.keys(s);for(const o of a)o in t&&(r[o]=t[o]),s[o]&&typeof s[o]=="object"&&!Array.isArray(s[o])&&n(s[o])}const i=e(t||{});return n(i),r}function ck(t,e){return({exclude:r,format:n})=>({exclude:r,format:i=>{const s=e(i);if(r)for(const a of r)delete s[a];return{...s,...n(i)}},type:t})}const s_e={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Vg(t){const e={};return typeof t.authorizationList<"u"&&(e.authorizationList=a_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=>vi(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=s_e[t.type]),typeof t.value<"u"&&(e.value=lr(t.value)),e}function a_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 oD(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new qL({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new qL({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function o_e(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:s}=t,a={};if(s!==void 0&&(a.code=s),e!==void 0&&(a.balance=lr(e)),r!==void 0&&(a.nonce=lr(r)),n!==void 0&&(a.state=oD(n)),i!==void 0){if(a.state)throw new L8e;a.stateDiff=oD(i)}return a}function uk(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!Sn(r,{strict:!1}))throw new ta({address:r});if(e[r])throw new j8e({address:r});e[r]=o_e(n)}return e}const _8=2n**256n-1n;function G0(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,a=e?sa(e):void 0;if(a&&!Sn(a.address))throw new ta({address:a.address});if(s&&!Sn(s))throw new ta({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new F8e;if(n&&n>_8)throw new T0({maxFeePerGas:n});if(i&&n&&i>n)throw new Q2({maxFeePerGas:n,maxPriorityFeePerGas:i})}class l_e extends Je{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class dk extends Je{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class c_e extends Je{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Ra(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class wZ extends Je{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 bZ={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function x8(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?au(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?au(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?bZ[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=d_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 u_e=ck("transaction",x8);function d_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 fk(t){const e=(t.transactions??[]).map(r=>typeof r=="string"?r:x8(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 f_e=ck("block",fk);async function Fc(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,h;const s=n??"latest",a=i??!1,o=r!==void 0?lr(r):void 0;let l=null;if(e?l=await t.request({method:"eth_getBlockByHash",params:[e,a]},{dedupe:!0}):l=await t.request({method:"eth_getBlockByNumber",params:[o||s,a]},{dedupe:!!o}),!l)throw new wZ({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)||fk)(l)}async function hk(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function h_e(t,e){return _Z(t,e)}async function _Z(t,e){var s,a;const{block:r,chain:n=t.chain,request:i}=e||{};try{const o=((s=n==null?void 0:n.fees)==null?void 0:s.maxPriorityFeePerGas)??((a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee);if(typeof o=="function"){const c=r||await nr(t,Fc,"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 oo(l)}catch{const[o,l]=await Promise.all([r?Promise.resolve(r):nr(t,Fc,"getBlock")({}),nr(t,hk,"getGasPrice")({})]);if(typeof o.baseFeePerGas!="bigint")throw new dk;const c=l-o.baseFeePerGas;return c<0n?0n:c}}async function p_e(t,e){return NS(t,e)}async function NS(t,e){var h,g;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},a=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(a<1)throw new l_e;const l=10**(((h=a.toString().split(".")[1])==null?void 0:h.length)??0),c=m=>m*BigInt(Math.ceil(a*l))/BigInt(l),u=r||await nr(t,Fc,"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:s});if(m!==null)return m}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new dk;const m=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await _Z(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,hk,"getGasPrice")({}))}}async function xZ(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 au(i)}function pk(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=>Jl(s)):t.blobs,i=[];for(const s of n)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return r==="bytes"?i:i.map(s=>vi(s))}function gk(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=>Jl(a)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(a=>Jl(a)):t.commitments,s=[];for(let a=0;avi(a))}function g_e(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),l=n?4:0,c=n?0:4;t.setUint32(e+l,a,n),t.setUint32(e+c,o,n)}const m_e=(t,e,r)=>t&e^~t&r,y_e=(t,e,r)=>t&e^t&r^e&r;let v_e=class extends KY{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=G9(this.buffer)}update(e){k4(this);const{view:r,buffer:n,blockLen:i}=this;e=tk(e);const s=e.length;for(let a=0;ai-a&&(this.process(n,0),a=0);for(let f=a;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=yc(g,17)^yc(g,19)^g>>>10;Jd[f]=w+Jd[f-7]+m+Jd[f-16]|0}let{A:n,B:i,C:s,D:a,E:o,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=yc(o,6)^yc(o,11)^yc(o,25),g=u+h+m_e(o,l,c)+w_e[f]+Jd[f]|0,w=(yc(n,2)^yc(n,13)^yc(n,22))+y_e(n,i,s)|0;u=c,c=l,l=o,o=a+g|0,a=s,s=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+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,s,a,o,l,c,u)}roundClean(){Jd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const __e=YY(()=>new b_e);function x_e(t,e){return __e(Zl(t,{strict:!1})?Wg(t):t)}function E_e(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=x_e(e);return i.set([r],0),n==="bytes"?i:vi(i)}function EZ(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const s of e)i.push(E_e({commitment:s,to:n,version:r}));return i}const lD=6,CZ=32,mk=4096,AZ=CZ*mk,cD=AZ*lD-1-1*mk*lD,SZ=1;class C_e extends Je{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class IZ extends Je{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class A_e extends Je{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class S_e extends Je{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${SZ}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function I_e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?Jl(t.data):t.data,n=ei(r);if(!n)throw new IZ;if(n>cD)throw new C_e({maxSize:cD,size:n});const i=[];let s=!0,a=0;for(;s;){const o=ak(new Uint8Array(AZ));let l=0;for(;lo.bytes):i.map(o=>vi(o.bytes))}function TZ(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??I_e({data:e,to:n}),s=t.commitments??pk({blobs:i,kzg:r,to:n}),a=t.proofs??gk({blobs:i,commitments:s,kzg:r,to:n}),o=[];for(let l=0;l"u"&&f)if(l){const v=await E();h.nonce=await l.consume({address:f.address,chainId:v,client:t})}else h.nonce=await nr(t,xZ,"getTransactionCount")({address:f.address,blockTag:"pending"});if((c.includes("fees")||c.includes("type"))&&typeof u>"u")try{h.type=$Z(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:_,maxPriorityFeePerGas:A}=await NS(t,{block:v,chain:i,request:h});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(h.gas=await nr(t,yk,"estimateGas")({...h,account:f&&{address:f.address,type:"json-rpc"}})),G0(h),delete h.parameters,h}async function NZ(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?lr(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}async function yk(t,e){var i,s,a;const{account:r=t.account}=e,n=r?sa(r):void 0;try{let b=function(P){const{block:D,request:O,rpcStateOverride:j}=P;return t.request({method:"eth_estimateGas",params:j?[O,D??"latest",j]:D?[O,D]:[O]})};const{accessList:o,authorizationList:l,blobs:c,blobVersionedHashes:u,blockNumber:f,blockTag:h,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:E,maxFeePerGas:v,maxPriorityFeePerGas:_,nonce:A,value:C,stateOverride:R,...B}=await E8(t,{...e,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),U=(f?lr(f):void 0)||h,G=uk(R),ae=await(async()=>{if(B.to)return B.to;if(l&&l.length>0)return await vZ({authorization:l[0]}).catch(()=>{throw new Je("`to` is required. Could not infer from `authorizationList`")})})();G0(e);const K=(a=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:a.format,k=(K||Vg)({...b8(B,{format:K}),from:n==null?void 0:n.address,accessList:o,authorizationList:l,blobs:c,blobVersionedHashes:u,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:E,maxFeePerGas:v,maxPriorityFeePerGas:_,nonce:A,to:ae,value:C});let x=BigInt(await b({block:U,request:k,rpcStateOverride:G}));if(l){const P=await NZ(t,{address:k.from}),D=await Promise.all(l.map(async O=>{const{contractAddress:j}=O,T=await b({block:U,request:{authorizationList:void 0,data:g,from:n==null?void 0:n.address,to:j,value:lr(P)},rpcStateOverride:G}).catch(()=>100000n);return 2n*BigInt(T)}));x+=D.reduce((O,j)=>O+j,0n)}return x}catch(o){throw i_e(o,{...e,account:n,chain:t.chain})}}async function T_e(t,e){const{abi:r,address:n,args:i,functionName:s,dataSuffix:a,...o}=e,l=ac({abi:r,args:i,functionName:s});try{return await nr(t,yk,"estimateGas")({data:`${l}${a?a.replace("0x",""):""}`,to:n,...o})}catch(c){const u=o.account?sa(o.account):void 0;throw I0(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:u==null?void 0:u.address})}}function vk(t,e){if(!Sn(t,{strict:!1}))throw new ta({address:t});if(!Sn(e,{strict:!1}))throw new ta({address:e});return t.toLowerCase()===e.toLowerCase()}const uD="/docs/contract/decodeEventLog";function wk(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[a,...o]=i;if(!a)throw new y6e({docsPath:uD});const l=e.length===1?e[0]:e.find(w=>w.type==="event"&&a===h8(su(w)));if(!(l&&"name"in l)||l.type!=="event")throw new WY(a,{docsPath:uD});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=Hg(m,r);if(w)if(f)h=[...h,...w];else for(let E=0;E0?h:void 0}}function $_e({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(Hg([t],e)||[])[0]}function bk(t){const{abi:e,args:r,logs:n,strict:i=!0}=t,s=(()=>{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})();return n.map(a=>{var o;try{const l=e.find(u=>u.type==="event"&&a.topics[0]===h8(u));if(!l)return null;const c=wk({...a,abi:[l],strict:i});return s&&!s.includes(c.eventName)||!k_e({args:c.args,inputs:l.inputs,matchArgs:r})?null:{...c,...a}}catch(l){let c,u;if(l instanceof WY)return null;if(l instanceof j2||l instanceof f8){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{...a,args:u?[]:{},eventName:c}}}).filter(Boolean)}function k_e(t){const{args:e,inputs:r,matchArgs:n}=t;if(!n)return!0;if(!e)return!1;function i(s,a,o){try{return s.type==="address"?vk(a,o):s.type==="string"||s.type==="bytes"?Vi(Wg(a))===o:a===o}catch{return!1}}return Array.isArray(e)&&Array.isArray(n)?n.every((s,a)=>{if(s==null)return!0;const o=r[a];return o?(Array.isArray(s)?s:[s]).some(c=>i(o,c,e[a])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([s,a])=>{if(a==null)return!0;const o=r.find(c=>c.name===s);return o?(Array.isArray(a)?a:[a]).some(c=>i(o,c,e[s])):!1}):!1}function wd(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 _k(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:s,events:a,args:o,strict:l}={}){const c=l??!1,u=a??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(w=>Dv({abi:[w],eventName:w.name,args:a?void 0:o}))],s&&(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=>wd(m));return u?bk({abi:u,args:o,logs:g,strict:c}):g}async function PZ(t,e){const{abi:r,address:n,args:i,blockHash:s,eventName:a,fromBlock:o,toBlock:l,strict:c}=e,u=a?Lv({abi:r,name:a}):void 0,f=u?void 0:r.filter(h=>h.type==="event");return nr(t,_k,"getLogs")({address:n,args:i,blockHash:s,event:u,events:f,fromBlock:o,toBlock:l,strict:c})}const Z9="/docs/contract/decodeFunctionResult";function K0(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const o=Lv({abi:e,args:r,name:n});if(!o)throw new $4(n,{docsPath:Z9});s=o}if(s.type!=="function")throw new $4(void 0,{docsPath:Z9});if(!s.outputs)throw new v6e(s.name,{docsPath:Z9});const a=Hg(s.outputs,i);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}const PS=[{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"}],RZ=[{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"}],MZ=[...RZ,{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"}]}],N_e=[...RZ,{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"}]}],dD=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],fD=[{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"}]}],hD=[{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"}],P_e="0x82ad56cb",R_e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",M_e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",O_e="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";class RS extends Je{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 j_e extends Je{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 L_e extends Je{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 OZ extends Je{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class C8 extends Je{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const J9="/docs/contract/encodeDeployData";function A8(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(a=>"type"in a&&a.type==="constructor");if(!i)throw new h6e({docsPath:J9});if(!("inputs"in i))throw new zL({docsPath:J9});if(!i.inputs||i.inputs.length===0)throw new zL({docsPath:J9});const s=zg(i.inputs,r);return du([n,s])}function Gg({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 RS({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new RS({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function jZ(t,{docsPath:e,...r}){const n=(()=>{const i=w8(t,r);return i instanceof Bv?t:i})();return new pZ(n,{docsPath:e,...r})}function LZ(){let t=()=>{},e=()=>{};return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const Q9=new Map;function DZ({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const u=l();a();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;gQ9.delete(e),o=()=>l().map(({args:u})=>u),l=()=>Q9.get(e)||[],c=u=>Q9.set(e,[...l(),u]);return{flush:a,async schedule(u){const{promise:f,resolve:h,reject:g}=LZ();return(r==null?void 0:r([...o(),u]))&&s(),l().length>0?(c({args:u,resolve:h,reject:g}),f):(c({args:u,resolve:h,reject:g}),setTimeout(s,n),f)}}}async function S8(t,e){var K,N,k,b;const{account:r=t.account,batch:n=!!((K=t.batch)!=null&&K.multicall),blockNumber:i,blockTag:s="latest",accessList:a,blobs:o,code:l,data:c,factory:u,factoryData:f,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:E,nonce:v,to:_,value:A,stateOverride:C,...R}=e,B=r?sa(r):void 0;if(l&&(u||f))throw new Je("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&_)throw new Je("Cannot provide both `code` & `to` as parameters.");const S=l&&c,U=u&&f&&_&&c,G=S||U,ae=S?U_e({code:l,data:c}):U?B_e({data:c,factory:u,factoryData:f,to:_}):c;try{G0(e);const P=(i?lr(i):void 0)||s,D=uk(C),O=(b=(k=(N=t.chain)==null?void 0:N.formatters)==null?void 0:k.transactionRequest)==null?void 0:b.format,T=(O||Vg)({...b8(R,{format:O}),from:B==null?void 0:B.address,accessList:a,blobs:o,data:ae,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:E,nonce:v,to:G?void 0:_,value:A});if(n&&D_e({request:T})&&!D)try{return await F_e(t,{...T,blockNumber:i,blockTag:s})}catch(M){if(!(M instanceof OZ)&&!(M instanceof RS))throw M}const L=await t.request({method:"eth_call",params:D?[T,P,D]:[T,P]});return L==="0x"?{data:void 0}:{data:L}}catch(x){const P=W_e(x),{offchainLookup:D,offchainLookupSignature:O}=await Ma(async()=>{const{offchainLookup:j,offchainLookupSignature:T}=await import("./ccip-CPRKQZcO.js");return{offchainLookup:j,offchainLookupSignature:T}},[]);if(t.ccipRead!==!1&&(P==null?void 0:P.slice(0,10))===O&&_)return{data:await D(t,{data:P,to:_})};throw G&&(P==null?void 0:P.slice(0,10))==="0x101bb98d"?new K8e({factory:u}):jZ(x,{...e,account:B,chain:t.chain})}}function D_e({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(P_e)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function F_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:s="latest",data:a,multicallAddress:o,to:l}=e;let c=o;if(!c){if(!t.chain)throw new OZ;c=Gg({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?lr(i):void 0)||s,{schedule:h}=DZ({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(E){return E.reduce((_,{data:A})=>_+(A.length-2),0)>r*2},fn:async E=>{const v=E.map(C=>({allowFailure:!0,callData:C.data,target:C.to})),_=ac({abi:PS,args:[v],functionName:"aggregate3"}),A=await t.request({method:"eth_call",params:[{data:_,to:c},f]});return K0({abi:PS,args:[v],functionName:"aggregate3",data:A||"0x"})}}),[{returnData:g,success:m}]=await h({data:a,to:l});if(!m)throw new v8({data:g});return g==="0x"?{data:void 0}:{data:g}}function U_e(t){const{code:e,data:r}=t;return A8({abi:u8(["constructor(bytes, bytes)"]),bytecode:R_e,args:[e,r]})}function B_e(t){const{data:e,factory:r,factoryData:n,to:i}=t;return A8({abi:u8(["constructor(address, bytes, address, bytes)"]),bytecode:M_e,args:[i,e,r,n]})}function W_e(t){var r;if(!(t instanceof Je))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 bd(t,e){const{abi:r,address:n,args:i,functionName:s,...a}=e,o=ac({abi:r,args:i,functionName:s});try{const{data:l}=await nr(t,S8,"call")({...a,data:o,to:n});return K0({abi:r,args:i,functionName:s,data:l||"0x"})}catch(l){throw I0(l,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function z_e(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:a,...o}=e,l=o.account?sa(o.account):t.account,c=ac({abi:r,args:i,functionName:a});try{const{data:u}=await nr(t,S8,"call")({batch:!1,data:`${c}${s?s.replace("0x",""):""}`,to:n,...o,account:l}),f=K0({abi:r,args:i,functionName:a,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:s,functionName:a,...o,account:l}}}catch(u){throw I0(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:a,sender:l==null?void 0:l.address})}}const X9=new Map,pD=new Map;let H_e=0;function Uf(t,e,r){const n=++H_e,i=()=>X9.get(t)||[],s=()=>{const u=i();X9.set(t,u.filter(f=>f.id!==n))},a=()=>{const u=i();if(!u.some(h=>h.id===n))return;const f=pD.get(t);u.length===1&&f&&f(),s()},o=i();if(X9.set(t,[...o,{id:n,fns:e}]),o&&o.length>0)return a;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"&&pD.set(t,c),a}async function MS(t){return new Promise(e=>setTimeout(e,t))}function zv(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let o;e&&(o=await t({unpoll:s}));const l=await(r==null?void 0:r(o))??n;await MS(l);const c=async()=>{i&&(await t({unpoll:s}),await MS(n),c())};c()})(),s}const q_e=new Map,V_e=new Map;function G_e(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:a=>s.set(i,a)}),r=e(t,q_e),n=e(t,V_e);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function K_e(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=G_e(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function Hv(t,{cacheTime:e=t.cacheTime}={}){const r=await K_e(()=>t.request({method:"eth_blockNumber"}),{cacheKey:Y_e(t.uid),cacheTime:e});return BigInt(r)}async function I8(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(s=>wd(s));return!("abi"in e)||!e.abi?i:bk({abi:e.abi,logs:i,strict:r})}async function T8(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function Z_e(t,e){const{abi:r,address:n,args:i,batch:s=!0,eventName:a,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 E=h??!1,v=Zi(["watchContractEvent",n,i,s,t.uid,a,f,E,o]);return Uf(v,{onLogs:c,onError:l},_=>{let A;o!==void 0&&(A=o-1n);let C,R=!1;const B=zv(async()=>{var S;if(!R){try{C=await nr(t,oZ,"createContractEventFilter")({abi:r,address:n,args:i,eventName:a,strict:E,fromBlock:o})}catch{}R=!0;return}try{let U;if(C)U=await nr(t,I8,"getFilterChanges")({filter:C});else{const G=await nr(t,Hv,"getBlockNumber")({});A&&A{C&&await nr(t,T8,"uninstallFilter")({filter:C}),B()}})})():(()=>{const E=h??!1,v=Zi(["watchContractEvent",n,i,s,t.uid,a,f,E]);let _=!0,A=()=>_=!1;return Uf(v,{onLogs:c,onError:l},C=>((async()=>{try{const R=(()=>{if(t.transport.type==="fallback"){const U=t.transport.transports.find(G=>G.config.type==="webSocket");return U?U.value:t.transport}return t.transport})(),B=a?Dv({abi:r,eventName:a,args:i}):[],{unsubscribe:S}=await R.subscribe({params:["logs",{address:n,topics:B}],onData(U){var ae;if(!_)return;const G=U.result;try{const{eventName:K,args:N}=wk({abi:r,data:G.data,topics:G.topics,strict:h}),k=wd(G,{args:N,eventName:K});C.onLogs([k])}catch(K){let N,k;if(K instanceof j2||K instanceof f8){if(h)return;N=K.abiItem.name,k=(ae=K.abiItem.inputs)==null?void 0:ae.some(x=>!("name"in x&&x.name))}const b=wd(G,{args:k?[]:{},eventName:N});C.onLogs([b])}},onError(U){var G;(G=C.onError)==null||G.call(C,U)}});A=S,_||A()}catch(R){l==null||l(R)}})(),()=>A()))})()}class qv extends Je{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 eE extends Je{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function FZ({chain:t,currentChainId:e}){if(!t)throw new L_e;if(e!==t.id)throw new j_e({chain:t,currentChainId:e})}function J_e(t,{docsPath:e,...r}){const n=(()=>{const i=w8(t,r);return i instanceof Bv?t:i})();return new z8e(n,{docsPath:e,...r})}async function xk(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const tE=new p8(128);async function Ek(t,e){var v,_,A,C;const{account:r=t.account,chain:n=t.chain,accessList:i,authorizationList:s,blobs:a,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,value:m,...w}=e;if(typeof r>"u")throw new qv({docsPath:"/docs/actions/wallet/sendTransaction"});const E=r?sa(r):null;try{G0(e);const R=await(async()=>{if(e.to)return e.to;if(s&&s.length>0)return await vZ({authorization:s[0]}).catch(()=>{throw new Je("`to` is required. Could not infer from `authorizationList`.")})})();if((E==null?void 0:E.type)==="json-rpc"||E===null){let B;n!==null&&(B=await nr(t,Wv,"getChainId")({}),FZ({currentChainId:B,chain:n}));const S=(A=(_=(v=t.chain)==null?void 0:v.formatters)==null?void 0:_.transactionRequest)==null?void 0:A.format,G=(S||Vg)({...b8(w,{format:S}),accessList:i,authorizationList:s,blobs:a,chainId:B,data:o,from:E==null?void 0:E.address,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,to:R,value:m}),ae=tE.get(t.uid),K=ae?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:K,params:[G]},{retryCount:0})}catch(N){if(ae===!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:[G]},{retryCount:0}).then(b=>(tE.set(t.uid,!0),b)).catch(b=>{const x=b;throw x.name==="MethodNotFoundRpcError"||x.name==="MethodNotSupportedRpcError"?(tE.set(t.uid,!1),k):x});throw k}}if((E==null?void 0:E.type)==="local"){const B=await nr(t,E8,"prepareTransactionRequest")({account:E,accessList:i,authorizationList:s,blobs:a,chain:n,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,nonceManager:E.nonceManager,parameters:[...kZ,"sidecars"],value:m,...w,to:R}),S=(C=n==null?void 0:n.serializers)==null?void 0:C.transaction,U=await E.signTransaction(B,{serializer:S});return await nr(t,xk,"sendRawTransaction")({serializedTransaction:U})}throw(E==null?void 0:E.type)==="smart"?new eE({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new eE({docsPath:"/docs/actions/wallet/sendTransaction",type:E==null?void 0:E.type})}catch(R){throw R instanceof eE?R:J_e(R,{...e,account:E,chain:e.chain||void 0})}}async function Q_e(t,e){const{abi:r,account:n=t.account,address:i,args:s,dataSuffix:a,functionName:o,...l}=e;if(typeof n>"u")throw new qv({docsPath:"/docs/contract/writeContract"});const c=n?sa(n):null,u=ac({abi:r,args:s,functionName:o});try{return await nr(t,Ek,"sendTransaction")({data:`${u}${a?a.replace("0x",""):""}`,to:i,account:c,...l})}catch(f){throw I0(f,{abi:r,address:i,args:s,docsPath:"/docs/contract/writeContract",functionName:o,sender:c==null?void 0:c.address})}}class X_e extends Je{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 exe(t,e){const{address:r,factory:n,factoryData:i}=e;try{const[s,a,o,l,c,u,f]=await nr(t,bd,"readContract")({abi:txe,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:a,version:o,chainId:Number(l),verifyingContract:c,salt:u},extensions:f,fields:s}}catch(s){const a=s;throw a.name==="ContractFunctionExecutionError"&&a.cause.name==="ContractFunctionZeroDataError"?new X_e({address:r}):a}}const txe=[{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 rxe(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:s,blockExplorers:a}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:lr(r),chainName:n,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:a?Object.values(a).map(({url:o})=>o):void 0}]},{dedupe:!0,retryCount:0})}const OS=256;let pb=OS,gb;function UZ(t=11){if(!gb||pb+t>OS*2){gb="",pb=0;for(let e=0;e{const _=v(E);for(const C in m)delete _[C];const A={...E,..._};return Object.assign(A,{extend:w(A)})}}return Object.assign(m,{extend:w(m)})}const mb=new p8(8192);function nxe(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(mb.get(r))return mb.get(r);const n=t().finally(()=>mb.delete(r));return mb.set(r,n),n}function jS(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const a=async({count:o=0}={})=>{const l=async({error:c})=>{const u=typeof e=="function"?e({count:o,error:c}):e;u&&await MS(u),a({count:o+1})};try{const c=await t();i(c)}catch(c){if(o{const{dedupe:i=!1,retryDelay:s=150,retryCount:a=3,uid:o}={...e,...n},l=i?Vi(rg(`${o}.${Zi(r)}`)):void 0;return nxe(()=>jS(async()=>{try{return await t(r)}catch(c){const u=c;switch(u.code){case D2.code:throw new D2(u);case F2.code:throw new F2(u);case U2.code:throw new U2(u,{method:r.method});case B2.code:throw new B2(u);case A0.code:throw new A0(u);case S0.code:throw new S0(u);case W2.code:throw new W2(u);case z2.code:throw new z2(u);case H2.code:throw new H2(u);case q2.code:throw new q2(u,{method:r.method});case ng.code:throw new ng(u);case V2.code:throw new V2(u);case L1.code:throw new L1(u);case G2.code:throw new G2(u);case K2.code:throw new K2(u);case Y2.code:throw new Y2(u);case Z2.code:throw new Z2(u);case J2.code:throw new J2(u);case 5e3:throw new L1(u);default:throw c instanceof Je?c:new Z8e(u)}}},{delay:({count:c,error:u})=>{var f;if(u&&u instanceof Vy){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<sxe(c)}),{enabled:i,id:l})}}function sxe(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===ng.code||t.code===A0.code:t instanceof Vy&&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 WZ({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:a},o){const l=UZ();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:a},request:ixe(r,{retryCount:n,retryDelay:i,uid:l}),value:o}}function zZ(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>WZ({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}class axe extends Je{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 oxe(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let a;try{const o=new AbortController;r>0&&(a=setTimeout(()=>{n?o.abort():s(e)},r)),i(await t({signal:(o==null?void 0:o.signal)||null}))}catch(o){(o==null?void 0:o.name)==="AbortError"&&s(e),s(o)}finally{clearTimeout(a)}})()})}function lxe(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const gD=lxe();function cxe(t,e={}){return{async request(r){var f;const{body:n,onRequest:i=e.onRequest,onResponse:s=e.onResponse,timeout:a=e.timeout??1e4}=r,o={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:l,method:c,signal:u}=o;try{const h=await oxe(async({signal:m})=>{const w={...o,body:Array.isArray(n)?Zi(n.map(A=>({jsonrpc:"2.0",id:A.id??gD.take(),...A}))):Zi({jsonrpc:"2.0",id:n.id??gD.take(),...n}),headers:{"Content-Type":"application/json",...l},method:c||"POST",signal:u||(a>0?m:null)},E=new Request(t,w),v=await(i==null?void 0:i(E,w))??{...w,url:t};return await fetch(v.url??t,v)},{errorInstance:new sD({body:n,url:t}),timeout:a,signal:!0});s&&await s(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 Vy({body:n,details:Zi(g.error)||h.statusText,headers:h.headers,status:h.status,url:t});return g}catch(h){throw h instanceof Vy||h instanceof sD?h:new Vy({body:n,cause:h,url:t})}}}}function Ql(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",onFetchRequest:a,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,E=t||(c==null?void 0:c.rpcUrls.default.http[0]);if(!E)throw new axe;const v=cxe(E,{fetchOptions:n,onRequest:a,onResponse:o,timeout:w});return WZ({key:i,name:s,async request({method:_,params:A}){const C={method:_,params:A},{schedule:R}=DZ({id:E,wait:g,shouldSplitBatch(G){return G.length>h},fn:G=>v.request({body:G}),sort:(G,ae)=>G.id-ae.id}),B=async G=>r?R(G):[await v.request({body:G})],[{error:S,result:U}]=await B(C);if(S)throw new lk({body:C,error:S,url:E});return U},retryCount:m,retryDelay:l,timeout:w,type:"http"},{fetchOptions:n,url:E})}}function Ck(t,e){var n,i,s,a,o,l;if(!(t instanceof Je))return!1;const r=t.walk(c=>c instanceof xS);return r instanceof xS?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((s=r.data)==null?void 0:s.errorName)==="ResolverNotContract"||((a=r.data)==null?void 0:a.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===lZ[50]):!1}function HZ(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return Zl(e)?e:null}function v5(t){let e=new Uint8Array(32).fill(0);if(!t)return vi(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=HZ(r[n]),s=i?Wg(i):Vi(n0(r[n]),"bytes");e=Vi(vd([e,s]),"bytes")}return vi(e)}function uxe(t){return`[${t.slice(2)}]`}function dxe(t){const e=new Uint8Array(32).fill(0);return t?HZ(t)||Vi(n0(t)):vi(e)}function $8(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 s=0;s255&&(a=n0(uxe(dxe(i[s])))),r[n]=a.length,r.set(a,n+1),n+=a.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function fxe(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:s,strict:a,universalResolverAddress:o}){let l=o;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Gg({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c=ac({abi:fD,functionName:"addr",...n!=null?{args:[v5(i),BigInt(n)]}:{args:[v5(i)]}}),u={address:l,abi:MZ,functionName:"resolve",args:[ur($8(i)),c],blockNumber:e,blockTag:r},f=nr(t,bd,"readContract"),h=s?await f({...u,args:[...u.args,s]}):await f(u);if(h[0]==="0x")return null;const g=K0({abi:fD,args:n!=null?[v5(i),BigInt(n)]:void 0,functionName:"addr",data:h[0]});return g==="0x"||ql(g)==="0x00"?null:g}catch(c){if(a)throw c;if(Ck(c,"resolve"))return null;throw c}}class hxe extends Je{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 Qm extends Je{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class Ak extends Je{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 pxe extends Je{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const gxe=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,mxe=/^(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\-.]+))?(?\/.*)?$/,yxe=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,vxe=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function wxe(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 mD(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function qZ({uri:t,gatewayUrls:e}){const r=yxe.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=mD(e==null?void 0:e.ipfs,"https://ipfs.io"),i=mD(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(gxe),{protocol:a,subpath:o,target:l,subtarget:c=""}=(s==null?void 0:s.groups)||{},u=a==="ipns:/"||o==="ipns/",f=a==="ipfs:/"||o==="ipfs/"||mxe.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(a==="ar:/"&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let h=t.replace(vxe,"");if(h.startsWith("i.json());return await Sk({gatewayUrls:t,uri:VZ(r)})}catch{throw new Ak({uri:e})}}async function Sk({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=qZ({uri:e,gatewayUrls:t});if(n||await wxe(r))return r;throw new Ak({uri:e})}function _xe(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,a]=r.split(":"),[o,l]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Qm({reason:"Only EIP-155 supported"});if(!a)throw new Qm({reason:"Chain ID not found"});if(!l)throw new Qm({reason:"Contract address not found"});if(!i)throw new Qm({reason:"Token ID not found"});if(!o)throw new Qm({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a),namespace:o.toLowerCase(),contractAddress:l,tokenID:i}}async function xxe(t,{nft:e}){if(e.namespace==="erc721")return bd(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 bd(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 pxe({namespace:e.namespace})}async function Exe(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?Cxe(t,{gatewayUrls:e,record:r}):Sk({uri:r,gatewayUrls:e})}async function Cxe(t,{gatewayUrls:e,record:r}){const n=_xe(r),i=await xxe(t,{nft:n}),{uri:s,isOnChain:a,isEncoded:o}=qZ({uri:i,gatewayUrls:e});if(a&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const c=o?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(c);return Sk({uri:VZ(u),gatewayUrls:e})}let l=n.tokenID;return n.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),bxe({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,l)})}async function GZ(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:s,strict:a,universalResolverAddress:o}){let l=o;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Gg({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c={address:l,abi:MZ,functionName:"resolve",args:[ur($8(n)),ac({abi:dD,functionName:"text",args:[v5(n),i]})],blockNumber:e,blockTag:r},u=nr(t,bd,"readContract"),f=s?await u({...c,args:[...c.args,s]}):await u(c);if(f[0]==="0x")return null;const h=K0({abi:dD,functionName:"text",data:f[0]});return h===""?null:h}catch(c){if(a)throw c;if(Ck(c,"resolve"))return null;throw c}}async function Axe(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:a,universalResolverAddress:o}){const l=await nr(t,GZ,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:o,gatewayUrls:s,strict:a});if(!l)return null;try{return await Exe(t,{record:l,gatewayUrls:n})}catch{return null}}async function Sxe(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:s,universalResolverAddress:a}){let o=a;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=Gg({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const l=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const c={address:o,abi:N_e,functionName:"reverse",args:[ur($8(l))],blockNumber:r,blockTag:n},u=nr(t,bd,"readContract"),[f,h]=i?await u({...c,args:[...c.args,i]}):await u(c);return e.toLowerCase()!==h.toLowerCase()?null:f}catch(c){if(s)throw c;if(Ck(c,"reverse"))return null;throw c}}async function Ixe(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=Gg({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[a]=await nr(t,bd,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ur($8(n))],blockNumber:e,blockTag:r});return a}async function Txe(t,e){var E,v,_;const{account:r=t.account,blockNumber:n,blockTag:i="latest",blobs:s,data:a,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g,...m}=e,w=r?sa(r):void 0;try{G0(e);const C=(n?lr(n):void 0)||i,R=(_=(v=(E=t.chain)==null?void 0:E.formatters)==null?void 0:v.transactionRequest)==null?void 0:_.format,S=(R||Vg)({...b8(m,{format:R}),from:w==null?void 0:w.address,blobs:s,data:a,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g}),U=await t.request({method:"eth_createAccessList",params:[S,C]});return{accessList:U.accessList,gasUsed:BigInt(U.gasUsed)}}catch(A){throw jZ(A,{...e,account:w,chain:t.chain})}}async function $xe(t){const e=m8(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function KZ(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:a,toBlock:o}={}){const l=i??(n?[n]:void 0),c=m8(t,{method:"eth_newFilter"});let u=[];l&&(u=[l.flatMap(g=>Dv({abi:[g],eventName:g.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?lr(s):s,toBlock:typeof o=="bigint"?lr(o):o,...u.length?{topics:u}:{}}]});return{abi:l,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:c(f),strict:!!a,toBlock:o,type:"event"}}async function YZ(t){const e=m8(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function kxe(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}async function Nxe(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?lr(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]},{dedupe:!!i}),au(s)}async function yD(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?lr(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]},{dedupe:!!i});if(s!=="0x")return s}function Pxe(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 Rxe(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?lr(r):void 0,a=await t.request({method:"eth_feeHistory",params:[lr(e),s||n,i]},{dedupe:!!s});return Pxe(a)}async function Mxe(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>wd(s));return e.abi?bk({abi:e.abi,logs:i,strict:r}):i}function Oxe(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}class jxe extends Je{constructor({domain:e}){super(`Invalid domain "${Zi(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Lxe extends Je{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 Dxe extends Je{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Fxe(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:tJ({domain:e}),...t.types};eJ({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(Uxe({domain:e,types:i})),n!=="EIP712Domain"&&s.push(ZZ({data:r,primaryType:n,types:i})),Vi(vd(s))}function Uxe({domain:t,types:e}){return ZZ({data:t,primaryType:"EIP712Domain",types:e})}function ZZ({data:t,primaryType:e,types:r}){const n=JZ({data:t,primaryType:e,types:r});return Vi(n)}function JZ({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[Bxe({primaryType:e,types:r})];for(const s of r[e]){const[a,o]=XZ({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(a),i.push(o)}return zg(n,i)}function Bxe({primaryType:t,types:e}){const r=ur(Wxe({primaryType:t,types:e}));return Vi(r)}function Wxe({primaryType:t,types:e}){let r="";const n=QZ({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:a,type:o})=>`${o} ${a}`).join(",")})`;return r}function QZ({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 s of e[i])QZ({primaryType:s.type,types:e},r);return r}function XZ({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Vi(JZ({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Vi(n)];if(r==="string")return[{type:"bytes32"},Vi(ur(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(a=>XZ({name:e,type:i,types:t,value:a}));return[{type:"bytes32"},Vi(zg(s.map(([a])=>a),s.map(([,a])=>a)))]}return[{type:r},n]}function zxe(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(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},a=i.EIP712Domain?e?s(i.EIP712Domain,e):{}:{},o=(()=>{if(n!=="EIP712Domain")return s(i[n],r)})();return Zi({domain:a,message:o,primaryType:n,types:i})}function eJ(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(a,o)=>{for(const l of a){const{name:c,type:u}=l,f=o[c],h=u.match(sZ);if(h&&(typeof f=="number"||typeof f=="bigint")){const[w,E,v]=h;lr(f,{signed:E==="int",size:Number.parseInt(v)/8})}if(u==="address"&&typeof f=="string"&&!Sn(f))throw new ta({address:f});const g=u.match(u8e);if(g){const[w,E]=g;if(E&&ei(f)!==Number.parseInt(E))throw new _6e({expectedSize:Number.parseInt(E),givenSize:ei(f)})}const m=i[u];m&&(Hxe(u),s(m,f))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new jxe({domain:e});s(i.EIP712Domain,e)}if(n!=="EIP712Domain")if(i[n])s(i[n],r);else throw new Lxe({primaryType:n,types:i})}function tJ({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 Hxe(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new Dxe({type:t})}function qxe(t){const{abi:e,data:r}=t,n=C0(r,0,4),i=e.find(s=>s.type==="function"&&n===g8(su(s)));if(!i)throw new w6e(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?Hg(i.inputs,C0(r,4)):void 0}}const Vxe={"0x0":"reverted","0x1":"success"};function rJ(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=>wd(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?au(t.transactionIndex):null,status:t.status?Vxe[t.status]:null,type:t.type?bZ[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const Gxe=ck("transactionReceipt",rJ),Kxe=`Ethereum Signed Message: +`;function Yxe(t){const e=typeof t=="string"?rg(t):typeof t.raw=="string"?t.raw:vi(t.raw),r=rg(`${Kxe}${ei(e)}`);return vd([r,e])}function nJ(t,e){return Vi(Yxe(t),e)}const iJ="0x6492649264926492649264926492649264926492649264926492649264926492";function Zxe(t){return iZ(t,-32)===iJ}function Jxe(t){const{address:e,data:r,signature:n,to:i="hex"}=t,s=du([zg([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,r,n]),iJ]);return i==="hex"?s:Jl(s)}function Qxe(t){const{authorizationList:e}=t;if(e)for(const r of e){const{contractAddress:n,chainId:i}=r;if(!Sn(n))throw new ta({address:n});if(i<0)throw new C8({chainId:i})}Ik(t)}function Xxe(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new IZ;for(const r of e){const n=ei(r),i=au(C0(r,0,1));if(n!==32)throw new A_e({hash:r,size:n});if(i!==SZ)throw new S_e({hash:r,version:i})}}Ik(t)}function Ik(t){const{chainId:e,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=t;if(e<=0)throw new C8({chainId:e});if(i&&!Sn(i))throw new ta({address:i});if(n&&n>_8)throw new T0({maxFeePerGas:n});if(r&&n&&r>n)throw new Q2({maxFeePerGas:n,maxPriorityFeePerGas:r})}function e7e(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:s}=t;if(e<=0)throw new C8({chainId:e});if(s&&!Sn(s))throw new ta({address:s});if(r||i)throw new Je("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>_8)throw new T0({maxFeePerGas:n})}function t7e(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:s}=t;if(s&&!Sn(s))throw new ta({address:s});if(typeof e<"u"&&e<=0)throw new C8({chainId:e});if(r||i)throw new Je("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>_8)throw new T0({maxFeePerGas:n})}function r7e(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{contractAddress:n,chainId:i,nonce:s,...a}=r;e.push([i?ur(i):"0x",n,s?ur(s):"0x",...Vv({},a)])}return e}function k8(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(B=>vi(B)),C=t.kzg,R=pk({blobs:A,kzg:C});if(typeof h>"u"&&(h=EZ({commitments:R})),typeof g>"u"){const B=gk({blobs:A,commitments:R,kzg:C});g=TZ({blobs:A,commitments:R,proofs:B})}}const m=k8(u),w=[ur(r),i?ur(i):"0x",c?ur(c):"0x",l?ur(l):"0x",n?ur(n):"0x",s??"0x",a?ur(a):"0x",f??"0x",m,o?ur(o):"0x",h??[],...Vv(t,e)],E=[],v=[],_=[];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 U8e({v:e.v});return g})(),f=ql(e.r),h=ql(e.s);c=[...c,ur(u),f==="0x00"?"0x":f,h==="0x00"?"0x":h]}else r>0&&(c=[...c,ur(r),"0x","0x"]);return Ff(c)}function Vv(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 s=ql(r.r),a=ql(r.s);return[typeof i=="number"?i?ur(1):"0x":n===0n?"0x":n===1n?ur(1):n===27n?"0x":ur(1),s==="0x00"?"0x":s,a==="0x00"?"0x":a]}class c7e extends Je{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function u7e(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new c7e({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[s,a,o]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],l=Math.round(+`${a}.${o}`);l>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${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 sJ(t,e="wei"){return u7e(t,dZ[e])}function d7e(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function f7e(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?au(t.nonce):void 0,storageProof:t.storageProof?d7e(t.storageProof):void 0}}async function h7e(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const s=n??"latest",a=r!==void 0?lr(r):void 0,o=await t.request({method:"eth_getProof",params:[e,i,a||s]});return f7e(o)}async function p7e(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?lr(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function Tk(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var u,f,h;const a=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(s)]},{dedupe:!0}):(o||a)&&(l=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||a,lr(s)]},{dedupe:!!o})),!l)throw new fZ({blockHash:e,blockNumber:r,blockTag:a,hash:i,index:s});return(((h=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:h.format)||x8)(l)}async function g7e(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([nr(t,Hv,"getBlockNumber")({}),e?nr(t,Tk,"getTransaction")({hash:e}):void 0]),s=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return s?n-s+1n:0n}async function LS(t,{hash:e}){var i,s,a;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new hZ({hash:e});return(((a=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:a.format)||rJ)(r)}async function m7e(t,e){var E;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:s,multicallAddress:a,stateOverride:o}=e,l=e.contracts,c=n??(typeof((E=t.batch)==null?void 0:E.multicall)=="object"&&t.batch.multicall.batchSize||1024);let u=a;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=Gg({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=(B.length-2)/2,f[h]=[]),f[h]=[...f[h],{allowFailure:!0,callData:B,target:A}]}catch(B){const S=I0(B,{abi:_,address:A,args:C,docsPath:"/docs/contract/multicall",functionName:R});if(!r)throw S;f[h]=[...f[h],{allowFailure:!0,callData:"0x",target:A}]}}const m=await Promise.allSettled(f.map(v=>nr(t,bd,"readContract")({abi:PS,address:u,args:[v],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:o}))),w=[];for(let v=0;ve.toString(16).padStart(2,"0"));function sg(t){Gv(t);let e="";for(let r=0;r=Nu._0&&t<=Nu._9)return t-Nu._0;if(t>=Nu.A&&t<=Nu.F)return t-(Nu.A-10);if(t>=Nu.a&&t<=Nu.f)return t-(Nu.a-10)}function ag(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,s=0;itypeof t=="bigint"&&N8<=t;function R8(t,e,r){return rE(t)&&rE(e)&&rE(r)&&e<=t&&tN8;t>>=P8,e+=1);return e}function x7e(t,e){return t>>BigInt(e)&P8}function E7e(t,e,r){return t|(r?P8:N8)<(y7e<new Uint8Array(t),wD=t=>Uint8Array.from(t);function oJ(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=nE(t),i=nE(t),s=0;const a=()=>{n.fill(1),i.fill(0),s=0},o=(...f)=>r(i,n,...f),l=(f=nE())=>{i=o(wD([0]),f),n=o(),f.length!==0&&(i=o(wD([1]),f),n=o())},c=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{a(),l(f);let g;for(;!(g=h(c()));)l();return a(),g}}const C7e={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"||$0(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 Kv(t,e,r={}){const n=(i,s,a)=>{const o=C7e[s];if(typeof o!="function")throw new Error("invalid validator function");const l=t[i];if(!(a&&l===void 0)&&!o(l,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+l)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}const A7e=()=>{throw new Error("not implemented")};function DS(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}const S7e=Object.freeze(Object.defineProperty({__proto__:null,aInRange:s0,abool:ig,abytes:Gv,bitGet:x7e,bitLen:aJ,bitMask:Pk,bitSet:E7e,bytesToHex:sg,bytesToNumberBE:i0,bytesToNumberLE:kk,concatBytes:X2,createHmacDrbg:oJ,ensureBytes:Nl,equalBytes:b7e,hexToBytes:ag,hexToNumber:$k,inRange:R8,isBytes:$0,memoized:DS,notImplemented:A7e,numberToBytesBE:og,numberToBytesLE:Nk,numberToHexUnpadded:b1,numberToVarBytesBE:w7e,utf8ToBytes:_7e,validateObject:Kv},Symbol.toStringTag,{value:"Module"})),I7e="0.1.1";function T7e(){return I7e}class ev extends Error{constructor(e,r={}){const n=(()=>{var l;if(r.cause instanceof ev){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 ev&&r.cause.docsPath||r.docsPath,a=`https://oxlib.sh${i??""}`,o=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i?["",n?`Details: ${n}`:void 0,i?`See: ${a}`: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@${T7e()}`}),this.cause=r.cause,this.details=n,this.docs=a,this.docsPath=i,this.shortMessage=e}walk(e){return lJ(this,e)}}function lJ(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?lJ(t.cause,e):e?null:t}function $7e(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 P7e({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function Ku(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let s;n?r?s=(1n<s||i{const v=E,_=v.account?sa(v.account):void 0,A={...v,data:v.abi?ac(v):v.data,from:v.from??(_==null?void 0:_.address)};return G0(A),Vg(A)}),w=h.stateOverrides?uk(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:s,traceTransfers:a,validation:o},u]})).map((h,g)=>({...fk(h),calls:h.calls.map((m,w)=>{var ae,K;const{abi:E,args:v,functionName:_,to:A}=i[g].calls[w],C=((ae=m.error)==null?void 0:ae.data)??m.returnData,R=BigInt(m.gasUsed),B=(K=m.logs)==null?void 0:K.map(N=>wd(N)),S=m.status==="0x1"?"success":"failure",U=E?K0({abi:E,data:C,functionName:_}):null,G=(()=>{var k;if(S==="success")return;let N;if(((k=m.error)==null?void 0:k.data)==="0x"?N=new Ov:m.error&&(N=new v8(m.error)),!!N)return I0(N,{abi:E??[],address:A,args:v,functionName:_??""})})();return{data:C,gasUsed:R,logs:B,status:S,...S==="success"?{result:U}:{error:G}}})}))}catch(l){const c=l,u=w8(c,{});throw u instanceof Bv?c:u}}function bD(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function j7e(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function M8(t,...e){if(!j7e(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 L7e(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");bD(t.outputLen),bD(t.blockLen)}function N4(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 D7e(t,e){M8(t);const r=e.outputLen;if(t.lengthnew DataView(t.buffer,t.byteOffset,t.byteLength),vc=(t,e)=>t<<32-e|t>>>e;function F7e(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function Rk(t){return typeof t=="string"&&(t=F7e(t)),M8(t),t}function U7e(...t){let e=0;for(let n=0;nt().update(Rk(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function W7e(t=32){if(jp&&typeof jp.getRandomValues=="function")return jp.getRandomValues(new Uint8Array(t));if(jp&&typeof jp.randomBytes=="function")return jp.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function z7e(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),l=n?4:0,c=n?0:4;t.setUint32(e+l,a,n),t.setUint32(e+c,o,n)}const H7e=(t,e,r)=>t&e^~t&r,q7e=(t,e,r)=>t&e^t&r^e&r;class V7e extends cJ{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=iE(this.buffer)}update(e){N4(this);const{view:r,buffer:n,blockLen:i}=this;e=Rk(e);const s=e.length;for(let a=0;ai-a&&(this.process(n,0),a=0);for(let f=a;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=vc(g,17)^vc(g,19)^g>>>10;Xd[f]=w+Xd[f-7]+m+Xd[f-16]|0}let{A:n,B:i,C:s,D:a,E:o,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=vc(o,6)^vc(o,11)^vc(o,25),g=u+h+H7e(o,l,c)+G7e[f]+Xd[f]|0,w=(vc(n,2)^vc(n,13)^vc(n,22))+q7e(n,i,s)|0;u=c,c=l,l=o,o=a+g|0,a=s,s=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+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,s,a,o,l,c,u)}roundClean(){Xd.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Y7e=B7e(()=>new K7e);let uJ=class extends cJ{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,L7e(e);const n=Rk(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,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let a=0;anew uJ(t,e).update(r).digest();dJ.create=(t,e)=>new uJ(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Gi=BigInt(0),ui=BigInt(1),Fh=BigInt(2),Z7e=BigInt(3),FS=BigInt(4),_D=BigInt(5),xD=BigInt(8);function xa(t,e){const r=t%e;return r>=Gi?r:e+r}function J7e(t,e,r){if(eGi;)e&ui&&(n=n*t%r),t=t*t%r,e>>=ui;return n}function Lo(t,e,r){let n=t;for(;e-- >Gi;)n*=n,n%=r;return n}function US(t,e){if(t===Gi)throw new Error("invert: expected non-zero number");if(e<=Gi)throw new Error("invert: expected positive modulus, got "+e);let r=xa(t,e),n=e,i=Gi,s=ui;for(;r!==Gi;){const o=n/r,l=n%r,c=i-s*o;n=r,r=l,i=s,s=c}if(n!==ui)throw new Error("invert: does not exist");return xa(i,e)}function Q7e(t){const e=(t-ui)/Fh;let r,n,i;for(r=t-ui,n=0;r%Fh===Gi;r/=Fh,n++);for(i=Fh;i1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const a=(t+ui)/FS;return function(l,c){const u=l.pow(c,a);if(!l.eql(l.sqr(u),c))throw new Error("Cannot find square root");return u}}const s=(r+ui)/Fh;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,s),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 Kv(t,r)}function r9e(t,e,r){if(rGi;)r&ui&&(n=t.mul(n,i)),i=t.sqr(i),r>>=ui;return n}function n9e(t,e){const r=new Array(e.length),n=e.reduce((s,a,o)=>t.is0(a)?s:(r[o]=s,t.mul(s,a)),t.ONE),i=t.inv(n);return e.reduceRight((s,a,o)=>t.is0(a)?s:(r[o]=t.mul(s,r[o]),t.mul(s,a)),i),r}function fJ(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function hJ(t,e,r=!1,n={}){if(t<=Gi)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=fJ(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const o=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:Pk(i),ZERO:Gi,ONE:ui,create:l=>xa(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return Gi<=l&&ll===Gi,isOdd:l=>(l&ui)===ui,neg:l=>xa(-l,t),eql:(l,c)=>l===c,sqr:l=>xa(l*l,t),add:(l,c)=>xa(l+c,t),sub:(l,c)=>xa(l-c,t),mul:(l,c)=>xa(l*c,t),pow:(l,c)=>r9e(o,l,c),div:(l,c)=>xa(l*US(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>US(l,t),sqrt:n.sqrt||(l=>(a||(a=X7e(t)),a(o,l))),invertBatch:l=>n9e(o,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>r?Nk(l,s):og(l,s),fromBytes:l=>{if(l.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+l.length);return r?kk(l):i0(l)}});return Object.freeze(o)}function pJ(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 gJ(t){const e=pJ(t);return e+Math.ceil(e/2)}function i9e(t,e,r=!1){const n=t.length,i=pJ(e),s=gJ(e);if(n<16||n1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const a=r?i0(t):kk(t),o=xa(a,e-ui)+ui;return r?Nk(o,i):og(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ED=BigInt(0),yb=BigInt(1);function sE(t,e){const r=e.negate();return t?r:e}function mJ(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function aE(t,e){mJ(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function s9e(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 a9e(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 oE=new WeakMap,yJ=new WeakMap;function lE(t){return yJ.get(t)||1}function o9e(t,e){return{constTimeNegate:sE,hasPrecomputes(r){return lE(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>ED;)n&yb&&(i=i.add(s)),s=s.double(),n>>=yb;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=aE(n,e),a=[];let o=r,l=o;for(let c=0;c>=f,m>a&&(m-=u,i+=yb);const w=g,E=g+Math.abs(m)-1,v=h%2!==0,_=m<0;m===0?l=l.add(sE(v,n[w])):o=o.add(sE(_,n[E]))}return{p:o,f:l}},wNAFUnsafe(r,n,i,s=t.ZERO){const{windows:a,windowSize:o}=aE(r,e),l=BigInt(2**r-1),c=2**r,u=BigInt(r);for(let f=0;f>=u,g>o&&(g-=c,i+=yb),g===0)continue;let m=n[h+Math.abs(g)-1];g<0&&(m=m.negate()),s=s.add(m)}return s},getPrecomputes(r,n,i){let s=oE.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&oE.set(n,i(s))),s},wNAFCached(r,n,i){const s=lE(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const a=lE(r);return a===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(a,this.getPrecomputes(a,r,i),n,s)},setWindowSize(r,n){mJ(n,e),yJ.set(r,n),oE.delete(r)}}}function l9e(t,e,r,n){if(s9e(r,t),a9e(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=aJ(BigInt(r.length)),a=s>12?s-3:s>4?s-2:s?2:1,o=(1<=0;f-=a){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}=Yu;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=b1(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?b1(i.length/2|128):"";return b1(t)+s+i+e},decode(t,e){const{Err:r}=Yu;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++],s=!!(i&128);let a=0;if(!s)a=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)a=a<<8|u;if(n+=l,a<128)throw new r("tlv.decode(long): not minimal encoding")}const o=e.subarray(n,n+a);if(o.length!==a)throw new r("tlv.decode: wrong value length");return{v:o,l:e.subarray(n+a)}}},_int:{encode(t){const{Err:e}=Yu;if(t{const _=E.toAffine();return X2(Uint8Array.from([4]),r.toBytes(_.x),r.toBytes(_.y))}),s=e.fromBytes||(w=>{const E=w.subarray(1),v=r.fromBytes(E.subarray(0,r.BYTES)),_=r.fromBytes(E.subarray(r.BYTES,2*r.BYTES));return{x:v,y:_}});function a(w){const{a:E,b:v}=e,_=r.sqr(w),A=r.mul(_,w);return r.add(r.add(A,r.mul(w,E)),v)}if(!r.eql(r.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function o(w){return R8(w,Di,e.n)}function l(w){const{allowedPrivateKeyLengths:E,nByteLength:v,wrapPrivateKey:_,n:A}=e;if(E&&typeof w!="bigint"){if($0(w)&&(w=sg(w)),typeof w!="string"||!E.includes(w.length))throw new Error("invalid private key");w=w.padStart(v*2,"0")}let C;try{C=typeof w=="bigint"?w:i0(Nl("private key",w,v))}catch{throw new Error("invalid private key, expected hex or "+v+" bytes, got "+typeof w)}return _&&(C=xa(C,A)),s0("private key",C,Di,A),C}function c(w){if(!(w instanceof h))throw new Error("ProjectivePoint expected")}const u=DS((w,E)=>{const{px:v,py:_,pz:A}=w;if(r.eql(A,r.ONE))return{x:v,y:_};const C=w.is0();E==null&&(E=C?r.ONE:r.inv(A));const R=r.mul(v,E),B=r.mul(_,E),S=r.mul(A,E);if(C)return{x:r.ZERO,y:r.ZERO};if(!r.eql(S,r.ONE))throw new Error("invZ was invalid");return{x:R,y:B}}),f=DS(w=>{if(w.is0()){if(e.allowInfinityPoint&&!r.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:E,y:v}=w.toAffine();if(!r.isValid(E)||!r.isValid(v))throw new Error("bad point: x or y not FE");const _=r.sqr(v),A=a(E);if(!r.eql(_,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(E,v,_){if(this.px=E,this.py=v,this.pz=_,E==null||!r.isValid(E))throw new Error("x required");if(v==null||!r.isValid(v))throw new Error("y required");if(_==null||!r.isValid(_))throw new Error("z required");Object.freeze(this)}static fromAffine(E){const{x:v,y:_}=E||{};if(!E||!r.isValid(v)||!r.isValid(_))throw new Error("invalid affine point");if(E instanceof h)throw new Error("projective point not allowed");const A=C=>r.eql(C,r.ZERO);return A(v)&&A(_)?h.ZERO:new h(v,_,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(E){const v=r.invertBatch(E.map(_=>_.pz));return E.map((_,A)=>_.toAffine(v[A])).map(h.fromAffine)}static fromHex(E){const v=h.fromAffine(s(Nl("pointHex",E)));return v.assertValidity(),v}static fromPrivateKey(E){return h.BASE.multiply(l(E))}static msm(E,v){return l9e(h,n,E,v)}_setWindowSize(E){m.setWindowSize(this,E)}assertValidity(){f(this)}hasEvenY(){const{y:E}=this.toAffine();if(r.isOdd)return!r.isOdd(E);throw new Error("Field doesn't support isOdd")}equals(E){c(E);const{px:v,py:_,pz:A}=this,{px:C,py:R,pz:B}=E,S=r.eql(r.mul(v,B),r.mul(C,A)),U=r.eql(r.mul(_,B),r.mul(R,A));return S&&U}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:E,b:v}=e,_=r.mul(v,AD),{px:A,py:C,pz:R}=this;let B=r.ZERO,S=r.ZERO,U=r.ZERO,G=r.mul(A,A),ae=r.mul(C,C),K=r.mul(R,R),N=r.mul(A,C);return N=r.add(N,N),U=r.mul(A,R),U=r.add(U,U),B=r.mul(E,U),S=r.mul(_,K),S=r.add(B,S),B=r.sub(ae,S),S=r.add(ae,S),S=r.mul(B,S),B=r.mul(N,B),U=r.mul(_,U),K=r.mul(E,K),N=r.sub(G,K),N=r.mul(E,N),N=r.add(N,U),U=r.add(G,G),G=r.add(U,G),G=r.add(G,K),G=r.mul(G,N),S=r.add(S,G),K=r.mul(C,R),K=r.add(K,K),G=r.mul(K,N),B=r.sub(B,G),U=r.mul(K,ae),U=r.add(U,U),U=r.add(U,U),new h(B,S,U)}add(E){c(E);const{px:v,py:_,pz:A}=this,{px:C,py:R,pz:B}=E;let S=r.ZERO,U=r.ZERO,G=r.ZERO;const ae=e.a,K=r.mul(e.b,AD);let N=r.mul(v,C),k=r.mul(_,R),b=r.mul(A,B),x=r.add(v,_),P=r.add(C,R);x=r.mul(x,P),P=r.add(N,k),x=r.sub(x,P),P=r.add(v,A);let D=r.add(C,B);return P=r.mul(P,D),D=r.add(N,b),P=r.sub(P,D),D=r.add(_,A),S=r.add(R,B),D=r.mul(D,S),S=r.add(k,b),D=r.sub(D,S),G=r.mul(ae,P),S=r.mul(K,b),G=r.add(S,G),S=r.sub(k,G),G=r.add(k,G),U=r.mul(S,G),k=r.add(N,N),k=r.add(k,N),b=r.mul(ae,b),P=r.mul(K,P),k=r.add(k,b),b=r.sub(N,b),b=r.mul(ae,b),P=r.add(P,b),N=r.mul(k,P),U=r.add(U,N),N=r.mul(D,P),S=r.mul(x,S),S=r.sub(S,N),N=r.mul(x,k),G=r.mul(D,G),G=r.add(G,N),new h(S,U,G)}subtract(E){return this.add(E.negate())}is0(){return this.equals(h.ZERO)}wNAF(E){return m.wNAFCached(this,E,h.normalizeZ)}multiplyUnsafe(E){const{endo:v,n:_}=e;s0("scalar",E,ed,_);const A=h.ZERO;if(E===ed)return A;if(this.is0()||E===Di)return this;if(!v||m.hasPrecomputes(this))return m.wNAFCachedUnsafe(this,E,h.normalizeZ);let{k1neg:C,k1:R,k2neg:B,k2:S}=v.splitScalar(E),U=A,G=A,ae=this;for(;R>ed||S>ed;)R&Di&&(U=U.add(ae)),S&Di&&(G=G.add(ae)),ae=ae.double(),R>>=Di,S>>=Di;return C&&(U=U.negate()),B&&(G=G.negate()),G=new h(r.mul(G.px,v.beta),G.py,G.pz),U.add(G)}multiply(E){const{endo:v,n:_}=e;s0("scalar",E,Di,_);let A,C;if(v){const{k1neg:R,k1:B,k2neg:S,k2:U}=v.splitScalar(E);let{p:G,f:ae}=this.wNAF(B),{p:K,f:N}=this.wNAF(U);G=m.constTimeNegate(R,G),K=m.constTimeNegate(S,K),K=new h(r.mul(K.px,v.beta),K.py,K.pz),A=G.add(K),C=ae.add(N)}else{const{p:R,f:B}=this.wNAF(E);A=R,C=B}return h.normalizeZ([A,C])[0]}multiplyAndAddUnsafe(E,v,_){const A=h.BASE,C=(B,S)=>S===ed||S===Di||!B.equals(A)?B.multiplyUnsafe(S):B.multiply(S),R=C(this,v).add(C(E,_));return R.is0()?void 0:R}toAffine(E){return u(this,E)}isTorsionFree(){const{h:E,isTorsionFree:v}=e;if(E===Di)return!0;if(v)return v(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:E,clearCofactor:v}=e;return E===Di?this:v?v(h,this):this.multiplyUnsafe(e.h)}toRawBytes(E=!0){return ig("isCompressed",E),this.assertValidity(),i(h,this,E)}toHex(E=!0){return ig("isCompressed",E),sg(this.toRawBytes(E))}}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=o9e(h,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:o}}function h9e(t){const e=vJ(t);return Kv(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function p9e(t){const e=h9e(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function a(b){return xa(b,n)}function o(b){return US(b,n)}const{ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:u,isWithinCurveOrder:f}=f9e({...e,toBytes(b,x,P){const D=x.toAffine(),O=r.toBytes(D.x),j=X2;return ig("isCompressed",P),P?j(Uint8Array.from([x.hasEvenY()?2:3]),O):j(Uint8Array.from([4]),O,r.toBytes(D.y))},fromBytes(b){const x=b.length,P=b[0],D=b.subarray(1);if(x===i&&(P===2||P===3)){const O=i0(D);if(!R8(O,Di,r.ORDER))throw new Error("Point is not on curve");const j=u(O);let T;try{T=r.sqrt(j)}catch(X){const le=X instanceof Error?": "+X.message:"";throw new Error("Point is not on curve"+le)}const L=(T&Di)===Di;return(P&1)===1!==L&&(T=r.neg(T)),{x:O,y:T}}else if(x===s&&P===4){const O=r.fromBytes(D.subarray(0,r.BYTES)),j=r.fromBytes(D.subarray(r.BYTES,2*r.BYTES));return{x:O,y:j}}else{const O=i,j=s;throw new Error("invalid Point, expected length of "+O+", or uncompressed "+j+", got "+x)}}}),h=b=>sg(og(b,e.nByteLength));function g(b){const x=n>>Di;return b>x}function m(b){return g(b)?a(-b):b}const w=(b,x,P)=>i0(b.slice(x,P));class E{constructor(x,P,D){this.r=x,this.s=P,this.recovery=D,this.assertValidity()}static fromCompact(x){const P=e.nByteLength;return x=Nl("compactSignature",x,P*2),new E(w(x,0,P),w(x,P,2*P))}static fromDER(x){const{r:P,s:D}=Yu.toSig(Nl("DER",x));return new E(P,D)}assertValidity(){s0("r",this.r,Di,n),s0("s",this.s,Di,n)}addRecoveryBit(x){return new E(this.r,this.s,x)}recoverPublicKey(x){const{r:P,s:D,recovery:O}=this,j=B(Nl("msgHash",x));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const T=O===2||O===3?P+e.n:P;if(T>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const L=O&1?"03":"02",M=l.fromHex(L+h(T)),X=o(T),le=a(-j*X),H=a(D*X),ee=l.BASE.multiplyAndAddUnsafe(M,le,H);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new E(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ag(this.toDERHex())}toDERHex(){return Yu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ag(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(b){try{return c(b),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const b=gJ(e.n);return i9e(e.randomBytes(b),e.n)},precompute(b=8,x=l.BASE){return x._setWindowSize(b),x.multiply(BigInt(3)),x}};function _(b,x=!0){return l.fromPrivateKey(b).toRawBytes(x)}function A(b){const x=$0(b),P=typeof b=="string",D=(x||P)&&b.length;return x?D===i||D===s:P?D===2*i||D===2*s:b instanceof l}function C(b,x,P=!0){if(A(b))throw new Error("first arg must be private key");if(!A(x))throw new Error("second arg must be public key");return l.fromHex(x).multiply(c(b)).toRawBytes(P)}const R=e.bits2int||function(b){if(b.length>8192)throw new Error("input is too large");const x=i0(b),P=b.length*8-e.nBitLength;return P>0?x>>BigInt(P):x},B=e.bits2int_modN||function(b){return a(R(b))},S=Pk(e.nBitLength);function U(b){return s0("num < 2^"+e.nBitLength,b,ed,S),og(b,e.nByteLength)}function G(b,x,P=ae){if(["recovered","canonical"].some(te=>te in P))throw new Error("sign() legacy options not supported");const{hash:D,randomBytes:O}=e;let{lowS:j,prehash:T,extraEntropy:L}=P;j==null&&(j=!0),b=Nl("msgHash",b),CD(P),T&&(b=Nl("prehashed msgHash",D(b)));const M=B(b),X=c(x),le=[U(X),U(M)];if(L!=null&&L!==!1){const te=L===!0?O(r.BYTES):L;le.push(Nl("extraEntropy",te))}const H=X2(...le),ee=M;function Z(te){const re=R(te);if(!f(re))return;const W=o(re),q=l.BASE.multiply(re).toAffine(),J=a(q.x);if(J===ed)return;const me=a(W*a(ee+J*X));if(me===ed)return;let be=(q.x===J?0:2)|Number(q.y&Di),Ce=me;return j&&g(me)&&(Ce=m(me),be^=1),new E(J,Ce,be)}return{seed:H,k2sig:Z}}const ae={lowS:e.lowS,prehash:!1},K={lowS:e.lowS,prehash:!1};function N(b,x,P=ae){const{seed:D,k2sig:O}=G(b,x,P),j=e;return oJ(j.hash.outputLen,j.nByteLength,j.hmac)(D,O)}l.BASE._setWindowSize(8);function k(b,x,P,D=K){var be;const O=b;x=Nl("msgHash",x),P=Nl("publicKey",P);const{lowS:j,prehash:T,format:L}=D;if(CD(D),"strict"in D)throw new Error("options.strict was renamed to lowS");if(L!==void 0&&L!=="compact"&&L!=="der")throw new Error("format must be compact or der");const M=typeof O=="string"||$0(O),X=!M&&!L&&typeof O=="object"&&O!==null&&typeof O.r=="bigint"&&typeof O.s=="bigint";if(!M&&!X)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let le,H;try{if(X&&(le=new E(O.r,O.s)),M){try{L!=="compact"&&(le=E.fromDER(O))}catch(Ce){if(!(Ce instanceof Yu.Err))throw Ce}!le&&L!=="der"&&(le=E.fromCompact(O))}H=l.fromHex(P)}catch{return!1}if(!le||j&&le.hasHighS())return!1;T&&(x=e.hash(x));const{r:ee,s:Z}=le,te=B(x),re=o(Z),W=a(te*re),q=a(ee*re),J=(be=l.BASE.multiplyAndAddUnsafe(H,W,q))==null?void 0:be.toAffine();return J?a(J.x)===ee:!1}return{CURVE:e,getPublicKey:_,getSharedSecret:C,sign:N,verify:k,ProjectivePoint:l,Signature:E,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function g9e(t){return{hash:t,hmac:(e,...r)=>dJ(t,e,U7e(...r)),randomBytes:W7e}}function m9e(t,e){const r=n=>p9e({...t,...g9e(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wJ=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),SD=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),y9e=BigInt(1),BS=BigInt(2),ID=(t,e)=>(t+e/BS)/e;function v9e(t){const e=wJ,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),o=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=Lo(u,r,e)*u%e,h=Lo(f,r,e)*u%e,g=Lo(h,BS,e)*c%e,m=Lo(g,i,e)*g%e,w=Lo(m,s,e)*m%e,E=Lo(w,o,e)*w%e,v=Lo(E,l,e)*E%e,_=Lo(v,o,e)*w%e,A=Lo(_,r,e)*u%e,C=Lo(A,a,e)*m%e,R=Lo(C,n,e)*c%e,B=Lo(R,BS,e);if(!WS.eql(WS.sqr(B),t))throw new Error("Cannot find square root");return B}const WS=hJ(wJ,void 0,void 0,{sqrt:v9e}),Mk=m9e({a:BigInt(0),b:BigInt(7),Fp:WS,n:SD,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=SD,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-y9e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),o=ID(s*t,e),l=ID(-n*t,e);let c=xa(t-o*r-l*i,e),u=xa(-o*n-l*s,e);const f=c>a,h=u>a;if(f&&(c=e-c),h&&(u=e-u),c>a||u>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},Y7e);BigInt(0);Mk.ProjectivePoint;const w9e=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:Mk},Symbol.toStringTag,{value:"Module"}));function b9e({r:t,s:e,to:r="hex",v:n,yParity:i}){const s=(()=>{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")})(),a=`0x${new Mk.Signature(oo(t),oo(e)).toCompactHex()}${s===0?"1b":"1c"}`;return r==="hex"?a:Jl(a)}async function Ok(t,e){var f,h,g;const{address:r,factory:n,factoryData:i,hash:s,signature:a,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=Zl(a)?a:typeof a=="object"&&"r"in a&&"s"in a?b9e(a):vi(a),u=await(async()=>!n&&!i||Zxe(c)?c:Jxe({address:n,data:i,signature:c}))();try{const m=o?{to:o,data:ac({abi:hD,functionName:"isValidSig",args:[r,s,u]}),...l}:{data:A8({abi:hD,args:[r,s,u],bytecode:O_e}),...l},{data:w}=await nr(t,S8,"call")(m);return N6e(w??"0x0")}catch(m){try{if(vk(rk(r),await gZ({hash:s,signature:a})))return!0}catch{}if(m instanceof pZ)return!1;throw m}}async function _9e(t,{address:e,message:r,factory:n,factoryData:i,signature:s,...a}){const o=nJ(r);return Ok(t,{address:e,factory:n,factoryData:i,hash:o,signature:s,...a})}async function x9e(t,e){const{address:r,factory:n,factoryData:i,signature:s,message:a,primaryType:o,types:l,domain:c,...u}=e,f=Fxe({message:a,primaryType:o,types:l,domain:c});return Ok(t,{address:r,factory:n,factoryData:i,hash:f,signature:s,...u})}function bJ(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:a=t.pollingInterval}){const o=typeof s<"u"?s:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let l;return o?(()=>{const f=Zi(["watchBlockNumber",t.uid,e,r,a]);return Uf(f,{onBlockNumber:n,onError:i},h=>zv(async()=>{var g;try{const m=await nr(t,Hv,"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:a}))})():(()=>{const f=Zi(["watchBlockNumber",t.uid,e,r]);return Uf(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(_=>_.config.type==="webSocket");return v?v.value:t.transport}return t.transport})(),{unsubscribe:E}=await w.subscribe({params:["newHeads"],onData(v){var A;if(!g)return;const _=oo((A=v.result)==null?void 0:A.number);h.onBlockNumber(_,l),l=_},onError(v){var _;(_=h.onError)==null||_.call(h,v)}});m=E,g||m()}catch(w){i==null||i(w)}})(),()=>m()})})()}async function E9e(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:a=({count:l})=>~~(1<w(new H8e({hash:r})),o):void 0,v=Uf(l,{onReplaced:n,resolve:m,reject:w},_=>{const A=nr(t,bJ,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(C){const R=S=>{clearTimeout(E),A(),S(),v()};let B=C;if(!h)try{if(f){if(e>1&&(!f.blockNumber||B-f.blockNumber+1n_.resolve(f));return}if(c||(h=!0,await jS(async()=>{c=await nr(t,Tk,"getTransaction")({hash:r}),c.blockNumber&&(B=c.blockNumber)},{delay:a,retryCount:s}),h=!1),f=await nr(t,LS,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||B-f.blockNumber+1n_.resolve(f))}catch(S){if(S instanceof fZ||S instanceof hZ){if(!c){h=!1;return}try{u=c,h=!0;const U=await jS(()=>nr(t,Fc,"getBlock")({blockNumber:B,includeTransactions:!0}),{delay:a,retryCount:s,shouldRetry:({error:K})=>K instanceof wZ});h=!1;const G=U.transactions.find(({from:K,nonce:N})=>K===u.from&&N===u.nonce);if(!G||(f=await nr(t,LS,"getTransactionReceipt")({hash:G.hash}),e>1&&(!f.blockNumber||B-f.blockNumber+1n{var K;(K=_.onReplaced)==null||K.call(_,{reason:ae,replacedTransaction:u,transaction:G,transactionReceipt:f}),_.resolve(f)})}catch(U){R(()=>_.reject(U))}}else R(()=>_.reject(S))}}})});return g}function C9e(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:a,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=a??!1;let f;return c?(()=>{const m=Zi(["watchBlocks",t.uid,e,r,n,u,l]);return Uf(m,{onBlock:i,onError:s},w=>zv(async()=>{var E;try{const v=await nr(t,Fc,"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 _=(f==null?void 0:f.number)+1n;_f.number)&&(w.onBlock(v,f),f=v)}catch(v){(E=w.onError)==null||E.call(w,v)}},{emitOnBegin:n,interval:l}))})():(()=>{let m=!0,w=!0,E=()=>m=!1;return(async()=>{try{n&&nr(t,Fc,"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(C=>C.config.type==="webSocket");return A?A.value:t.transport}return t.transport})(),{unsubscribe:_}=await v.subscribe({params:["newHeads"],async onData(A){if(!m)return;const C=await nr(t,Fc,"getBlock")({blockNumber:A.blockNumber,includeTransactions:u}).catch(()=>{});m&&(i(C,f),w=!1,f=C)},onError(A){s==null||s(A)}});E=_,m||E()}catch(v){s==null||s(v)}})(),()=>E()})()}function A9e(t,{address:e,args:r,batch:n=!0,event:i,events:s,fromBlock:a,onError:o,onLogs:l,poll:c,pollingInterval:u=t.pollingInterval,strict:f}){const h=typeof c<"u"?c:typeof a=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),g=f??!1;return h?(()=>{const E=Zi(["watchEvent",e,r,n,t.uid,i,u,a]);return Uf(E,{onLogs:l,onError:o},v=>{let _;a!==void 0&&(_=a-1n);let A,C=!1;const R=zv(async()=>{var B;if(!C){try{A=await nr(t,KZ,"createEventFilter")({address:e,args:r,event:i,events:s,strict:g,fromBlock:a})}catch{}C=!0;return}try{let S;if(A)S=await nr(t,I8,"getFilterChanges")({filter:A});else{const U=await nr(t,Hv,"getBlockNumber")({});_&&_!==U?S=await nr(t,_k,"getLogs")({address:e,args:r,event:i,events:s,fromBlock:_+1n,toBlock:U}):S=[],_=U}if(S.length===0)return;if(n)v.onLogs(S);else for(const U of S)v.onLogs([U])}catch(S){A&&S instanceof S0&&(C=!1),(B=v.onError)==null||B.call(v,S)}},{emitOnBegin:!0,interval:u});return async()=>{A&&await nr(t,T8,"uninstallFilter")({filter:A}),R()}})})():(()=>{let E=!0,v=()=>E=!1;return(async()=>{try{const _=(()=>{if(t.transport.type==="fallback"){const B=t.transport.transports.find(S=>S.config.type==="webSocket");return B?B.value:t.transport}return t.transport})(),A=s??(i?[i]:void 0);let C=[];A&&(C=[A.flatMap(S=>Dv({abi:[S],eventName:S.name,args:r}))],i&&(C=C[0]));const{unsubscribe:R}=await _.subscribe({params:["logs",{address:e,topics:C}],onData(B){var U;if(!E)return;const S=B.result;try{const{eventName:G,args:ae}=wk({abi:A??[],data:S.data,topics:S.topics,strict:g}),K=wd(S,{args:ae,eventName:G});l([K])}catch(G){let ae,K;if(G instanceof j2||G instanceof f8){if(f)return;ae=G.abiItem.name,K=(U=G.abiItem.inputs)==null?void 0:U.some(k=>!("name"in k&&k.name))}const N=wd(S,{args:K?[]:{},eventName:ae});l([N])}},onError(B){o==null||o(B)}});v=R,E||v()}catch(_){o==null||o(_)}})(),()=>v()})()}function S9e(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const c=Zi(["watchPendingTransactions",t.uid,e,s]);return Uf(c,{onTransactions:n,onError:r},u=>{let f;const h=zv(async()=>{var g;try{if(!f)try{f=await nr(t,YZ,"createPendingTransactionFilter")({});return}catch(w){throw h(),w}const m=await nr(t,I8,"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:s});return async()=>{f&&await nr(t,T8,"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 I9e(t){var f,h,g;const{scheme:e,statement:r,...n}=((f=t.match(T9e))==null?void 0:f.groups)??{},{chainId:i,expirationTime:s,issuedAt:a,notBefore:o,requestId:l,...c}=((h=t.match($9e))==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)}:{},...s?{expirationTime:new Date(s)}:{},...a?{issuedAt:new Date(a)}:{},...o?{notBefore:new Date(o)}:{},...l?{requestId:l}:{},...u?{resources:u}:{},...e?{scheme:e}:{},...r?{statement:r}:{}}}const T9e=/^(?:(?[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)?/,$9e=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;function k9e(t){const{address:e,domain:r,message:n,nonce:i,scheme:s,time:a=new Date}=t;if(r&&n.domain!==r||i&&n.nonce!==i||s&&n.scheme!==s||n.expirationTime&&a>=n.expirationTime||n.notBefore&&aS8(t,e),createAccessList:e=>Txe(t,e),createBlockFilter:()=>$xe(t),createContractEventFilter:e=>oZ(t,e),createEventFilter:e=>KZ(t,e),createPendingTransactionFilter:()=>YZ(t),estimateContractGas:e=>T_e(t,e),estimateGas:e=>yk(t,e),getBalance:e=>NZ(t,e),getBlobBaseFee:()=>kxe(t),getBlock:e=>Fc(t,e),getBlockNumber:e=>Hv(t,e),getBlockTransactionCount:e=>Nxe(t,e),getBytecode:e=>yD(t,e),getChainId:()=>Wv(t),getCode:e=>yD(t,e),getContractEvents:e=>PZ(t,e),getEip712Domain:e=>exe(t,e),getEnsAddress:e=>fxe(t,e),getEnsAvatar:e=>Axe(t,e),getEnsName:e=>Sxe(t,e),getEnsResolver:e=>Ixe(t,e),getEnsText:e=>GZ(t,e),getFeeHistory:e=>Rxe(t,e),estimateFeesPerGas:e=>p_e(t,e),getFilterChanges:e=>I8(t,e),getFilterLogs:e=>Mxe(t,e),getGasPrice:()=>hk(t),getLogs:e=>_k(t,e),getProof:e=>h7e(t,e),estimateMaxPriorityFeePerGas:e=>h_e(t,e),getStorageAt:e=>p7e(t,e),getTransaction:e=>Tk(t,e),getTransactionConfirmations:e=>g7e(t,e),getTransactionCount:e=>xZ(t,e),getTransactionReceipt:e=>LS(t,e),multicall:e=>m7e(t,e),prepareTransactionRequest:e=>E8(t,e),readContract:e=>bd(t,e),sendRawTransaction:e=>xk(t,e),simulate:e=>O7e(t,e),simulateContract:e=>z_e(t,e),verifyMessage:e=>_9e(t,e),verifySiweMessage:e=>N9e(t,e),verifyTypedData:e=>x9e(t,e),uninstallFilter:e=>T8(t,e),waitForTransactionReceipt:e=>E9e(t,e),watchBlocks:e=>C9e(t,e),watchBlockNumber:e=>bJ(t,e),watchContractEvent:e=>Z_e(t,e),watchEvent:e=>A9e(t,e),watchPendingTransactions:e=>S9e(t,e)}}function Xl(t){const{key:e="public",name:r="Public Client"}=t;return BZ({...t,key:e,name:r,type:"publicClient"}).extend(jk)}function P9e(t,e){const{abi:r,args:n,bytecode:i,...s}=e,a=A8({abi:r,args:n,bytecode:i});return Ek(t,{...s,data:a})}async function R9e(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=>jv(n))}async function M9e(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function O9e(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>rk(r))}async function j9e(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function L9e(t,{account:e=t.account,message:r}){if(!e)throw new qv({docsPath:"/docs/actions/wallet/signMessage"});const n=sa(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?rg(r):r.raw instanceof Uint8Array?ur(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function D9e(t,e){var c,u,f,h;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new qv({docsPath:"/docs/actions/wallet/signTransaction"});const s=sa(r);G0({account:s,...e});const a=await nr(t,Wv,"getChainId")({});n!==null&&FZ({currentChainId:a,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)||Vg;return s.signTransaction?s.signTransaction({...i,chainId:a},{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(a),from:s.address}]},{retryCount:0})}async function F9e(t,e){const{account:r=t.account,domain:n,message:i,primaryType:s}=e;if(!r)throw new qv({docsPath:"/docs/actions/wallet/signTypedData"});const a=sa(r),o={EIP712Domain:tJ({domain:n}),...e.types};if(eJ({domain:n,message:i,primaryType:s,types:o}),a.signTypedData)return a.signTypedData({domain:n,message:i,primaryType:s,types:o});const l=zxe({domain:n,message:i,primaryType:s,types:o});return t.request({method:"eth_signTypedData_v4",params:[a.address,l]},{retryCount:0})}async function U9e(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:lr(e)}]},{retryCount:0})}async function B9e(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function W9e(t){return{addChain:e=>rxe(t,e),deployContract:e=>P9e(t,e),getAddresses:()=>R9e(t),getChainId:()=>Wv(t),getPermissions:()=>M9e(t),prepareTransactionRequest:e=>E8(t,e),requestAddresses:()=>O9e(t),requestPermissions:e=>j9e(t,e),sendRawTransaction:e=>xk(t,e),sendTransaction:e=>Ek(t,e),signMessage:e=>L9e(t,e),signTransaction:e=>D9e(t,e),signTypedData:e=>F9e(t,e),switchChain:e=>U9e(t,e),watchAsset:e=>B9e(t,e),writeContract:e=>Q_e(t,e)}}function _J(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;return BZ({...t,key:e,name:r,transport:n,type:"walletClient"}).extend(W9e)}function TD(t){return t?`${t.slice(0,5)}…${t.slice(-4)}`:""}function z9e({wei:t,precision:e=3}){return parseFloat(Fv(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"")}function $D({amount:t,decimals:e}){return y8(BigInt(t),e)}const H9e=/"(?:_|\\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*:/,q9e=/"(?: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*:/,V9e=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function G9e(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){K9e(t);return}return e}function K9e(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function xy(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(!V9e.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(H9e.test(t)||q9e.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,G9e)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const Y9e=/#/g,Z9e=/&/g,J9e=/\//g,Q9e=/=/g,Lk=/\+/g,X9e=/%5e/gi,eEe=/%60/gi,tEe=/%7c/gi,rEe=/%20/gi;function nEe(t){return encodeURI(""+t).replace(tEe,"|")}function zS(t){return nEe(typeof t=="string"?t:JSON.stringify(t)).replace(Lk,"%2B").replace(rEe,"+").replace(Y9e,"%23").replace(Z9e,"%26").replace(eEe,"`").replace(X9e,"^").replace(J9e,"%2F")}function cE(t){return zS(t).replace(Q9e,"%3D")}function xJ(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function iEe(t){return xJ(t.replace(Lk," "))}function sEe(t){return xJ(t.replace(Lk," "))}function aEe(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=iEe(n[1]);if(i==="__proto__"||i==="constructor")continue;const s=sEe(n[2]||"");e[i]===void 0?e[i]=s:Array.isArray(e[i])?e[i].push(s):e[i]=[e[i],s]}return e}function oEe(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(r=>`${cE(t)}=${zS(r)}`).join("&"):`${cE(t)}=${zS(e)}`:cE(t)}function lEe(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>oEe(e,t[e])).filter(Boolean).join("&")}const cEe=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,uEe=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,dEe=/^([/\\]\s*){2,}[^/\\]/,fEe=/^\.?\//;function EJ(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?cEe.test(t):uEe.test(t)||(e.acceptRelative?dEe.test(t):!1)}function hEe(t="",e){return t.endsWith("/")}function pEe(t="",e){return(hEe(t)?t.slice(0,-1):t)||"/"}function gEe(t="",e){return t.endsWith("/")?t:t+"/"}function mEe(t,e){if(vEe(e)||EJ(t))return t;const r=pEe(e);return t.startsWith(r)?t:bEe(r,t)}function yEe(t,e){const r=_Ee(t),n={...aEe(r.search),...e};return r.search=lEe(n),xEe(r)}function vEe(t){return!t||t==="/"}function wEe(t){return t&&t!=="/"}function bEe(t,...e){let r=t||"";for(const n of e.filter(i=>wEe(i)))if(r){const i=n.replace(fEe,"");r=gEe(r)+i}else r=n;return r}const CJ=Symbol.for("ufo:protocolRelative");function _Ee(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(!EJ(t,{acceptRelative:!0}))return kD(t);const[,n="",i,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,a="",o=""]=s.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(o=o.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:c,hash:u}=kD(o);return{protocol:n.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:a,pathname:l,search:c,hash:u,[CJ]:!n}}function kD(t=""){const[e="",r="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:n}}function xEe(t){const e=t.pathname||"",r=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",n=t.hash||"",i=t.auth?t.auth+"@":"",s=t.host||"";return(t.protocol||t[CJ]?(t.protocol||"")+"//":"")+i+s+e+r+n}class AJ extends Error{constructor(e,r){super(e,r),this.name="FetchError",r!=null&&r.cause&&!this.cause&&(this.cause=r.cause)}}function EEe(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)}`,s=t.response?`${t.response.status} ${t.response.statusText}`:"",a=`${i}: ${s}${e?` ${e}`:""}`,o=new AJ(a,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 CEe=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function ND(t="GET"){return CEe.has(t.toUpperCase())}function AEe(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 SEe=new Set(["image/svg","application/xml","application/xhtml","application/html"]),IEe=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function TEe(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return IEe.test(e)?"json":SEe.has(e)||e.startsWith("text/")?"text":"blob"}function $Ee(t,e,r,n){const i=kEe((e==null?void 0:e.headers)??(t==null?void 0:t.headers),r==null?void 0:r.headers,n);let s;return(r!=null&&r.query||r!=null&&r.params||e!=null&&e.params||e!=null&&e.query)&&(s={...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:s,params:s,headers:i}}function kEe(t,e,r){if(!e)return new r(t);const n=new r(e);if(t)for(const[i,s]of Symbol.iterator in t||Array.isArray(t)?t:new r(t))n.set(i,s);return n}async function vb(t,e){if(e)if(Array.isArray(e))for(const r of e)await r(t);else await e(t)}const NEe=new Set([408,409,425,429,500,502,503,504]),PEe=new Set([101,204,205,304]);function SJ(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=ND(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):NEe.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)),s(o.request,{...o.options,retry:u-1})}}const c=EEe(o);throw Error.captureStackTrace&&Error.captureStackTrace(c,s),c}const s=async function(l,c={}){const u={request:l,options:$Ee(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 vb(u,u.options.onRequest),typeof u.request=="string"&&(u.options.baseURL&&(u.request=mEe(u.request,u.options.baseURL)),u.options.query&&(u.request=yEe(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&&ND(u.options.method)&&(AEe(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 vb(u,u.options.onRequestError),await i(u)}finally{f&&clearTimeout(f)}if((u.response.body||u.response._bodyInit)&&!PEe.has(u.response.status)&&u.options.method!=="HEAD"){const g=(u.options.parseResponse?"json":u.options.responseType)||TEe(u.response.headers.get("content-type")||"");switch(g){case"json":{const m=await u.response.text(),w=u.options.parseResponse||xy;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 vb(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await vb(u,u.options.onResponseError),await i(u)):u.response},a=async function(l,c){return(await s(l,c))._data};return a.raw=s,a.native=(...o)=>e(...o),a.create=(o={},l={})=>SJ({...t,...l,defaults:{...t.defaults,...l.defaults,...o}}),a}const P4=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")}(),REe=P4.fetch?(...t)=>P4.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),MEe=P4.Headers,OEe=P4.AbortController,IJ=SJ({fetch:REe,Headers:MEe,AbortController:OEe});var or;let La=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}},Ho=class extends La{constructor(e,r,n,i,s,a){super(n,i,s),this.type=e,this.status=r,this.data=a}},Ee=class extends La{constructor(e,r,n){super(e,r,n),this.type="client_error"}},jEe=class extends Ee{constructor(){super("Request timed out",void 0,"client_request_timeout")}},Pn=class extends La{constructor(e,r,n){super(e,r,n),this.type="connector_error"}};const Hr=t=>{if(t instanceof La)return t;if(!(t instanceof AJ))return bn(t);if(!t.response)return new Ho("api_error",null,t.message,t);let{type:e,message:r,error:n,code:i}=t.data;return new Ho(e||"ApiError",t.response.status,r||n,t,i,t.data)},bn=t=>t instanceof La?t:t instanceof Error?new Ee(t.message,t):new Ee(`Internal error: ${t}`);var Se=((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 Lp=class extends Ee{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Pf=class extends Ee{constructor(e="Embedded wallet error",r){super(e,r,"unknown_embedded_wallet_error")}},LEe=class extends Ee{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},Yv=class extends Ee{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 TJ="/api/v1/sessions",$J="/api/v1/sessions/logout",DEe="/api/v1/sessions/fork",kJ="/api/v1/sessions/fork/recover",FEe="/api/v1/siwe/init",UEe="/api/v1/siwe/authenticate",BEe="/api/v1/siwe/link",WEe="/api/v1/siwe/link_smart_wallet",zEe="/api/v1/siwe/unlink",HEe="/api/v1/siwe/transfer",qEe="/api/v1/siws/init",VEe="/api/v1/siws/authenticate",GEe="/api/v1/siws/link",KEe="/api/v1/siws/unlink",YEe="/api/v1/farcaster/init",ZEe="/api/v1/farcaster/authenticate",JEe="/api/v1/farcaster/link",QEe="/api/v1/farcaster/status",XEe="/api/v1/farcaster/unlink",eCe="/api/v1/farcaster/transfer",tCe="/api/v1/passwordless/init",rCe="/api/v1/passwordless/authenticate",nCe="/api/v1/passwordless/link",iCe="/api/v1/passwordless/unlink",sCe="/api/v1/passwordless/update",aCe="/api/v1/passwordless/transfer",oCe="/api/v1/passwordless_sms/init",lCe="/api/v1/passwordless_sms/link",cCe="/api/v1/passwordless_sms/unlink",uCe="/api/v1/passwordless_sms/authenticate",dCe="/api/v1/passwordless_sms/update",fCe="/api/v1/passwordless_sms/transfer",NJ="/api/v1/oauth/init",PJ="/api/v1/oauth/authenticate",RJ="/api/v1/oauth/link",hCe="/api/v1/oauth/unlink",pCe="/api/v1/oauth/transfer",gCe="/api/v1/recovery/oauth/init",mCe="/api/v1/recovery/oauth/init_icloud",yCe="/api/v1/recovery/oauth/authenticate",vCe="/api/v1/passkeys/link/init",wCe="/api/v1/passkeys/authenticate/init",bCe="/api/v1/passkeys/link",_Ce="/api/v1/passkeys/authenticate",xCe="/api/v1/passkeys/unlink",ECe="/api/v1/telegram/authenticate",CCe="/api/v1/telegram/link",ACe="/api/v1/telegram/unlink",SCe="/api/v1/telegram/transfer",ICe="/api/v1/mfa/passwordless_sms/init",TCe="/api/v1/mfa/passkeys/init",$Ce="/api/v1/users/me/accept_terms",MJ="/api/v1/analytics_events",kCe="/api/v1/custom_jwt_account/authenticate",NCe="/api/v1/guest/authenticate",PCe="/api/v1/plugins/moonpay_on_ramp/sign",RCe="/api/v1/funding/coinbase_on_ramp/init",MCe="/api/v1/funding/coinbase_on_ramp/status",OCe="/api/v1/wallets/revoke";let OJ=class{async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(kCe,{token:this.meta.token})}catch(e){throw Hr(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}};function O8(t){return t?{"privy-ui":"t"}:void 0}let _1=class{async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new Ee("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(rCe,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Hr(e)}}async link(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new Ee("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(nCe,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw Hr(e)}}async sendCodeEmail({email:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new Ee("Auth flow has no API instance");if(e&&(this.meta.email=e),r&&(this.meta.captchaToken=r),!this.meta.email)throw new Ee("Email must be set when initialzing authentication.");let i=O8(n);try{return await this.api.post(tCe,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw Hr(s)}}constructor({email:e,captchaToken:r,disableSignup:n}){this.meta={email:e,captchaToken:r,disableSignup:n??!1}}},jCe=class extends _1{async link(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new Ee("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(sCe,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw Hr(e)}}constructor(e,r,n){super({email:r,captchaToken:n}),this.meta={email:r,captchaToken:n,oldAddress:e,disableSignup:!1}}},LCe=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={}}},jJ=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 HS(){try{let t="privy:__session_storage__test",e=new jJ;return e.put(t,"blobby"),e.del(t),!0}catch{return!1}}var Lt=typeof window<"u"&&window.localStorage?new jJ:new LCe;function DCe(){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 LJ=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,DJ=(t,e)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!e)return!0;if(t.isBraveWallet&&!t._events&&!t._state||LJ(t)!=="MetaMask")return!1;if(t.providers){for(let r of t.providers)if(!DJ(r))return!1}return!0},j8=()=>{var t,e,r,n,i,s;if("phantom"in window){let a=window;if((e=(t=a==null?void 0:a.phantom)==null?void 0:t.ethereum)!=null&&e.isPhantom&&((n=(r=a==null?void 0:a.phantom)==null?void 0:r.ethereum)!=null&&n.chainId)||(s=(i=a==null?void 0:a.phantom)==null?void 0:i.solana)!=null&&s.isPhantom)return!0}return!1},FJ=()=>{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},FCe=(t,e)=>{let r=[],n=[];for(let[i,s]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,}))$/),UCe=(t,e)=>{let r=t.slice(0),n=[];for(;r.length;)n.push(r.splice(0,e));return n},Ys=(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)}`},uE=(t,e=3,r=4)=>Ys(t,e,r,"solana"),BJ=t=>new Promise(e=>setTimeout(e,t));function BCe(t,{interval:e=100,timeout:r=5e3}={}){return new Promise((n,i)=>{let s,a=0,o=()=>{a>=r?i("Max attempts reached without result"):(s=t(),a+=e,s==null?setTimeout(o,e):n(s))};o()})}const qS=(t,e={})=>{let r=e.delayMs||150,n=e.maxAttempts||270;return new Promise(async(i,s)=>{var l;let a=!1,o=0;for(;!a&&o{a=!0,i(c)},(...c)=>{a=!0,s(...c)}),o+=1,await BJ(r)}a||s(Error("Exceeded max attempts before resolving function"))})},WJ=(t,e,r={},n={})=>{let i=new URL(e,t);for(let[a,o]of Object.entries(r))o!==void 0&&i.searchParams.set(a,o);let s=Object.entries(n);if(s.length>0){let a=new URLSearchParams;for(let[o,l]of s)a.append(o,l);i.hash=a.toString()}return i.href},WCe=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),R4=t=>typeof t=="string"?t:"0x"+t.toString(16);async function zCe({store:t,walletList:e,externalWalletConfig:r,walletChainType:n,timeout:i=3e3}){let s=!1,a=window;return new Promise(o=>{function l(){if(s)return;s=!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 DCe()){let h=LJ(f);if(!c.some(g=>g.info.name===h)){if(DJ(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)}a.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},i))})}function w5(t){return`eip155:${String(Number(t))}`}const HCe=(t,e,r,n)=>{let i=Number(t),s=e.find(a=>a.id===i);if(!s)throw new Pn(`Unsupported chainId ${t}`,4901);return Bf(s,r,n)},Bf=(t,e,r)=>{var a,o,l;let n,i=t.id,s=Number(t.id);if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])n=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[s])n=e.rpcUrls[s];else if((a=t.rpcUrls.privy)!=null&&a.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},qCe=(t,e)=>{var i;let r=Number(t),n=e.find(s=>s.id===r);if(!n)throw new Pn(`Unsupported chainId ${t}`,4901);return(i=n.blockExplorers)==null?void 0:i.default.url},lg=(t,e,r,n)=>{var a,o,l;let i=Number(t),s=e.find(c=>c.id===i);if(!s)throw new Pn(`Unsupported chainId ${t}`,4901);return new g2e(s.rpcUrls.privyWalletOverride&&s.rpcUrls.privyWalletOverride.http[0]?s.rpcUrls.privyWalletOverride.http[0]:r.rpcUrls&&r.rpcUrls[i]?r.rpcUrls[i]:(a=s.rpcUrls.privy)!=null&&a.http[0]?{url:s.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}:(o=s.rpcUrls.public)!=null&&o.http[0]?s.rpcUrls.public.http[0]:(l=s.rpcUrls.default)==null?void 0:l.http[0])},VS=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 VCe(t,{min:e,max:r}){return Math.min(Math.max(t,e),r)}const dE=t=>{let e;try{e=new URL(t).hostname}catch{return}for(let[r,n]of Object.entries(GS))if(e.includes(n.hostname))return{walletClientType:r,entry:n}},GS={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 zJ(t){return{name:t.displayName||"",universalLink:t.mobile.universal,deepLink:t.mobile.native}}function GCe(t,e){let r=zJ(e);if(r.deepLink)return VJ(r.deepLink,t);if(r.universalLink)return Dk(r.universalLink,t);throw new Ee(`Unsupported wallet ${e.id}`)}function KCe(t,e){let r=zJ(e);if(r.universalLink)return Dk(r.universalLink,t)}let HJ="WALLETCONNECT_DEEPLINK_CHOICE";function YCe(){try{localStorage.removeItem(HJ)}catch{}}function ZCe({href:t,name:e}){try{localStorage.setItem(HJ,JSON.stringify({href:t,name:e}))}catch{}}function qJ(t){return t.startsWith("http://")||t.startsWith("https://")}function VJ(t,e){if(qJ(t))return Dk(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 Dk(t,e){if(!qJ(t))return VJ(t,e);let r=t;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function GJ(t,e){window.open(t,e,"noreferrer noopener")}let Ks=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}},PD=class{get meta(){return this._meta}async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.channelToken)throw new Ee("Auth flow must be initialized first");try{let e=await this.api.post(ZEe,{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 Ee("No response from authentication");return e}catch(e){throw Hr(e)}}async link(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(JEe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw Hr(e)}}async _startChannelOnce(){if(!this.api)throw new Ee("Auth flow has no API instance");let e=await this.api.post(YEe,{token:this.captchaToken});cs&&!V$&&e.connect_uri&&GJ(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new Ee("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.channelToken)throw new Ee("Auth flow must be initialized first");let e=await this.api.get(QEe,{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 Ks(this._startChannelOnce.bind(this)),this.pollForReady=new Ks(this._pollForReady.bind(this)),this._meta.disableSignup=r}};const JCe="34357d3c125c2bcf2ce2bc3309d98715",KS="https://auth.privy.io",QCe=2e4,Mn=1400,Fk=2500,L8=4e3,XCe="1.98.4",Ey="privy:token",RD="privy-token",fE="privy:refresh_token",eAe="privy-refresh-token",b5="privy:pat",MD="privy:id_token",OD="privy-id-token",hE="privy-session",YS="privy:session_transfer_token",ZS="privy:caid",KJ=t=>`privy:guest:${t}`,wb=t=>`privy:cross-app:${t}`,M4="privy:state_code",Cy="privy:code_verifier",O4="privy:headless_oauth",j4="privy:oauth_disable_signup",pE=t=>`privy:wallet:${t}`,jD="privy:connectors",YJ="privy:connections",D8=12e4,tv=1,LD="0x1",Uk=3e4,tAe="https://api.moonpay.com/v1",rAe="https://api.moonpay.com/v1",nAe="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",iAe="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",sAe="deprecated";async function aAe(t){let e=new TextEncoder().encode(t);return new Uint8Array(await crypto.subtle.digest("SHA-256",e))}function JS(t){return crypto.getRandomValues(new Uint8Array(t))}let ZJ=class{getOrCreateGuestCredential(e){let r=KJ(e);if(HS()){if(Lt.get(r))return Lt.get(r);{let n=T4(JS(32));return Lt.put(r,n),n}}return T4(JS(32))}async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(NCe,{guest_credential:this.meta.guestCredential})}catch(e){throw Hr(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}},bb=class{async initAuthenticationFlow(e){if(!this.api)throw new Ee("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new Ee("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){var r,n;let e=await Ma(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new Ee("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new Ee("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(_Ce,{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 Ee("Passkey request timed out or rejected by user.",void 0,Se.PASSKEY_NOT_ALLOWED):Hr(i)}}async link(){var r,n;let e=await Ma(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new Ee("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new Ee("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let i=this.meta.initLinkResponse.options,s=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(i));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(bCe,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(s)})}catch(i){throw i.name==="NotAllowedError"?new Ee("Passkey request timed out or rejected by user.",void 0,Se.PASSKEY_NOT_ALLOWED):Hr(i)}}async _initAuthenticateOnce(e){if(!this.api)throw new Ee("Auth flow has no API instance");let r=O8(e);return await this.api.post(wCe,{token:this.meta.captchaToken},{headers:{...r}})}async _initLinkOnce(){if(!this.api)throw new Ee("Auth flow has no API instance");return await this.api.post(vCe,{})}_transformInitLinkOptionsToCamelCase(e){var r,n,i,s,a,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:(s=e.authenticator_selection)==null?void 0:s.resident_key,userVerification:(a=e.authenticator_selection)==null?void 0:a.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,s;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:((r=e.allow_credentials)==null?void 0:r.map(a=>({id:a.id,type:a.type,transports:a.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:(s=e.extensions)==null?void 0:s.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 Ks(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Ks(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:r}}};const QS=({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. @@ -111,7 +138,7 @@ Chain ID: ${e} Nonce: ${r} Issued At: ${new Date().toISOString()} Resources: -- https://privy.io`;let P6=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 Ee("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 Hr(e)}}async link(){if(!this.client)throw new Ee("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 Hr(e)}}async sign(){if(!this.client)throw new Ee("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new Ee("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 Ee("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Ee("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=qS({address:e,chainId:r,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new Ks(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}};const lCe=({address:t,nonce:e})=>`${window.location.host} wants you to sign in with your Solana account: +- https://privy.io`;let L4=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 Ee("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 Hr(e)}}async link(){if(!this.client)throw new Ee("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 Hr(e)}}async sign(){if(!this.client)throw new Ee("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new Ee("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 Ee("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Ee("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=QS({address:e,chainId:r,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new Ks(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}};const oAe=({address:t,nonce:e})=>`${window.location.host} wants you to sign in with your Solana account: ${t} ${`You are proving you own ${t}.`} @@ -122,13 +149,13 @@ Chain ID: mainnet Nonce: ${e} Issued At: ${new Date().toISOString()} Resources: -- https://privy.io`;let VS=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new Ee("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 Hr(e)}}async link(){if(!this.client)throw new Ee("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 Hr(e)}}async sign(){if(!this.client)throw new Ee("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new Ee("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new Ee("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 Ee("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Ee("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=lCe({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new Ks(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}},b1=class{async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new Ee("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(dEe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Hr(e)}}async link(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new Ee("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(cEe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Hr(e)}}async sendSmsCode({phoneNumber:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new Ee("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new Ee("phone nNumber must be set when initialzing authentication.");let i=$8(n);try{return await this.api.post(lEe,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw Hr(s)}}constructor({phoneNumber:e,captchaToken:r,disableSignup:n}){this.meta={phoneNumber:e,captchaToken:r,disableSignup:n??!1}}},cCe=class extends b1{async link(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new Ee("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(fEe,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Hr(e)}}constructor(e,r,n){super({phoneNumber:r,captchaToken:n}),this.meta={phoneNumber:r,captchaToken:n,oldPhoneNumber:e,disableSignup:!1}}};const je=()=>{throw Error("You need to wrap your application with the initialized with your app id.")},vb=t=>()=>{throw Error(t.trim())},SJ=T.createContext({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:je,setError:je,setExecuting:je,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:je,reset:je,execute:je});let R8=class extends Lo{constructor(e,r,n){super(e||"Captcha failed"),this.type="Captcha",r instanceof Error&&(this.cause=r),this.privyErrorCode=n}};const uCe=({children:t,id:e,captchaSiteKey:r,captchaEnabled:n})=>{let i=T.useRef(null),[s,o]=T.useState(),[a,l]=T.useState(),[c,u]=T.useState(!1),f=T.useMemo(()=>n?c||s||a?!c||s||a?s&&!a?{status:"success",token:s}:a?{status:"error",error:a}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"},[n,s,a,c]);return d.jsx(SJ.Provider,{value:{...f,ref:i,enabled:n,siteKey:r,appId:e,setToken:o,setError:l,setExecuting:u,remove(){var h;n&&((h=i.current)==null||h.remove(),u(!1),l(void 0),o(void 0))},reset(){var h;n&&((h=i.current)==null||h.reset(),u(!1),l(void 0),o(void 0))},execute(){var h;n&&(u(!0),(h=i.current)==null||h.execute())},async waitForResult(){if(!n)return"";try{return await WEe(()=>{var h;return(h=i.current)==null?void 0:h.getResponse()},{interval:200,timeout:2e4})}catch{throw new R8("Captcha failed",null,Se.CAPTCHA_TIMEOUT)}}},children:t})},Ca=()=>T.useContext(SJ);let wb=class{async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(CEe,{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 Hr(e)}}async link(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(AEe,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw Hr(e)}}constructor(e,r=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=r}};function wL(t){let e={detail:"",retryable:!1};return(t==null?void 0:t.privyErrorCode)===Se.LINKED_TO_ANOTHER_USER&&(e.detail="This account has already been linked to another user."),(t==null?void 0:t.privyErrorCode)===Se.DISALLOWED_LOGIN_METHOD&&(e.detail="Login with Telegram not allowed."),(t==null?void 0:t.privyErrorCode)===Se.INVALID_DATA&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Se.CANNOT_LINK_MORE_OF_TYPE&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Se.INVALID_CREDENTIALS&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Se.TOO_MANY_REQUESTS&&(e.detail="Too many requests. Please wait before trying again."),(t==null?void 0:t.privyErrorCode)===Se.TOO_MANY_REQUESTS&&t.message.includes("rate limit")&&(e.detail="Request limit reached for Telegram. Please wait a moment and try again."),t instanceof R8&&(e.retryable=!0,e.detail="Something went wrong. Try again."),e}function dCe(){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")||""),s=e.get("first_name");if(r&&s&&i&&n)return Object.fromEntries(e.entries())}())?(bL(),{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")||""),s=r.get("hash");return n&&i&&s?Object.fromEntries(r.entries()):void 0}())?(bL(),{flowType:"web-app",authData:t}):void 0}function bL(){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 Jp=class IJ{static parse(e){try{return new IJ(e)}catch{return null}}static throwIfNotWellFormedJwt(e){return xD(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=xD(e)}},fCe=class TJ extends Jp{static parse(e){try{return new TJ(e)}catch{return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}};function Kt(t){return t?new Date(1e3*t):null}function Ws(t,e){return t.slice().sort((r,n)=>(n.firstVerifiedAt??n.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===e)}const xo=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"&&e.walletIndex===0))||null,v5=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"),hCe=t=>v5(t).reduce((e,r)=>!e||e.walletIndex((t==null?void 0:t.linkedAccounts)??[]).filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType===e),w5=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"),Oc=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"&&e.walletIndex===0))||null,pCe=t=>w5(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,qy=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.imported&&e.walletClientType==="privy"&&e.chainType==="solana"))||null,M6=(t,e)=>(t==null?void 0:t.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.address===e))||null,ia=t=>xo(t)??Oc(t),Wn=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")},gCe=t=>{let e=ia(t);if(!e)throw Error("Failed to find primary wallet");return Wn(e)},bb=(t,e)=>{let r=$J(t,"ethereum").find(n=>Ir(n.address)===Ir(e));return{signingWallet:r,rootWallet:r?r.imported?r:xo(t):void 0}},b5=(t,e)=>{let r=$J(t,"solana").find(n=>n.address===e);return r?r.imported||r.walletIndex===0?{signingWallet:r,rootWallet:r}:{signingWallet:r,rootWallet:Oc(t)}:{}},wd=(t,e)=>{var r;return!(xo(t)||Oc(t)||e!=="all-users"&&(e!=="users-without-wallets"||(r=(n=>n.linkedAccounts.filter(i=>i.type==="wallet"))(t))!=null&&r.length))};function _s(t){if(!t)return null;let e=function(_){let A=[];for(let C of _){let R=C.type;switch(C.type){case"wallet":let B={address:C.address,type:C.type,imported:C.imported,delegated:C.delegated,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at),chainType:C.chain_type,chainId:C.chain_id,walletClient:C.wallet_client_type==="privy"?"privy":"unknown",walletClientType:C.wallet_client_type,connectorType:C.connector_type,recoveryMethod:C.recovery_method,walletIndex:C.wallet_index};A.push(B);break;case"smart_wallet":let S={address:C.address,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at),smartWalletType:C.smart_wallet_type};A.push(S);break;case"cross_app":let U={type:C.type,subject:C.subject,embeddedWallets:C.embedded_wallets,smartWallets:C.smart_wallets,providerApp:{id:C.provider_app_id},verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(U);break;case"email":let G={address:C.address,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(G);break;case"phone":let oe={number:C.phoneNumber,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(oe);break;case"google_oauth":let K={subject:C.subject,email:C.email,name:C.name,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(K);break;case"spotify_oauth":let N={subject:C.subject,email:C.email,name:C.name,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(N);break;case"instagram_oauth":let k={subject:C.subject,username:C.username,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(k);break;case"twitter_oauth":let b={subject:C.subject,username:C.username,name:C.name,type:C.type,profilePictureUrl:C.profile_picture_url,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(b);break;case"discord_oauth":let x={subject:C.subject,username:C.username,email:C.email,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(x);break;case"github_oauth":let P={subject:C.subject,username:C.username,name:C.name,email:C.email,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(P);break;case"tiktok_oauth":let L={subject:C.subject,username:C.username,name:C.name,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(L);break;case"linkedin_oauth":let O={subject:C.subject,name:C.name,email:C.email,vanityName:C.vanity_name,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(O);break;case"apple_oauth":let j={subject:C.subject,email:C.email,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(j);break;case"custom_auth":A.push({type:C.type,customUserId:C.custom_user_id,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)});break;case"farcaster":let I={type:C.type,fid:C.fid,ownerAddress:C.owner_address,displayName:C.display_name,username:C.username,bio:C.bio,pfp:C.profile_picture_url,url:C.homepage_url,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at),signerPublicKey:C.signer_public_key};A.push(I);break;case"passkey":let D={type:C.type,enrolledInMfa:C.enrolled_in_mfa,credentialId:C.credential_id,authenticatorName:C.authenticator_name,createdWithDevice:C.created_with_device,createdWithOs:C.created_with_os,createdWithBrowser:C.created_with_browser,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(D);break;case"telegram":let M={type:C.type,telegramUserId:C.telegram_user_id,firstName:C.first_name,lastName:C.last_name,username:C.username,photoUrl:C.photo_url,verifiedAt:Kt(C.first_verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(M);break;default:console.warn(`Unrecognized account type: ${R}. Please consider upgrading the Privy SDK.`)}}return A}(t.linked_accounts),r=Ws(e,"wallet"),n=Ws(e,"smart_wallet"),i=Ws(e,"email"),s=Ws(e,"phone"),o=Ws(e,"google_oauth"),a=Ws(e,"twitter_oauth"),l=Ws(e,"discord_oauth"),c=Ws(e,"github_oauth"),u=Ws(e,"spotify_oauth"),f=Ws(e,"instagram_oauth"),h=Ws(e,"tiktok_oauth"),g=Ws(e,"linkedin_oauth"),m=Ws(e,"apple_oauth"),w=Ws(e,"farcaster"),E=Ws(e,"telegram"),v=t.mfa_methods.map(({type:_,verified_at:A})=>({type:_,verifiedAt:Kt(A)}));return{id:t.id,createdAt:Kt(t.created_at),linkedAccounts:e,email:i&&{address:i==null?void 0:i.address},phone:s&&{number:s==null?void 0:s.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:o&&{subject:o.subject,email:o.email,name:o.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.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:E&&{telegramUserId:E.telegramUserId,firstName:E.firstName,lastName:E.lastName,username:E.username,photoUrl:E.photoUrl},delegatedWallets:[],mfaMethods:v.map(_=>_.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}var kJ={},X2={},M8={};Object.defineProperty(M8,"__esModule",{value:!0});M8.walletLogo=void 0;const mCe=(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 `}};M8.walletLogo=mCe;var O8={};const yCe=qf(t5e);var uu={},bd={};Object.defineProperty(bd,"__esModule",{value:!0});bd.errorValues=bd.standardErrorCodes=void 0;bd.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}};bd.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 j8={},kk={};(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=bd,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 s(h){var g;if(typeof h=="number")return h;if(o(h))return(g=h.code)!==null&&g!==void 0?g:h.errorCode}t.getErrorCode=s;function o(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function a(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=a;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"}})(kk);Object.defineProperty(j8,"__esModule",{value:!0});j8.standardErrors=void 0;const ss=bd,NJ=kk;j8.standardErrors={rpc:{parse:t=>La(ss.standardErrorCodes.rpc.parse,t),invalidRequest:t=>La(ss.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>La(ss.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>La(ss.standardErrorCodes.rpc.methodNotFound,t),internal:t=>La(ss.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 La(e,t)},invalidInput:t=>La(ss.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>La(ss.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>La(ss.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>La(ss.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>La(ss.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>La(ss.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>jp(ss.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>jp(ss.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>jp(ss.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>jp(ss.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>jp(ss.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>jp(ss.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 MJ(e,r,n)}}};function La(t,e){const[r,n]=PJ(e);return new RJ(t,r||(0,NJ.getMessageFromCode)(t),n)}function jp(t,e){const[r,n]=PJ(e);return new MJ(t,r||(0,NJ.getMessageFromCode)(t),n)}function PJ(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 RJ 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 MJ extends RJ{constructor(e,r,n){if(!vCe(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}function vCe(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=bd;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var r=j8;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}})})(uu);var D8={},Vg={};Object.defineProperty(Vg,"__esModule",{value:!0});Vg.isErrorResponse=void 0;function wCe(t){return t.errorMessage!==void 0}Vg.isErrorResponse=wCe;var V0={};Object.defineProperty(V0,"__esModule",{value:!0});V0.LIB_VERSION=void 0;V0.LIB_VERSION="4.0.3";Object.defineProperty(D8,"__esModule",{value:!0});D8.serializeError=void 0;const bCe=Vg,_Ce=V0,xCe=bd,ECe=kk;function CCe(t,e){const r=(0,ECe.serialize)(ACe(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",_Ce.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=SCe(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}D8.serializeError=CCe;function ACe(t){return typeof t=="string"?{message:t,code:xCe.standardErrorCodes.rpc.internal}:(0,bCe.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function SCe(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 Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.RegExpString=Is.IntNumber=Is.BigIntString=Is.AddressString=Is.HexString=Is.OpaqueType=void 0;function Gv(){return t=>t}Is.OpaqueType=Gv;Is.HexString=Gv();Is.AddressString=Gv();Is.BigIntString=Gv();function ICe(t){return Math.floor(t)}Is.IntNumber=ICe;Is.RegExpString=Gv();var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.areAddressArraysEqual=Yt.getFavicon=Yt.range=Yt.isBigNumber=Yt.ensureParsedJSONObject=Yt.ensureBigInt=Yt.ensureRegExpString=Yt.ensureIntNumber=Yt.ensureBuffer=Yt.ensureAddressString=Yt.ensureEvenLengthHexString=Yt.ensureHexString=Yt.isHexString=Yt.prepend0x=Yt.strip0x=Yt.has0xPrefix=Yt.hexStringFromIntNumber=Yt.intNumberFromHexString=Yt.bigIntStringFromBigInt=Yt.hexStringFromBuffer=Yt.hexStringToUint8Array=Yt.uint8ArrayToHex=Yt.randomBytesHex=void 0;const G0=uu,Ja=Is,OJ=/^[0-9]*$/,jJ=/^[a-f0-9]*$/;function TCe(t){return DJ(crypto.getRandomValues(new Uint8Array(t)))}Yt.randomBytesHex=TCe;function DJ(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}Yt.uint8ArrayToHex=DJ;function $Ce(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}Yt.hexStringToUint8Array=$Ce;function kCe(t,e=!1){const r=t.toString("hex");return(0,Ja.HexString)(e?`0x${r}`:r)}Yt.hexStringFromBuffer=kCe;function NCe(t){return(0,Ja.BigIntString)(t.toString(10))}Yt.bigIntStringFromBigInt=NCe;function PCe(t){return(0,Ja.IntNumber)(Number(BigInt(Yv(t,!0))))}Yt.intNumberFromHexString=PCe;function RCe(t){return(0,Ja.HexString)(`0x${BigInt(t).toString(16)}`)}Yt.hexStringFromIntNumber=RCe;function Nk(t){return t.startsWith("0x")||t.startsWith("0X")}Yt.has0xPrefix=Nk;function L8(t){return Nk(t)?t.slice(2):t}Yt.strip0x=L8;function LJ(t){return Nk(t)?`0x${t.slice(2)}`:`0x${t}`}Yt.prepend0x=LJ;function Kv(t){if(typeof t!="string")return!1;const e=L8(t).toLowerCase();return jJ.test(e)}Yt.isHexString=Kv;function FJ(t,e=!1){if(typeof t=="string"){const r=L8(t).toLowerCase();if(jJ.test(r))return(0,Ja.HexString)(e?`0x${r}`:r)}throw G0.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}Yt.ensureHexString=FJ;function Yv(t,e=!1){let r=FJ(t,!1);return r.length%2===1&&(r=(0,Ja.HexString)(`0${r}`)),e?(0,Ja.HexString)(`0x${r}`):r}Yt.ensureEvenLengthHexString=Yv;function MCe(t){if(typeof t=="string"){const e=L8(t).toLowerCase();if(Kv(e)&&e.length===40)return(0,Ja.AddressString)(LJ(e))}throw G0.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}Yt.ensureAddressString=MCe;function OCe(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(Kv(t)){const e=Yv(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw G0.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}Yt.ensureBuffer=OCe;function UJ(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Ja.IntNumber)(t);if(typeof t=="string"){if(OJ.test(t))return(0,Ja.IntNumber)(Number(t));if(Kv(t))return(0,Ja.IntNumber)(Number(BigInt(Yv(t,!0))))}throw G0.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Yt.ensureIntNumber=UJ;function jCe(t){if(t instanceof RegExp)return(0,Ja.RegExpString)(t.toString());throw G0.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}Yt.ensureRegExpString=jCe;function DCe(t){if(t!==null&&(typeof t=="bigint"||BJ(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(UJ(t));if(typeof t=="string"){if(OJ.test(t))return BigInt(t);if(Kv(t))return BigInt(Yv(t,!0))}throw G0.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Yt.ensureBigInt=DCe;function LCe(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw G0.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}Yt.ensureParsedJSONObject=LCe;function BJ(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}Yt.isBigNumber=BJ;function FCe(t,e){return Array.from({length:e-t},(r,n)=>t+n)}Yt.range=FCe;function UCe(){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}`}Yt.getFavicon=UCe;function BCe(t,e){return t.length===e.length&&t.every((r,n)=>r===e[n])}Yt.areAddressArraysEqual=BCe;var Fc={},F8={},U8={},Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.decryptContent=Si.encryptContent=Si.importKeyFromHexString=Si.exportKeyToHexString=Si.decrypt=Si.encrypt=Si.deriveSharedSecret=Si.generateKeyPair=void 0;const WJ=Yt;async function WCe(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}Si.generateKeyPair=WCe;async function zCe(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}Si.deriveSharedSecret=zCe;async function zJ(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}}Si.encrypt=zJ;async function HJ(t,{iv:e,cipherText:r}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,r);return new TextDecoder().decode(n)}Si.decrypt=HJ;function qJ(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function HCe(t,e){const r=qJ(t),n=await crypto.subtle.exportKey(r,e);return(0,WJ.uint8ArrayToHex)(new Uint8Array(n))}Si.exportKeyToHexString=HCe;async function qCe(t,e){const r=qJ(t),n=(0,WJ.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(r,n,{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}Si.importKeyFromHexString=qCe;async function VCe(t,e){const r=JSON.stringify(t,(n,i)=>{if(!(i instanceof Error))return i;const s=i;return Object.assign(Object.assign({},s.code?{code:s.code}:{}),{message:s.message})});return zJ(e,r)}Si.encryptContent=VCe;async function GCe(t,e){return JSON.parse(await HJ(e,t))}Si.decryptContent=GCe;var du={};Object.defineProperty(du,"__esModule",{value:!0});du.ScopedLocalStorage=void 0;class O6{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 O6("CBWSDK").clear(),new O6("walletlink").clear()}}du.ScopedLocalStorage=O6;Object.defineProperty(U8,"__esModule",{value:!0});U8.SCWKeyManager=void 0;const _b=Si,KCe=du,lE={storageKey:"ownPrivateKey",keyType:"private"},cE={storageKey:"ownPublicKey",keyType:"public"},uE={storageKey:"peerPublicKey",keyType:"public"};class YCe{constructor(){this.storage=new KCe.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(uE,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(cE.storageKey),this.storage.removeItem(lE.storageKey),this.storage.removeItem(uE.storageKey)}async generateKeyPair(){const e=await(0,_b.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(lE,e.privateKey),await this.storeKey(cE,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(lE)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(cE)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(uE)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,_b.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const r=this.storage.getItem(e.storageKey);return r?(0,_b.importKeyFromHexString)(e.keyType,r):null}async storeKey(e,r){const n=await(0,_b.exportKeyToHexString)(e.keyType,r);this.storage.setItem(e.storageKey,n)}}U8.SCWKeyManager=YCe;var B8={};Object.defineProperty(B8,"__esModule",{value:!0});B8.SCWStateManager=void 0;const ZCe=du,_L="accounts",xL="activeChain",EL="availableChains",CL="walletCapabilities";class JCe{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var r,n;this.storage=new ZCe.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(EL),this._walletCapabilities=this.loadItemFromStorage(CL);const i=this.loadItemFromStorage(_L),s=this.loadItemFromStorage(xL);i&&this.updateListener.onAccountsUpdate({accounts:i,source:"storage"}),s&&this.updateListener.onChainUpdate({chain:s,source:"storage"}),this._accounts=i||[],this._activeChain=s||{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(_L,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(xL,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(EL,r),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(CL,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()}}B8.SCWStateManager=JCe;Object.defineProperty(F8,"__esModule",{value:!0});F8.SCWSigner=void 0;const QCe=U8,XCe=B8,xb=uu,AL=Yt,Eb=Si;class eAe{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new QCe.SCWKeyManager,this.stateManager=new XCe.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,Eb.importKeyFromHexString)("public",r.sender);await this.keyManager.setPeerPublicKey(n);const i=await this.decryptResponseMessage(r);this.updateInternalState({method:"eth_requestAccounts"},i);const s=i.result;if("error"in s)throw s.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 s=i.result;if("error"in s)throw s.error;return s.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 xb.standardErrors.rpc.invalidParams();const i=(0,AL.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(i)?null:void 0}case"wallet_getCapabilities":{const n=this.stateManager.walletCapabilities;if(!n)throw xb.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 xb.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await(0,Eb.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,Eb.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 xb.standardErrors.provider.unauthorized("Invalid session");return(0,Eb.decryptContent)(r.encrypted,n)}updateInternalState(e,r){var n,i;const s=(n=r.data)===null||n===void 0?void 0:n.chains;s&&this.stateManager.updateAvailableChains(s);const o=(i=r.data)===null||i===void 0?void 0:i.capabilities;o&&this.stateManager.updateWalletCapabilities(o);const a=r.result;if(!("error"in a))switch(e.method){case"eth_requestAccounts":{const l=a.value;this.stateManager.updateAccounts(l);break}case"wallet_switchEthereumChain":{if(a.value!==null)return;const l=e.params,c=(0,AL.ensureIntNumber)(l[0].chainId);this.stateManager.switchChain(c);break}}}}F8.SCWSigner=eAe;var W8={},GS={exports:{}},Pk={exports:{}},j1=typeof Reflect=="object"?Reflect:null,SL=j1&&typeof j1.apply=="function"?j1.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},_5;j1&&typeof j1.ownKeys=="function"?_5=j1.ownKeys:Object.getOwnPropertySymbols?_5=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:_5=function(e){return Object.getOwnPropertyNames(e)};function tAe(t){console&&console.warn&&console.warn(t)}var VJ=Number.isNaN||function(e){return e!==e};function fn(){fn.init.call(this)}Pk.exports=fn;Pk.exports.once=sAe;fn.EventEmitter=fn;fn.prototype._events=void 0;fn.prototype._eventsCount=0;fn.prototype._maxListeners=void 0;var IL=10;function z8(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(fn,"defaultMaxListeners",{enumerable:!0,get:function(){return IL},set:function(t){if(typeof t!="number"||t<0||VJ(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");IL=t}});fn.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};fn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||VJ(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 GJ(t){return t._maxListeners===void 0?fn.defaultMaxListeners:t._maxListeners}fn.prototype.getMaxListeners=function(){return GJ(this)};fn.prototype.emit=function(e){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")SL(l,this,r);else for(var c=l.length,u=QJ(l,c),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,tAe(a)}return t}fn.prototype.addListener=function(e,r){return KJ(this,e,r,!1)};fn.prototype.on=fn.prototype.addListener;fn.prototype.prependListener=function(e,r){return KJ(this,e,r,!0)};function rAe(){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 YJ(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=rAe.bind(n);return i.listener=r,n.wrapFn=i,i}fn.prototype.once=function(e,r){return z8(r),this.on(e,YJ(this,e,r)),this};fn.prototype.prependOnceListener=function(e,r){return z8(r),this.prependListener(e,YJ(this,e,r)),this};fn.prototype.removeListener=function(e,r){var n,i,s,o,a;if(z8(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(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():nAe(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};fn.prototype.off=fn.prototype.removeListener;fn.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 s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function ZJ(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?iAe(i):QJ(i,i.length)}fn.prototype.listeners=function(e){return ZJ(this,e,!0)};fn.prototype.rawListeners=function(e){return ZJ(this,e,!1)};fn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):JJ.call(t,e)};fn.prototype.listenerCount=JJ;function JJ(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}fn.prototype.eventNames=function(){return this._eventsCount>0?_5(this._events):[]};function QJ(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 cAe(t){var e=tQ(t),r=e[0],n=e[1];return(r+n)*3/4-n}function uAe(t,e,r){return(e+r)*3/4-r}function dAe(t){var e,r=tQ(t),n=r[0],i=r[1],s=new aAe(uAe(t,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Wa[t.charCodeAt(l)]<<2|Wa[t.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Wa[t.charCodeAt(l)]<<10|Wa[t.charCodeAt(l+1)]<<4|Wa[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function fAe(t){return jc[t>>18&63]+jc[t>>12&63]+jc[t>>6&63]+jc[t&63]}function hAe(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(jc[e>>2]+jc[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(jc[e>>10]+jc[e>>4&63]+jc[e<<2&63]+"=")),i.join("")}var Mk={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */Mk.read=function(t,e,r,n,i){var s,o,a=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,s=g&(1<<-u)-1,g>>=-u,u+=a;u>0;s=s*256+t[e+f],f+=h,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=n;u>0;o=o*256+t[e+f],f+=h,u-=8);if(s===0)s=1-c;else{if(s===l)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-c}return(g?-1:1)*o*Math.pow(2,s-n)};Mk.write=function(t,e,r,n,i,s){var o,a,l,c=s*8-i-1,u=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-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?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=h/l:e+=h*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=u?(a=0,o=u):o+f>=1?(a=(e*l-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+g]=a&255,g+=m,a/=256,i-=8);for(o=o<0;t[r+g]=o&255,g+=m,o/=256,c-=8);t[r+g-m]|=w*128};/*! +- https://privy.io`;let XS=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new Ee("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 Hr(e)}}async link(){if(!this.client)throw new Ee("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 Hr(e)}}async sign(){if(!this.client)throw new Ee("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new Ee("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new Ee("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 Ee("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Ee("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=oAe({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new Ks(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}},x1=class{async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new Ee("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(uCe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Hr(e)}}async link(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new Ee("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(lCe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Hr(e)}}async sendSmsCode({phoneNumber:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new Ee("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new Ee("phone nNumber must be set when initialzing authentication.");let i=O8(n);try{return await this.api.post(oCe,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw Hr(s)}}constructor({phoneNumber:e,captchaToken:r,disableSignup:n}){this.meta={phoneNumber:e,captchaToken:r,disableSignup:n??!1}}},lAe=class extends x1{async link(){if(!this.api)throw new Ee("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new Ee("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(dCe,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Hr(e)}}constructor(e,r,n){super({phoneNumber:r,captchaToken:n}),this.meta={phoneNumber:r,captchaToken:n,oldPhoneNumber:e,disableSignup:!1}}};const je=()=>{throw Error("You need to wrap your application with the initialized with your app id.")},_b=t=>()=>{throw Error(t.trim())},JJ=I.createContext({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:je,setError:je,setExecuting:je,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:je,reset:je,execute:je});let F8=class extends La{constructor(e,r,n){super(e||"Captcha failed"),this.type="Captcha",r instanceof Error&&(this.cause=r),this.privyErrorCode=n}};const cAe=({children:t,id:e,captchaSiteKey:r,captchaEnabled:n})=>{let i=I.useRef(null),[s,a]=I.useState(),[o,l]=I.useState(),[c,u]=I.useState(!1),f=I.useMemo(()=>n?c||s||o?!c||s||o?s&&!o?{status:"success",token:s}:o?{status:"error",error:o}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"},[n,s,o,c]);return d.jsx(JJ.Provider,{value:{...f,ref:i,enabled:n,siteKey:r,appId:e,setToken:a,setError:l,setExecuting:u,remove(){var h;n&&((h=i.current)==null||h.remove(),u(!1),l(void 0),a(void 0))},reset(){var h;n&&((h=i.current)==null||h.reset(),u(!1),l(void 0),a(void 0))},execute(){var h;n&&(u(!0),(h=i.current)==null||h.execute())},async waitForResult(){if(!n)return"";try{return await BCe(()=>{var h;return(h=i.current)==null?void 0:h.getResponse()},{interval:200,timeout:2e4})}catch{throw new F8("Captcha failed",null,Se.CAPTCHA_TIMEOUT)}}},children:t})},Co=()=>I.useContext(JJ);let xb=class{async authenticate(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(ECe,{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 Hr(e)}}async link(){if(!this.api)throw new Ee("Auth flow has no API instance");try{return await this.api.post(CCe,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw Hr(e)}}constructor(e,r=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=r}};function DD(t){let e={detail:"",retryable:!1};return(t==null?void 0:t.privyErrorCode)===Se.LINKED_TO_ANOTHER_USER&&(e.detail="This account has already been linked to another user."),(t==null?void 0:t.privyErrorCode)===Se.DISALLOWED_LOGIN_METHOD&&(e.detail="Login with Telegram not allowed."),(t==null?void 0:t.privyErrorCode)===Se.INVALID_DATA&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Se.CANNOT_LINK_MORE_OF_TYPE&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Se.INVALID_CREDENTIALS&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Se.TOO_MANY_REQUESTS&&(e.detail="Too many requests. Please wait before trying again."),(t==null?void 0:t.privyErrorCode)===Se.TOO_MANY_REQUESTS&&t.message.includes("rate limit")&&(e.detail="Request limit reached for Telegram. Please wait a moment and try again."),t instanceof F8&&(e.retryable=!0,e.detail="Something went wrong. Try again."),e}function uAe(){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")||""),s=e.get("first_name");if(r&&s&&i&&n)return Object.fromEntries(e.entries())}())?(FD(),{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")||""),s=r.get("hash");return n&&i&&s?Object.fromEntries(r.entries()):void 0}())?(FD(),{flowType:"web-app",authData:t}):void 0}function FD(){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 Xp=class QJ{static parse(e){try{return new QJ(e)}catch{return null}}static throwIfNotWellFormedJwt(e){return BL(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=BL(e)}},dAe=class XJ extends Xp{static parse(e){try{return new XJ(e)}catch{return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}};function Kt(t){return t?new Date(1e3*t):null}function Ws(t,e){return t.slice().sort((r,n)=>(n.firstVerifiedAt??n.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===e)}const _a=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"&&e.walletIndex===0))||null,_5=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"),fAe=t=>_5(t).reduce((e,r)=>!e||e.walletIndex((t==null?void 0:t.linkedAccounts)??[]).filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType===e),x5=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"),jc=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"&&e.walletIndex===0))||null,hAe=t=>x5(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,Gy=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.imported&&e.walletClientType==="privy"&&e.chainType==="solana"))||null,F4=(t,e)=>(t==null?void 0:t.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.address===e))||null,no=t=>_a(t)??jc(t),Wn=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")},pAe=t=>{let e=no(t);if(!e)throw Error("Failed to find primary wallet");return Wn(e)},Eb=(t,e)=>{let r=eQ(t,"ethereum").find(n=>Ir(n.address)===Ir(e));return{signingWallet:r,rootWallet:r?r.imported?r:_a(t):void 0}},E5=(t,e)=>{let r=eQ(t,"solana").find(n=>n.address===e);return r?r.imported||r.walletIndex===0?{signingWallet:r,rootWallet:r}:{signingWallet:r,rootWallet:jc(t)}:{}},_d=(t,e)=>{var r;return!(_a(t)||jc(t)||e!=="all-users"&&(e!=="users-without-wallets"||(r=(n=>n.linkedAccounts.filter(i=>i.type==="wallet"))(t))!=null&&r.length))};function _s(t){if(!t)return null;let e=function(_){let A=[];for(let C of _){let R=C.type;switch(C.type){case"wallet":let B={address:C.address,type:C.type,imported:C.imported,delegated:C.delegated,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at),chainType:C.chain_type,chainId:C.chain_id,walletClient:C.wallet_client_type==="privy"?"privy":"unknown",walletClientType:C.wallet_client_type,connectorType:C.connector_type,recoveryMethod:C.recovery_method,walletIndex:C.wallet_index};A.push(B);break;case"smart_wallet":let S={address:C.address,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at),smartWalletType:C.smart_wallet_type};A.push(S);break;case"cross_app":let U={type:C.type,subject:C.subject,embeddedWallets:C.embedded_wallets,smartWallets:C.smart_wallets,providerApp:{id:C.provider_app_id},verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(U);break;case"email":let G={address:C.address,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(G);break;case"phone":let ae={number:C.phoneNumber,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(ae);break;case"google_oauth":let K={subject:C.subject,email:C.email,name:C.name,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(K);break;case"spotify_oauth":let N={subject:C.subject,email:C.email,name:C.name,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(N);break;case"instagram_oauth":let k={subject:C.subject,username:C.username,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(k);break;case"twitter_oauth":let b={subject:C.subject,username:C.username,name:C.name,type:C.type,profilePictureUrl:C.profile_picture_url,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(b);break;case"discord_oauth":let x={subject:C.subject,username:C.username,email:C.email,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(x);break;case"github_oauth":let P={subject:C.subject,username:C.username,name:C.name,email:C.email,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(P);break;case"tiktok_oauth":let D={subject:C.subject,username:C.username,name:C.name,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(D);break;case"linkedin_oauth":let O={subject:C.subject,name:C.name,email:C.email,vanityName:C.vanity_name,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(O);break;case"apple_oauth":let j={subject:C.subject,email:C.email,type:C.type,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(j);break;case"custom_auth":A.push({type:C.type,customUserId:C.custom_user_id,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)});break;case"farcaster":let T={type:C.type,fid:C.fid,ownerAddress:C.owner_address,displayName:C.display_name,username:C.username,bio:C.bio,pfp:C.profile_picture_url,url:C.homepage_url,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at),signerPublicKey:C.signer_public_key};A.push(T);break;case"passkey":let L={type:C.type,enrolledInMfa:C.enrolled_in_mfa,credentialId:C.credential_id,authenticatorName:C.authenticator_name,createdWithDevice:C.created_with_device,createdWithOs:C.created_with_os,createdWithBrowser:C.created_with_browser,verifiedAt:Kt(C.verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(L);break;case"telegram":let M={type:C.type,telegramUserId:C.telegram_user_id,firstName:C.first_name,lastName:C.last_name,username:C.username,photoUrl:C.photo_url,verifiedAt:Kt(C.first_verified_at),firstVerifiedAt:Kt(C.first_verified_at),latestVerifiedAt:Kt(C.latest_verified_at)};A.push(M);break;default:console.warn(`Unrecognized account type: ${R}. Please consider upgrading the Privy SDK.`)}}return A}(t.linked_accounts),r=Ws(e,"wallet"),n=Ws(e,"smart_wallet"),i=Ws(e,"email"),s=Ws(e,"phone"),a=Ws(e,"google_oauth"),o=Ws(e,"twitter_oauth"),l=Ws(e,"discord_oauth"),c=Ws(e,"github_oauth"),u=Ws(e,"spotify_oauth"),f=Ws(e,"instagram_oauth"),h=Ws(e,"tiktok_oauth"),g=Ws(e,"linkedin_oauth"),m=Ws(e,"apple_oauth"),w=Ws(e,"farcaster"),E=Ws(e,"telegram"),v=t.mfa_methods.map(({type:_,verified_at:A})=>({type:_,verifiedAt:Kt(A)}));return{id:t.id,createdAt:Kt(t.created_at),linkedAccounts:e,email:i&&{address:i==null?void 0:i.address},phone:s&&{number:s==null?void 0:s.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:a&&{subject:a.subject,email:a.email,name:a.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:E&&{telegramUserId:E.telegramUserId,firstName:E.firstName,lastName:E.lastName,username:E.username,photoUrl:E.photoUrl},delegatedWallets:[],mfaMethods:v.map(_=>_.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}var tQ={},rv={},U8={};Object.defineProperty(U8,"__esModule",{value:!0});U8.walletLogo=void 0;const gAe=(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 `}};U8.walletLogo=gAe;var B8={};const mAe=Kf(e4e);var fu={},xd={};Object.defineProperty(xd,"__esModule",{value:!0});xd.errorValues=xd.standardErrorCodes=void 0;xd.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}};xd.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 W8={},Bk={};(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=xd,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 s(h){var g;if(typeof h=="number")return h;if(a(h))return(g=h.code)!==null&&g!==void 0?g:h.errorCode}t.getErrorCode=s;function a(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"}})(Bk);Object.defineProperty(W8,"__esModule",{value:!0});W8.standardErrors=void 0;const ss=xd,rQ=Bk;W8.standardErrors={rpc:{parse:t=>Do(ss.standardErrorCodes.rpc.parse,t),invalidRequest:t=>Do(ss.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>Do(ss.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>Do(ss.standardErrorCodes.rpc.methodNotFound,t),internal:t=>Do(ss.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 Do(e,t)},invalidInput:t=>Do(ss.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>Do(ss.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Do(ss.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Do(ss.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Do(ss.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Do(ss.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Dp(ss.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>Dp(ss.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>Dp(ss.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>Dp(ss.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>Dp(ss.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>Dp(ss.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 sQ(e,r,n)}}};function Do(t,e){const[r,n]=nQ(e);return new iQ(t,r||(0,rQ.getMessageFromCode)(t),n)}function Dp(t,e){const[r,n]=nQ(e);return new sQ(t,r||(0,rQ.getMessageFromCode)(t),n)}function nQ(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 iQ 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 sQ extends iQ{constructor(e,r,n){if(!yAe(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}function yAe(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=xd;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var r=W8;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}})})(fu);var z8={},Kg={};Object.defineProperty(Kg,"__esModule",{value:!0});Kg.isErrorResponse=void 0;function vAe(t){return t.errorMessage!==void 0}Kg.isErrorResponse=vAe;var Y0={};Object.defineProperty(Y0,"__esModule",{value:!0});Y0.LIB_VERSION=void 0;Y0.LIB_VERSION="4.0.3";Object.defineProperty(z8,"__esModule",{value:!0});z8.serializeError=void 0;const wAe=Kg,bAe=Y0,_Ae=xd,xAe=Bk;function EAe(t,e){const r=(0,xAe.serialize)(CAe(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",bAe.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=AAe(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}z8.serializeError=EAe;function CAe(t){return typeof t=="string"?{message:t,code:_Ae.standardErrorCodes.rpc.internal}:(0,wAe.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function AAe(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 Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.RegExpString=Is.IntNumber=Is.BigIntString=Is.AddressString=Is.HexString=Is.OpaqueType=void 0;function Zv(){return t=>t}Is.OpaqueType=Zv;Is.HexString=Zv();Is.AddressString=Zv();Is.BigIntString=Zv();function SAe(t){return Math.floor(t)}Is.IntNumber=SAe;Is.RegExpString=Zv();var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.areAddressArraysEqual=Yt.getFavicon=Yt.range=Yt.isBigNumber=Yt.ensureParsedJSONObject=Yt.ensureBigInt=Yt.ensureRegExpString=Yt.ensureIntNumber=Yt.ensureBuffer=Yt.ensureAddressString=Yt.ensureEvenLengthHexString=Yt.ensureHexString=Yt.isHexString=Yt.prepend0x=Yt.strip0x=Yt.has0xPrefix=Yt.hexStringFromIntNumber=Yt.intNumberFromHexString=Yt.bigIntStringFromBigInt=Yt.hexStringFromBuffer=Yt.hexStringToUint8Array=Yt.uint8ArrayToHex=Yt.randomBytesHex=void 0;const Z0=fu,Jo=Is,aQ=/^[0-9]*$/,oQ=/^[a-f0-9]*$/;function IAe(t){return lQ(crypto.getRandomValues(new Uint8Array(t)))}Yt.randomBytesHex=IAe;function lQ(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}Yt.uint8ArrayToHex=lQ;function TAe(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}Yt.hexStringToUint8Array=TAe;function $Ae(t,e=!1){const r=t.toString("hex");return(0,Jo.HexString)(e?`0x${r}`:r)}Yt.hexStringFromBuffer=$Ae;function kAe(t){return(0,Jo.BigIntString)(t.toString(10))}Yt.bigIntStringFromBigInt=kAe;function NAe(t){return(0,Jo.IntNumber)(Number(BigInt(Qv(t,!0))))}Yt.intNumberFromHexString=NAe;function PAe(t){return(0,Jo.HexString)(`0x${BigInt(t).toString(16)}`)}Yt.hexStringFromIntNumber=PAe;function Wk(t){return t.startsWith("0x")||t.startsWith("0X")}Yt.has0xPrefix=Wk;function H8(t){return Wk(t)?t.slice(2):t}Yt.strip0x=H8;function cQ(t){return Wk(t)?`0x${t.slice(2)}`:`0x${t}`}Yt.prepend0x=cQ;function Jv(t){if(typeof t!="string")return!1;const e=H8(t).toLowerCase();return oQ.test(e)}Yt.isHexString=Jv;function uQ(t,e=!1){if(typeof t=="string"){const r=H8(t).toLowerCase();if(oQ.test(r))return(0,Jo.HexString)(e?`0x${r}`:r)}throw Z0.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}Yt.ensureHexString=uQ;function Qv(t,e=!1){let r=uQ(t,!1);return r.length%2===1&&(r=(0,Jo.HexString)(`0${r}`)),e?(0,Jo.HexString)(`0x${r}`):r}Yt.ensureEvenLengthHexString=Qv;function RAe(t){if(typeof t=="string"){const e=H8(t).toLowerCase();if(Jv(e)&&e.length===40)return(0,Jo.AddressString)(cQ(e))}throw Z0.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}Yt.ensureAddressString=RAe;function MAe(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(Jv(t)){const e=Qv(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw Z0.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}Yt.ensureBuffer=MAe;function dQ(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Jo.IntNumber)(t);if(typeof t=="string"){if(aQ.test(t))return(0,Jo.IntNumber)(Number(t));if(Jv(t))return(0,Jo.IntNumber)(Number(BigInt(Qv(t,!0))))}throw Z0.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Yt.ensureIntNumber=dQ;function OAe(t){if(t instanceof RegExp)return(0,Jo.RegExpString)(t.toString());throw Z0.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}Yt.ensureRegExpString=OAe;function jAe(t){if(t!==null&&(typeof t=="bigint"||fQ(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(dQ(t));if(typeof t=="string"){if(aQ.test(t))return BigInt(t);if(Jv(t))return BigInt(Qv(t,!0))}throw Z0.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Yt.ensureBigInt=jAe;function LAe(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Z0.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}Yt.ensureParsedJSONObject=LAe;function fQ(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}Yt.isBigNumber=fQ;function DAe(t,e){return Array.from({length:e-t},(r,n)=>t+n)}Yt.range=DAe;function FAe(){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}`}Yt.getFavicon=FAe;function UAe(t,e){return t.length===e.length&&t.every((r,n)=>r===e[n])}Yt.areAddressArraysEqual=UAe;var Uc={},q8={},V8={},Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.decryptContent=Si.encryptContent=Si.importKeyFromHexString=Si.exportKeyToHexString=Si.decrypt=Si.encrypt=Si.deriveSharedSecret=Si.generateKeyPair=void 0;const hQ=Yt;async function BAe(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}Si.generateKeyPair=BAe;async function WAe(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}Si.deriveSharedSecret=WAe;async function pQ(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}}Si.encrypt=pQ;async function gQ(t,{iv:e,cipherText:r}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,r);return new TextDecoder().decode(n)}Si.decrypt=gQ;function mQ(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function zAe(t,e){const r=mQ(t),n=await crypto.subtle.exportKey(r,e);return(0,hQ.uint8ArrayToHex)(new Uint8Array(n))}Si.exportKeyToHexString=zAe;async function HAe(t,e){const r=mQ(t),n=(0,hQ.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(r,n,{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}Si.importKeyFromHexString=HAe;async function qAe(t,e){const r=JSON.stringify(t,(n,i)=>{if(!(i instanceof Error))return i;const s=i;return Object.assign(Object.assign({},s.code?{code:s.code}:{}),{message:s.message})});return pQ(e,r)}Si.encryptContent=qAe;async function VAe(t,e){return JSON.parse(await gQ(e,t))}Si.decryptContent=VAe;var hu={};Object.defineProperty(hu,"__esModule",{value:!0});hu.ScopedLocalStorage=void 0;class U4{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 U4("CBWSDK").clear(),new U4("walletlink").clear()}}hu.ScopedLocalStorage=U4;Object.defineProperty(V8,"__esModule",{value:!0});V8.SCWKeyManager=void 0;const Cb=Si,GAe=hu,gE={storageKey:"ownPrivateKey",keyType:"private"},mE={storageKey:"ownPublicKey",keyType:"public"},yE={storageKey:"peerPublicKey",keyType:"public"};class KAe{constructor(){this.storage=new GAe.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(yE,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(mE.storageKey),this.storage.removeItem(gE.storageKey),this.storage.removeItem(yE.storageKey)}async generateKeyPair(){const e=await(0,Cb.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(gE,e.privateKey),await this.storeKey(mE,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(gE)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(mE)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(yE)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,Cb.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const r=this.storage.getItem(e.storageKey);return r?(0,Cb.importKeyFromHexString)(e.keyType,r):null}async storeKey(e,r){const n=await(0,Cb.exportKeyToHexString)(e.keyType,r);this.storage.setItem(e.storageKey,n)}}V8.SCWKeyManager=KAe;var G8={};Object.defineProperty(G8,"__esModule",{value:!0});G8.SCWStateManager=void 0;const YAe=hu,UD="accounts",BD="activeChain",WD="availableChains",zD="walletCapabilities";class ZAe{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var r,n;this.storage=new YAe.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(WD),this._walletCapabilities=this.loadItemFromStorage(zD);const i=this.loadItemFromStorage(UD),s=this.loadItemFromStorage(BD);i&&this.updateListener.onAccountsUpdate({accounts:i,source:"storage"}),s&&this.updateListener.onChainUpdate({chain:s,source:"storage"}),this._accounts=i||[],this._activeChain=s||{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(UD,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(BD,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(WD,r),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(zD,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()}}G8.SCWStateManager=ZAe;Object.defineProperty(q8,"__esModule",{value:!0});q8.SCWSigner=void 0;const JAe=V8,QAe=G8,Ab=fu,HD=Yt,Sb=Si;class XAe{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new JAe.SCWKeyManager,this.stateManager=new QAe.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,Sb.importKeyFromHexString)("public",r.sender);await this.keyManager.setPeerPublicKey(n);const i=await this.decryptResponseMessage(r);this.updateInternalState({method:"eth_requestAccounts"},i);const s=i.result;if("error"in s)throw s.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 s=i.result;if("error"in s)throw s.error;return s.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 Ab.standardErrors.rpc.invalidParams();const i=(0,HD.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(i)?null:void 0}case"wallet_getCapabilities":{const n=this.stateManager.walletCapabilities;if(!n)throw Ab.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 Ab.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await(0,Sb.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,Sb.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 Ab.standardErrors.provider.unauthorized("Invalid session");return(0,Sb.decryptContent)(r.encrypted,n)}updateInternalState(e,r){var n,i;const s=(n=r.data)===null||n===void 0?void 0:n.chains;s&&this.stateManager.updateAvailableChains(s);const a=(i=r.data)===null||i===void 0?void 0:i.capabilities;a&&this.stateManager.updateWalletCapabilities(a);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,HD.ensureIntNumber)(l[0].chainId);this.stateManager.switchChain(c);break}}}}q8.SCWSigner=XAe;var K8={},eI={exports:{}},zk={exports:{}},D1=typeof Reflect=="object"?Reflect:null,qD=D1&&typeof D1.apply=="function"?D1.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},C5;D1&&typeof D1.ownKeys=="function"?C5=D1.ownKeys:Object.getOwnPropertySymbols?C5=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:C5=function(e){return Object.getOwnPropertyNames(e)};function eSe(t){console&&console.warn&&console.warn(t)}var yQ=Number.isNaN||function(e){return e!==e};function fn(){fn.init.call(this)}zk.exports=fn;zk.exports.once=iSe;fn.EventEmitter=fn;fn.prototype._events=void 0;fn.prototype._eventsCount=0;fn.prototype._maxListeners=void 0;var VD=10;function Y8(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(fn,"defaultMaxListeners",{enumerable:!0,get:function(){return VD},set:function(t){if(typeof t!="number"||t<0||yQ(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");VD=t}});fn.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};fn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||yQ(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 vQ(t){return t._maxListeners===void 0?fn.defaultMaxListeners:t._maxListeners}fn.prototype.getMaxListeners=function(){return vQ(this)};fn.prototype.emit=function(e){for(var r=[],n=1;n0&&(a=r[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")qD(l,this,r);else for(var c=l.length,u=EQ(l,c),n=0;n0&&a.length>i&&!a.warned){a.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=t,o.type=e,o.count=a.length,eSe(o)}return t}fn.prototype.addListener=function(e,r){return wQ(this,e,r,!1)};fn.prototype.on=fn.prototype.addListener;fn.prototype.prependListener=function(e,r){return wQ(this,e,r,!0)};function tSe(){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 bQ(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=tSe.bind(n);return i.listener=r,n.wrapFn=i,i}fn.prototype.once=function(e,r){return Y8(r),this.on(e,bQ(this,e,r)),this};fn.prototype.prependOnceListener=function(e,r){return Y8(r),this.prependListener(e,bQ(this,e,r)),this};fn.prototype.removeListener=function(e,r){var n,i,s,a,o;if(Y8(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(s=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){o=n[a].listener,s=a;break}if(s<0)return this;s===0?n.shift():rSe(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,o||r)}return this};fn.prototype.off=fn.prototype.removeListener;fn.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 s=Object.keys(n),a;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function _Q(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?nSe(i):EQ(i,i.length)}fn.prototype.listeners=function(e){return _Q(this,e,!0)};fn.prototype.rawListeners=function(e){return _Q(this,e,!1)};fn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):xQ.call(t,e)};fn.prototype.listenerCount=xQ;function xQ(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}fn.prototype.eventNames=function(){return this._eventsCount>0?C5(this._events):[]};function EQ(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 lSe(t){var e=SQ(t),r=e[0],n=e[1];return(r+n)*3/4-n}function cSe(t,e,r){return(e+r)*3/4-r}function uSe(t){var e,r=SQ(t),n=r[0],i=r[1],s=new aSe(cSe(t,n,i)),a=0,o=i>0?n-4:n,l;for(l=0;l>16&255,s[a++]=e>>8&255,s[a++]=e&255;return i===2&&(e=Wo[t.charCodeAt(l)]<<2|Wo[t.charCodeAt(l+1)]>>4,s[a++]=e&255),i===1&&(e=Wo[t.charCodeAt(l)]<<10|Wo[t.charCodeAt(l+1)]<<4|Wo[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}function dSe(t){return Lc[t>>18&63]+Lc[t>>12&63]+Lc[t>>6&63]+Lc[t&63]}function fSe(t,e,r){for(var n,i=[],s=e;so?o:a+s));return n===1?(e=t[r-1],i.push(Lc[e>>2]+Lc[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Lc[e>>10]+Lc[e>>4&63]+Lc[e<<2&63]+"=")),i.join("")}var qk={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */qk.read=function(t,e,r,n,i){var s,a,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,s=g&(1<<-u)-1,g>>=-u,u+=o;u>0;s=s*256+t[e+f],f+=h,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=n;u>0;a=a*256+t[e+f],f+=h,u-=8);if(s===0)s=1-c;else{if(s===l)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),s=s-c}return(g?-1:1)*a*Math.pow(2,s-n)};qk.write=function(t,e,r,n,i,s){var a,o,l,c=s*8-i-1,u=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-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,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?e+=h/l:e+=h*Math.pow(2,1-f),e*l>=2&&(a++,l/=2),a+f>=u?(o=0,a=u):a+f>=1?(o=(e*l-1)*Math.pow(2,i),a=a+f):(o=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[r+g]=o&255,g+=m,o/=256,i-=8);for(a=a<0;t[r+g]=a&255,g+=m,a/=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=H8,r=Mk,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=_,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.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 s(){try{const Y=new Uint8Array(1),F={foo:function(){return 42}};return Object.setPrototypeOf(F,Uint8Array.prototype),Object.setPrototypeOf(Y,F),Y.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(Y){if(Y>i)throw new RangeError('The value "'+Y+'" is invalid for option "size"');const F=new Uint8Array(Y);return Object.setPrototypeOf(F,a.prototype),F}function a(Y,F,z){if(typeof Y=="number"){if(typeof F=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(Y)}return l(Y,F,z)}a.poolSize=8192;function l(Y,F,z){if(typeof Y=="string")return h(Y,F);if(ArrayBuffer.isView(Y))return m(Y);if(Y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y);if(Ve(Y,ArrayBuffer)||Y&&Ve(Y.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ve(Y,SharedArrayBuffer)||Y&&Ve(Y.buffer,SharedArrayBuffer)))return w(Y,F,z);if(typeof Y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ie=Y.valueOf&&Y.valueOf();if(ie!=null&&ie!==Y)return a.from(ie,F,z);const pe=E(Y);if(pe)return pe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Y[Symbol.toPrimitive]=="function")return a.from(Y[Symbol.toPrimitive]("string"),F,z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y)}a.from=function(Y,F,z){return l(Y,F,z)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(Y){if(typeof Y!="number")throw new TypeError('"size" argument must be of type number');if(Y<0)throw new RangeError('The value "'+Y+'" is invalid for option "size"')}function u(Y,F,z){return c(Y),Y<=0?o(Y):F!==void 0?typeof z=="string"?o(Y).fill(F,z):o(Y).fill(F):o(Y)}a.alloc=function(Y,F,z){return u(Y,F,z)};function f(Y){return c(Y),o(Y<0?0:v(Y)|0)}a.allocUnsafe=function(Y){return f(Y)},a.allocUnsafeSlow=function(Y){return f(Y)};function h(Y,F){if((typeof F!="string"||F==="")&&(F="utf8"),!a.isEncoding(F))throw new TypeError("Unknown encoding: "+F);const z=A(Y,F)|0;let ie=o(z);const pe=ie.write(Y,F);return pe!==z&&(ie=ie.slice(0,pe)),ie}function g(Y){const F=Y.length<0?0:v(Y.length)|0,z=o(F);for(let ie=0;ie=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return Y|0}function _(Y){return+Y!=Y&&(Y=0),a.alloc(+Y)}a.isBuffer=function(F){return F!=null&&F._isBuffer===!0&&F!==a.prototype},a.compare=function(F,z){if(Ve(F,Uint8Array)&&(F=a.from(F,F.offset,F.byteLength)),Ve(z,Uint8Array)&&(z=a.from(z,z.offset,z.byteLength)),!a.isBuffer(F)||!a.isBuffer(z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(F===z)return 0;let ie=F.length,pe=z.length;for(let ve=0,he=Math.min(ie,pe);vepe.length?(a.isBuffer(he)||(he=a.from(he)),he.copy(pe,ve)):Uint8Array.prototype.set.call(pe,he,ve);else if(a.isBuffer(he))he.copy(pe,ve);else throw new TypeError('"list" argument must be an Array of Buffers');ve+=he.length}return pe};function A(Y,F){if(a.isBuffer(Y))return Y.length;if(ArrayBuffer.isView(Y)||Ve(Y,ArrayBuffer))return Y.byteLength;if(typeof Y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Y);const z=Y.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&z===0)return 0;let pe=!1;for(;;)switch(F){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return Ue(Y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z*2;case"hex":return z>>>1;case"base64":return xe(Y).length;default:if(pe)return ie?-1:Ue(Y).length;F=(""+F).toLowerCase(),pe=!0}}a.byteLength=A;function C(Y,F,z){let ie=!1;if((F===void 0||F<0)&&(F=0),F>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0,F>>>=0,z<=F))return"";for(Y||(Y="utf8");;)switch(Y){case"hex":return j(this,F,z);case"utf8":case"utf-8":return b(this,F,z);case"ascii":return L(this,F,z);case"latin1":case"binary":return O(this,F,z);case"base64":return k(this,F,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,F,z);default:if(ie)throw new TypeError("Unknown encoding: "+Y);Y=(Y+"").toLowerCase(),ie=!0}}a.prototype._isBuffer=!0;function R(Y,F,z){const ie=Y[F];Y[F]=Y[z],Y[z]=ie}a.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 z=0;zz&&(F+=" ... "),""},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(F,z,ie,pe,ve){if(Ve(F,Uint8Array)&&(F=a.from(F,F.offset,F.byteLength)),!a.isBuffer(F))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof F);if(z===void 0&&(z=0),ie===void 0&&(ie=F?F.length:0),pe===void 0&&(pe=0),ve===void 0&&(ve=this.length),z<0||ie>F.length||pe<0||ve>this.length)throw new RangeError("out of range index");if(pe>=ve&&z>=ie)return 0;if(pe>=ve)return-1;if(z>=ie)return 1;if(z>>>=0,ie>>>=0,pe>>>=0,ve>>>=0,this===F)return 0;let he=ve-pe,De=ie-z;const Ze=Math.min(he,De),et=this.slice(pe,ve),it=F.slice(z,ie);for(let ut=0;ut2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),z=+z,Ie(z)&&(z=pe?0:Y.length-1),z<0&&(z=Y.length+z),z>=Y.length){if(pe)return-1;z=Y.length-1}else if(z<0)if(pe)z=0;else return-1;if(typeof F=="string"&&(F=a.from(F,ie)),a.isBuffer(F))return F.length===0?-1:S(Y,F,z,ie,pe);if(typeof F=="number")return F=F&255,typeof Uint8Array.prototype.indexOf=="function"?pe?Uint8Array.prototype.indexOf.call(Y,F,z):Uint8Array.prototype.lastIndexOf.call(Y,F,z):S(Y,[F],z,ie,pe);throw new TypeError("val must be string, number or Buffer")}function S(Y,F,z,ie,pe){let ve=1,he=Y.length,De=F.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(Y.length<2||F.length<2)return-1;ve=2,he/=2,De/=2,z/=2}function Ze(it,ut){return ve===1?it[ut]:it.readUInt16BE(ut*ve)}let et;if(pe){let it=-1;for(et=z;ethe&&(z=he-De),et=z;et>=0;et--){let it=!0;for(let ut=0;utpe&&(ie=pe)):ie=pe;const ve=F.length;ie>ve/2&&(ie=ve/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 ve=this.length-z;if((ie===void 0||ie>ve)&&(ie=ve),F.length>0&&(ie<0||z<0)||z>this.length)throw new RangeError("Attempt to write outside buffer bounds");pe||(pe="utf8");let he=!1;for(;;)switch(pe){case"hex":return U(this,F,z,ie);case"utf8":case"utf-8":return G(this,F,z,ie);case"ascii":case"latin1":case"binary":return oe(this,F,z,ie);case"base64":return K(this,F,z,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,F,z,ie);default:if(he)throw new TypeError("Unknown encoding: "+pe);pe=(""+pe).toLowerCase(),he=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(Y,F,z){return F===0&&z===Y.length?e.fromByteArray(Y):e.fromByteArray(Y.slice(F,z))}function b(Y,F,z){z=Math.min(Y.length,z);const ie=[];let pe=F;for(;pe239?4:ve>223?3:ve>191?2:1;if(pe+De<=z){let Ze,et,it,ut;switch(De){case 1:ve<128&&(he=ve);break;case 2:Ze=Y[pe+1],(Ze&192)===128&&(ut=(ve&31)<<6|Ze&63,ut>127&&(he=ut));break;case 3:Ze=Y[pe+1],et=Y[pe+2],(Ze&192)===128&&(et&192)===128&&(ut=(ve&15)<<12|(Ze&63)<<6|et&63,ut>2047&&(ut<55296||ut>57343)&&(he=ut));break;case 4:Ze=Y[pe+1],et=Y[pe+2],it=Y[pe+3],(Ze&192)===128&&(et&192)===128&&(it&192)===128&&(ut=(ve&15)<<18|(Ze&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 P(ie)}const x=4096;function P(Y){const F=Y.length;if(F<=x)return String.fromCharCode.apply(String,Y);let z="",ie=0;for(;ieie)&&(z=ie);let pe="";for(let ve=F;veie&&(F=ie),z<0?(z+=ie,z<0&&(z=0)):z>ie&&(z=ie),zz)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(F,z,ie){F=F>>>0,z=z>>>0,ie||D(F,z,this.length);let pe=this[F],ve=1,he=0;for(;++he>>0,z=z>>>0,ie||D(F,z,this.length);let pe=this[F+--z],ve=1;for(;z>0&&(ve*=256);)pe+=this[F+--z]*ve;return pe},a.prototype.readUint8=a.prototype.readUInt8=function(F,z){return F=F>>>0,z||D(F,1,this.length),this[F]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(F,z){return F=F>>>0,z||D(F,2,this.length),this[F]|this[F+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(F,z){return F=F>>>0,z||D(F,2,this.length),this[F]<<8|this[F+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(F,z){return F=F>>>0,z||D(F,4,this.length),(this[F]|this[F+1]<<8|this[F+2]<<16)+this[F+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(F,z){return F=F>>>0,z||D(F,4,this.length),this[F]*16777216+(this[F+1]<<16|this[F+2]<<8|this[F+3])},a.prototype.readBigUInt64LE=Oe(function(F){F=F>>>0,me(F,"offset");const z=this[F],ie=this[F+7];(z===void 0||ie===void 0)&&be(F,this.length-8);const pe=z+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24,ve=this[++F]+this[++F]*2**8+this[++F]*2**16+ie*2**24;return BigInt(pe)+(BigInt(ve)<>>0,me(F,"offset");const z=this[F],ie=this[F+7];(z===void 0||ie===void 0)&&be(F,this.length-8);const pe=z*2**24+this[++F]*2**16+this[++F]*2**8+this[++F],ve=this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+ie;return(BigInt(pe)<>>0,z=z>>>0,ie||D(F,z,this.length);let pe=this[F],ve=1,he=0;for(;++he=ve&&(pe-=Math.pow(2,8*z)),pe},a.prototype.readIntBE=function(F,z,ie){F=F>>>0,z=z>>>0,ie||D(F,z,this.length);let pe=z,ve=1,he=this[F+--pe];for(;pe>0&&(ve*=256);)he+=this[F+--pe]*ve;return ve*=128,he>=ve&&(he-=Math.pow(2,8*z)),he},a.prototype.readInt8=function(F,z){return F=F>>>0,z||D(F,1,this.length),this[F]&128?(255-this[F]+1)*-1:this[F]},a.prototype.readInt16LE=function(F,z){F=F>>>0,z||D(F,2,this.length);const ie=this[F]|this[F+1]<<8;return ie&32768?ie|4294901760:ie},a.prototype.readInt16BE=function(F,z){F=F>>>0,z||D(F,2,this.length);const ie=this[F+1]|this[F]<<8;return ie&32768?ie|4294901760:ie},a.prototype.readInt32LE=function(F,z){return F=F>>>0,z||D(F,4,this.length),this[F]|this[F+1]<<8|this[F+2]<<16|this[F+3]<<24},a.prototype.readInt32BE=function(F,z){return F=F>>>0,z||D(F,4,this.length),this[F]<<24|this[F+1]<<16|this[F+2]<<8|this[F+3]},a.prototype.readBigInt64LE=Oe(function(F){F=F>>>0,me(F,"offset");const z=this[F],ie=this[F+7];(z===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 z=this[F],ie=this[F+7];(z===void 0||ie===void 0)&&be(F,this.length-8);const pe=(z<<24)+this[++F]*2**16+this[++F]*2**8+this[++F];return(BigInt(pe)<>>0,z||D(F,4,this.length),r.read(this,F,!0,23,4)},a.prototype.readFloatBE=function(F,z){return F=F>>>0,z||D(F,4,this.length),r.read(this,F,!1,23,4)},a.prototype.readDoubleLE=function(F,z){return F=F>>>0,z||D(F,8,this.length),r.read(this,F,!0,52,8)},a.prototype.readDoubleBE=function(F,z){return F=F>>>0,z||D(F,8,this.length),r.read(this,F,!1,52,8)};function M(Y,F,z,ie,pe,ve){if(!a.isBuffer(Y))throw new TypeError('"buffer" argument must be a Buffer instance');if(F>pe||FY.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(F,z,ie,pe){if(F=+F,z=z>>>0,ie=ie>>>0,!pe){const De=Math.pow(2,8*ie)-1;M(this,F,z,ie,De,0)}let ve=1,he=0;for(this[z]=F&255;++he>>0,ie=ie>>>0,!pe){const De=Math.pow(2,8*ie)-1;M(this,F,z,ie,De,0)}let ve=ie-1,he=1;for(this[z+ve]=F&255;--ve>=0&&(he*=256);)this[z+ve]=F/he&255;return z+ie},a.prototype.writeUint8=a.prototype.writeUInt8=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,1,255,0),this[z]=F&255,z+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,2,65535,0),this[z]=F&255,this[z+1]=F>>>8,z+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,2,65535,0),this[z]=F>>>8,this[z+1]=F&255,z+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,4,4294967295,0),this[z+3]=F>>>24,this[z+2]=F>>>16,this[z+1]=F>>>8,this[z]=F&255,z+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,4,4294967295,0),this[z]=F>>>24,this[z+1]=F>>>16,this[z+2]=F>>>8,this[z+3]=F&255,z+4};function X(Y,F,z,ie,pe){J(F,ie,pe,Y,z,7);let ve=Number(F&BigInt(4294967295));Y[z++]=ve,ve=ve>>8,Y[z++]=ve,ve=ve>>8,Y[z++]=ve,ve=ve>>8,Y[z++]=ve;let he=Number(F>>BigInt(32)&BigInt(4294967295));return Y[z++]=he,he=he>>8,Y[z++]=he,he=he>>8,Y[z++]=he,he=he>>8,Y[z++]=he,z}function le(Y,F,z,ie,pe){J(F,ie,pe,Y,z,7);let ve=Number(F&BigInt(4294967295));Y[z+7]=ve,ve=ve>>8,Y[z+6]=ve,ve=ve>>8,Y[z+5]=ve,ve=ve>>8,Y[z+4]=ve;let he=Number(F>>BigInt(32)&BigInt(4294967295));return Y[z+3]=he,he=he>>8,Y[z+2]=he,he=he>>8,Y[z+1]=he,he=he>>8,Y[z]=he,z+8}a.prototype.writeBigUInt64LE=Oe(function(F,z=0){return X(this,F,z,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Oe(function(F,z=0){return le(this,F,z,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(F,z,ie,pe){if(F=+F,z=z>>>0,!pe){const Ze=Math.pow(2,8*ie-1);M(this,F,z,ie,Ze-1,-Ze)}let ve=0,he=1,De=0;for(this[z]=F&255;++ve>0)-De&255;return z+ie},a.prototype.writeIntBE=function(F,z,ie,pe){if(F=+F,z=z>>>0,!pe){const Ze=Math.pow(2,8*ie-1);M(this,F,z,ie,Ze-1,-Ze)}let ve=ie-1,he=1,De=0;for(this[z+ve]=F&255;--ve>=0&&(he*=256);)F<0&&De===0&&this[z+ve+1]!==0&&(De=1),this[z+ve]=(F/he>>0)-De&255;return z+ie},a.prototype.writeInt8=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,1,127,-128),F<0&&(F=255+F+1),this[z]=F&255,z+1},a.prototype.writeInt16LE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,2,32767,-32768),this[z]=F&255,this[z+1]=F>>>8,z+2},a.prototype.writeInt16BE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,2,32767,-32768),this[z]=F>>>8,this[z+1]=F&255,z+2},a.prototype.writeInt32LE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,4,2147483647,-2147483648),this[z]=F&255,this[z+1]=F>>>8,this[z+2]=F>>>16,this[z+3]=F>>>24,z+4},a.prototype.writeInt32BE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,4,2147483647,-2147483648),F<0&&(F=4294967295+F+1),this[z]=F>>>24,this[z+1]=F>>>16,this[z+2]=F>>>8,this[z+3]=F&255,z+4},a.prototype.writeBigInt64LE=Oe(function(F,z=0){return X(this,F,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Oe(function(F,z=0){return le(this,F,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(Y,F,z,ie,pe,ve){if(z+ie>Y.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function ee(Y,F,z,ie,pe){return F=+F,z=z>>>0,pe||H(Y,F,z,4),r.write(Y,F,z,ie,23,4),z+4}a.prototype.writeFloatLE=function(F,z,ie){return ee(this,F,z,!0,ie)},a.prototype.writeFloatBE=function(F,z,ie){return ee(this,F,z,!1,ie)};function Z(Y,F,z,ie,pe){return F=+F,z=z>>>0,pe||H(Y,F,z,8),r.write(Y,F,z,ie,52,8),z+8}a.prototype.writeDoubleLE=function(F,z,ie){return Z(this,F,z,!0,ie)},a.prototype.writeDoubleBE=function(F,z,ie){return Z(this,F,z,!1,ie)},a.prototype.copy=function(F,z,ie,pe){if(!a.isBuffer(F))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!pe&&pe!==0&&(pe=this.length),z>=F.length&&(z=F.length),z||(z=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-z>>0,ie=ie===void 0?this.length:ie>>>0,F||(F=0);let ve;if(typeof F=="number")for(ve=z;ve2**32?pe=W(String(z)):typeof z=="bigint"&&(pe=String(z),(z>BigInt(2)**BigInt(32)||z<-(BigInt(2)**BigInt(32)))&&(pe=W(pe)),pe+="n"),ie+=` It must be ${F}. Received ${pe}`,ie},RangeError);function W(Y){let F="",z=Y.length;const ie=Y[0]==="-"?1:0;for(;z>=ie+4;z-=3)F=`_${Y.slice(z-3,z)}${F}`;return`${Y.slice(0,z)}${F}`}function q(Y,F,z){me(F,"offset"),(Y[F]===void 0||Y[F+z]===void 0)&&be(F,Y.length-(z+1))}function J(Y,F,z,ie,pe,ve){if(Y>z||Y= 0${he} and < 2${he} ** ${(ve+1)*8}${he}`:De=`>= -(2${he} ** ${(ve+1)*8-1}${he}) and < 2 ** ${(ve+1)*8-1}${he}`,new te.ERR_OUT_OF_RANGE("value",De,Y)}q(ie,pe,ve)}function me(Y,F){if(typeof Y!="number")throw new te.ERR_INVALID_ARG_TYPE(F,"number",Y)}function be(Y,F,z){throw Math.floor(Y)!==Y?(me(Y,z),new te.ERR_OUT_OF_RANGE("offset","an integer",Y)):F<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${F}`,Y)}const Ce=/[^+/0-9A-Za-z-_]/g;function Fe(Y){if(Y=Y.split("=")[0],Y=Y.trim().replace(Ce,""),Y.length<2)return"";for(;Y.length%4!==0;)Y=Y+"=";return Y}function Ue(Y,F){F=F||1/0;let z;const ie=Y.length;let pe=null;const ve=[];for(let he=0;he55295&&z<57344){if(!pe){if(z>56319){(F-=3)>-1&&ve.push(239,191,189);continue}else if(he+1===ie){(F-=3)>-1&&ve.push(239,191,189);continue}pe=z;continue}if(z<56320){(F-=3)>-1&&ve.push(239,191,189),pe=z;continue}z=(pe-55296<<10|z-56320)+65536}else pe&&(F-=3)>-1&&ve.push(239,191,189);if(pe=null,z<128){if((F-=1)<0)break;ve.push(z)}else if(z<2048){if((F-=2)<0)break;ve.push(z>>6|192,z&63|128)}else if(z<65536){if((F-=3)<0)break;ve.push(z>>12|224,z>>6&63|128,z&63|128)}else if(z<1114112){if((F-=4)<0)break;ve.push(z>>18|240,z>>12&63|128,z>>6&63|128,z&63|128)}else throw new Error("Invalid code point")}return ve}function Ye(Y){const F=[];for(let z=0;z>8,pe=z%256,ve.push(pe),ve.push(ie);return ve}function xe(Y){return e.toByteArray(Fe(Y))}function He(Y,F,z,ie){let pe;for(pe=0;pe=F.length||pe>=Y.length);++pe)F[pe+z]=Y[pe];return pe}function Ve(Y,F){return Y instanceof F||Y!=null&&Y.constructor!=null&&Y.constructor.name!=null&&Y.constructor.name===F.name}function Ie(Y){return Y!==Y}const Ne=function(){const Y="0123456789abcdef",F=new Array(256);for(let z=0;z<16;++z){const ie=z*16;for(let pe=0;pe<16;++pe)F[ie+pe]=Y[z]+Y[pe]}return F}();function Oe(Y){return typeof BigInt>"u"?Me:Y}function Me(){throw new Error("BigInt not supported")}})(Zv);var fE,TL;function gAe(){if(TL)return fE;TL=1;function t(m,w){var E=Object.keys(m);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(m);w&&(v=v.filter(function(_){return Object.getOwnPropertyDescriptor(m,_).enumerable})),E.push.apply(E,v)}return E}function e(m){for(var w=1;w0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(E){var v={data:E,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";for(var v=this.head,_=""+v.data;v=v.next;)_+=E+v.data;return _}},{key:"concat",value:function(E){if(this.length===0)return c.alloc(0);for(var v=c.allocUnsafe(E>>>0),_=this.head,A=0;_;)g(_.data,v,A),A+=_.data.length,_=_.next;return v}},{key:"consume",value:function(E,v){var _;return EC.length?C.length:E;if(R===C.length?A+=C:A+=C.slice(0,E),E-=R,E===0){R===C.length?(++_,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=C.slice(R));break}++_}return this.length-=_,A}},{key:"_getBuffer",value:function(E){var v=c.allocUnsafe(E),_=this.head,A=1;for(_.data.copy(v),E-=_.data.length;_=_.next;){var C=_.data,R=E>C.length?C.length:E;if(C.copy(v,v.length-E,0,R),E-=R,E===0){R===C.length?(++A,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=C.slice(R));break}++A}return this.length-=A,v}},{key:h,value:function(E,v){return f(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),m}(),fE}function mAe(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(KS,this,t)):process.nextTick(KS,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(x5,r):(r._writableState.errorEmitted=!0,process.nextTick($L,r,s)):process.nextTick($L,r,s):e?(process.nextTick(x5,r),e(s)):process.nextTick(x5,r)}),this)}function $L(t,e){KS(t,e),x5(t)}function x5(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function yAe(){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 KS(t,e){t.emit("error",e)}function vAe(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var rQ={destroy:mAe,undestroy:yAe,errorOrDestroy:vAe},K0={};function wAe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var nQ={};function cl(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){wAe(o,s);function o(a,l,c){return s.call(this,n(a,l,c))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,nQ[t]=i}function kL(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 bAe(t,e,r){return t.substr(0,e.length)===e}function _Ae(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function xAe(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}cl("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);cl("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&bAe(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(_Ae(t," argument"))i="The ".concat(t," ").concat(n," ").concat(kL(e,"type"));else{var s=xAe(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(kL(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);cl("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");cl("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});cl("ERR_STREAM_PREMATURE_CLOSE","Premature close");cl("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});cl("ERR_MULTIPLE_CALLBACK","Callback called multiple times");cl("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");cl("ERR_STREAM_WRITE_AFTER_END","write after end");cl("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);cl("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);cl("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");K0.codes=nQ;var EAe=K0.codes.ERR_INVALID_OPT_VALUE;function CAe(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function AAe(t,e,r,n){var i=CAe(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new EAe(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var iQ={getHighWaterMark:AAe},SAe=IAe;function IAe(t,e){if(hE("noDeprecation"))return t;var r=!1;function n(){if(!r){if(hE("throwDeprecation"))throw new Error(e);hE("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function hE(t){try{if(!Xt.localStorage)return!1}catch{return!1}var e=Xt.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var pE,NL;function sQ(){if(NL)return pE;NL=1,pE=U;function t(ee){var Z=this;this.next=null,this.entry=null,this.finish=function(){H(Z,ee)}}var e;U.WritableState=B;var r={deprecate:SAe},n=eQ,i=Zv.Buffer,s=(typeof Xt<"u"?Xt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(ee){return i.from(ee)}function a(ee){return i.isBuffer(ee)||ee instanceof s}var l=rQ,c=iQ,u=c.getHighWaterMark,f=K0.codes,h=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_MULTIPLE_CALLBACK,w=f.ERR_STREAM_CANNOT_PIPE,E=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,A=f.ERR_UNKNOWN_ENCODING,C=l.errorOrDestroy;io(U,n);function R(){}function B(ee,Z,te){e=e||ag(),ee=ee||{},typeof te!="boolean"&&(te=Z 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(W){P(Z,W)},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)}B.prototype.getBuffer=function(){for(var Z=this.bufferedRequest,te=[];Z;)te.push(Z),Z=Z.next;return te},function(){try{Object.defineProperty(B.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var S;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(S=Function.prototype[Symbol.hasInstance],Object.defineProperty(U,Symbol.hasInstance,{value:function(Z){return S.call(this,Z)?!0:this!==U?!1:Z&&Z._writableState instanceof B}})):S=function(Z){return Z instanceof this};function U(ee){e=e||ag();var Z=this instanceof e;if(!Z&&!S.call(U,this))return new U(ee);this._writableState=new B(ee,this,Z),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)}U.prototype.pipe=function(){C(this,new w)};function G(ee,Z){var te=new _;C(ee,te),process.nextTick(Z,te)}function oe(ee,Z,te,re){var W;return te===null?W=new v:typeof te!="string"&&!Z.objectMode&&(W=new h("chunk",["string","Buffer"],te)),W?(C(ee,W),process.nextTick(re,W),!1):!0}U.prototype.write=function(ee,Z,te){var re=this._writableState,W=!1,q=!re.objectMode&&a(ee);return q&&!i.isBuffer(ee)&&(ee=o(ee)),typeof Z=="function"&&(te=Z,Z=null),q?Z="buffer":Z||(Z=re.defaultEncoding),typeof te!="function"&&(te=R),re.ending?G(this,te):(q||oe(this,re,ee,te))&&(re.pendingcb++,W=N(this,re,q,ee,Z,te)),W},U.prototype.cork=function(){this._writableState.corked++},U.prototype.uncork=function(){var ee=this._writableState;ee.corked&&(ee.corked--,!ee.writing&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&j(this,ee))},U.prototype.setDefaultEncoding=function(Z){if(typeof Z=="string"&&(Z=Z.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Z+"").toLowerCase())>-1))throw new A(Z);return this._writableState.defaultEncoding=Z,this},Object.defineProperty(U.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function K(ee,Z,te){return!ee.objectMode&&ee.decodeStrings!==!1&&typeof Z=="string"&&(Z=i.from(Z,te)),Z}Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(ee,Z,te,re,W,q){if(!te){var J=K(Z,re,W);re!==J&&(te=!0,W="buffer",re=J)}var me=Z.objectMode?1:re.length;Z.length+=me;var be=Z.length */(function(t,e){var r=Zv,n=r.Buffer;function i(o,a){for(var l in o)a[l]=o[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,l){return n(o,a,l)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,l)},s.alloc=function(o,a,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var c=n(o);return a!==void 0?typeof l=="string"?c.fill(a,l):c.fill(a):c.fill(0),c},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(YS,YS.exports);var Xf=YS.exports,RL;function ML(){if(RL)return mE;RL=1;var t=Xf.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 _;;)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(_)return;v=(""+v).toLowerCase(),_=!0}}function n(v){var _=r(v);if(typeof _!="string"&&(t.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return _||v}mE.StringDecoder=i;function i(v){this.encoding=n(v);var _;switch(this.encoding){case"utf16le":this.text=f,this.end=h,_=4;break;case"utf8":this.fillLast=l,_=4;break;case"base64":this.text=g,this.end=m,_=3;break;default:this.write=w,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(_)}i.prototype.write=function(v){if(v.length===0)return"";var _,A;if(this.lastNeed){if(_=this.fillLast(v),_===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 o(v,_,A){var C=_.length-1;if(C=0?(R>0&&(v.lastNeed=R-1),R):--C=0?(R>0&&(v.lastNeed=R-2),R):--C=0?(R>0&&(R===2?R=0:v.lastNeed=R-3),R):0))}function a(v,_,A){if((_[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return v.lastNeed=2,"�"}}function l(v){var _=this.lastTotal-this.lastNeed,A=a(this,v);if(A!==void 0)return A;if(this.lastNeed<=v.length)return v.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,_,0,v.length),this.lastNeed-=v.length}function c(v,_){var A=o(this,v,_);if(!this.lastNeed)return v.toString("utf8",_);this.lastTotal=A;var C=v.length-(A-this.lastNeed);return v.copy(this.lastChar,0,C),v.toString("utf8",_,C)}function u(v){var _=v&&v.length?this.write(v):"";return this.lastNeed?_+"�":_}function f(v,_){if((v.length-_)%2===0){var A=v.toString("utf16le",_);if(A){var C=A.charCodeAt(A.length-1);if(C>=55296&&C<=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",_,v.length-1)}function h(v){var _=v&&v.length?this.write(v):"";if(this.lastNeed){var A=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,A)}return _}function g(v,_){var A=(v.length-_)%3;return A===0?v.toString("base64",_):(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",_,v.length-A))}function m(v){var _=v&&v.length?this.write(v):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function w(v){return v.toString(this.encoding)}function E(v){return v&&v.length?this.write(v):""}return mE}var OL=K0.codes.ERR_STREAM_PREMATURE_CLOSE;function TAe(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof J!="string"&&!Fe.objectMode&&Object.getPrototypeOf(J)!==n.prototype&&(J=s(J)),be)Fe.endEmitted?R(q,new v):K(q,Fe,J,!0);else if(Fe.ended)R(q,new w);else{if(Fe.destroyed)return!1;Fe.reading=!1,Fe.decoder&&!me?(J=Fe.decoder.write(J),Fe.objectMode||J.length!==0?K(q,Fe,J,!1):j(q,Fe)):K(q,Fe,J,!1)}else be||(Fe.reading=!1,j(q,Fe))}return!Fe.ended&&(Fe.length=k?q=k:(q--,q|=q>>>1,q|=q>>>2,q|=q>>>4,q|=q>>>8,q|=q>>>16,q++),q}function x(q,J){return q<=0||J.length===0&&J.ended?0:J.objectMode?1:q!==q?J.flowing&&J.length?J.buffer.head.data.length:J.length:(q>J.highWaterMark&&(J.highWaterMark=b(q)),q<=J.length?q:J.ended?J.length:(J.needReadable=!0,0))}G.prototype.read=function(q){l("read",q),q=parseInt(q,10);var J=this._readableState,me=q;if(q!==0&&(J.emittedReadable=!1),q===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended))return l("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?te(this):L(this),null;if(q=x(q,J),q===0&&J.ended)return J.length===0&&te(this),null;var be=J.needReadable;l("need readable",be),(J.length===0||J.length-q0?Ce=Z(q,J):Ce=null,Ce===null?(J.needReadable=J.length<=J.highWaterMark,q=0):(J.length-=q,J.awaitDrain=0),J.length===0&&(J.ended||(J.needReadable=!0),me!==q&&J.ended&&te(this)),Ce!==null&&this.emit("data",Ce),Ce};function P(q,J){if(l("onEofChunk"),!J.ended){if(J.decoder){var me=J.decoder.end();me&&me.length&&(J.buffer.push(me),J.length+=J.objectMode?1:me.length)}J.ended=!0,J.sync?L(q):(J.needReadable=!1,J.emittedReadable||(J.emittedReadable=!0,O(q)))}}function L(q){var J=q._readableState;l("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,J.emittedReadable||(l("emitReadable",J.flowing),J.emittedReadable=!0,process.nextTick(O,q))}function O(q){var J=q._readableState;l("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&(J.length||J.ended)&&(q.emit("readable"),J.emittedReadable=!1),J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,ee(q)}function j(q,J){J.readingMore||(J.readingMore=!0,process.nextTick(I,q,J))}function I(q,J){for(;!J.reading&&!J.ended&&(J.length1&&W(be.pipes,q)!==-1)&&!xe&&(l("false write response, pause",be.awaitDrain),be.awaitDrain++),me.pause())}function Ie(Y){l("onerror",Y),Me(),q.removeListener("error",Ie),e(q,"error")===0&&R(q,Y)}S(q,"error",Ie);function Ne(){q.removeListener("finish",Oe),Me()}q.once("close",Ne);function Oe(){l("onfinish"),q.removeListener("close",Ne),Me()}q.once("finish",Oe);function Me(){l("unpipe"),me.unpipe(q)}return q.emit("pipe",me),be.flowing||(l("pipe resume"),me.resume()),q};function D(q){return function(){var me=q._readableState;l("pipeOnDrain",me.awaitDrain),me.awaitDrain&&me.awaitDrain--,me.awaitDrain===0&&e(q,"data")&&(me.flowing=!0,ee(q))}}G.prototype.unpipe=function(q){var J=this._readableState,me={hasUnpiped:!1};if(J.pipesCount===0)return this;if(J.pipesCount===1)return q&&q!==J.pipes?this:(q||(q=J.pipes),J.pipes=null,J.pipesCount=0,J.flowing=!1,q&&q.emit("unpipe",this,me),this);if(!q){var be=J.pipes,Ce=J.pipesCount;J.pipes=null,J.pipesCount=0,J.flowing=!1;for(var Fe=0;Fe0,be.flowing!==!1&&this.resume()):q==="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?L(this):be.reading||process.nextTick(X,this)),me},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(q,J){var me=r.prototype.removeListener.call(this,q,J);return q==="readable"&&process.nextTick(M,this),me},G.prototype.removeAllListeners=function(q){var J=r.prototype.removeAllListeners.apply(this,arguments);return(q==="readable"||q===void 0)&&process.nextTick(M,this),J};function M(q){var J=q._readableState;J.readableListening=q.listenerCount("readable")>0,J.resumeScheduled&&!J.paused?J.flowing=!0:q.listenerCount("data")>0&&q.resume()}function X(q){l("readable nexttick read 0"),q.read(0)}G.prototype.resume=function(){var q=this._readableState;return q.flowing||(l("resume"),q.flowing=!q.readableListening,le(this,q)),q.paused=!1,this};function le(q,J){J.resumeScheduled||(J.resumeScheduled=!0,process.nextTick(H,q,J))}function H(q,J){l("resume",J.reading),J.reading||q.read(0),J.resumeScheduled=!1,q.emit("resume"),ee(q),J.flowing&&!J.reading&&q.read(0)}G.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(q){var J=q._readableState;for(l("flow",J.flowing);J.flowing&&q.read()!==null;);}G.prototype.wrap=function(q){var J=this,me=this._readableState,be=!1;q.on("end",function(){if(l("wrapped end"),me.decoder&&!me.ended){var Ue=me.decoder.end();Ue&&Ue.length&&J.push(Ue)}J.push(null)}),q.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 Ye=J.push(Ue);Ye||(be=!0,q.pause())}});for(var Ce in q)this[Ce]===void 0&&typeof q[Ce]=="function"&&(this[Ce]=function(Ye){return function(){return q[Ye].apply(q,arguments)}}(Ce));for(var Fe=0;Fe=J.length?(J.decoder?me=J.buffer.join(""):J.buffer.length===1?me=J.buffer.first():me=J.buffer.concat(J.length),J.buffer.clear()):me=J.buffer.consume(q,J.decoder),me}function te(q){var J=q._readableState;l("endReadable",J.endEmitted),J.endEmitted||(J.ended=!0,process.nextTick(re,J,q))}function re(q,J){if(l("endReadableNT",q.endEmitted,q.length),!q.endEmitted&&q.length===0&&(q.endEmitted=!0,J.readable=!1,J.emit("end"),q.autoDestroy)){var me=J._writableState;(!me||me.autoDestroy&&me.finished)&&J.destroy()}}typeof Symbol=="function"&&(G.from=function(q,J){return C===void 0&&(C=PAe()),C(G,q,J)});function W(q,J){for(var me=0,be=q.length;me0;return HAe(o,l,c,function(u){i||(i=u),u&&s.forEach(BL),!l&&(s.forEach(BL),n(i))})});return e.reduce(qAe)}var KAe=GAe;(function(t,e){e=t.exports=aQ(),e.Stream=e,e.Readable=e,e.Writable=sQ(),e.Duplex=ag(),e.Transform=lQ,e.PassThrough=FAe,e.finished=Ok,e.pipeline=KAe})(GS,GS.exports);var dQ=GS.exports;const{Transform:YAe}=dQ;var ZAe=t=>class fQ extends YAe{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_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 fQ(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:JAe}=dQ;var QAe=t=>class hQ extends JAe{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_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 hQ(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const XAe=ZAe,eSe=QAe;var tSe=function(t){const e=XAe(t),r=eSe(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)}}},pQ={};const WL=[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];pQ.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],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=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|s>>>31),g=f^(s<<1|i>>>31);const m=t[0]^h,w=t[1]^g,E=t[10]^h,v=t[11]^g,_=t[20]^h,A=t[21]^g,C=t[30]^h,R=t[31]^g,B=t[40]^h,S=t[41]^g;h=r^(o<<1|a>>>31),g=n^(a<<1|o>>>31);const U=t[2]^h,G=t[3]^g,oe=t[12]^h,K=t[13]^g,N=t[22]^h,k=t[23]^g,b=t[32]^h,x=t[33]^g,P=t[42]^h,L=t[43]^g;h=i^(l<<1|c>>>31),g=s^(c<<1|l>>>31);const O=t[4]^h,j=t[5]^g,I=t[14]^h,D=t[15]^g,M=t[24]^h,X=t[25]^g,le=t[34]^h,H=t[35]^g,ee=t[44]^h,Z=t[45]^g;h=o^(u<<1|f>>>31),g=a^(f<<1|u>>>31);const te=t[6]^h,re=t[7]^g,W=t[16]^h,q=t[17]^g,J=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 Ye=t[8]^h,lt=t[9]^g,xe=t[18]^h,He=t[19]^g,Ve=t[28]^h,Ie=t[29]^g,Ne=t[38]^h,Oe=t[39]^g,Me=t[48]^h,Y=t[49]^g,F=m,z=w,ie=v<<4|E>>>28,pe=E<<4|v>>>28,ve=_<<3|A>>>29,he=A<<3|_>>>29,De=R<<9|C>>>23,Ze=C<<9|R>>>23,et=B<<18|S>>>14,it=S<<18|B>>>14,ut=U<<1|G>>>31,pt=G<<1|U>>>31,tr=K<<12|oe>>>20,Wt=oe<<12|K>>>20,At=N<<10|k>>>22,mt=k<<10|N>>>22,Ct=x<<13|b>>>19,dt=b<<13|x>>>19,Nt=P<<2|L>>>30,jt=L<<2|P>>>30,gt=j<<30|O>>>2,Vt=O<<30|j>>>2,zt=I<<6|D>>>26,at=D<<6|I>>>26,Gt=X<<11|M>>>21,Ft=M<<11|X>>>21,yt=le<<15|H>>>17,Qe=H<<15|le>>>17,Ot=Z<<29|ee>>>3,_t=ee<<29|Z>>>3,Zt=te<<28|re>>>4,Cr=re<<28|te>>>4,qt=q<<23|W>>>9,Ar=W<<23|q>>>9,cr=J<<25|me>>>7,br=me<<25|J>>>7,Q=be<<21|Ce>>>11,se=Ce<<21|be>>>11,de=Ue<<24|Fe>>>8,ue=Fe<<24|Ue>>>8,we=Ye<<27|lt>>>5,Re=lt<<27|Ye>>>5,qe=xe<<20|He>>>12,Be=He<<20|xe>>>12,tt=Ie<<7|Ve>>>25,wt=Ve<<7|Ie>>>25,Pt=Ne<<8|Oe>>>24,Et=Oe<<8|Ne>>>24,ir=Me<<14|Y>>>18,Qt=Y<<14|Me>>>18;t[0]=F^~tr&Gt,t[1]=z^~Wt&Ft,t[10]=Zt^~qe&ve,t[11]=Cr^~Be&he,t[20]=ut^~zt&cr,t[21]=pt^~at&br,t[30]=we^~ie&At,t[31]=Re^~pe&mt,t[40]=gt^~qt&tt,t[41]=Vt^~Ar&wt,t[2]=tr^~Gt&Q,t[3]=Wt^~Ft&se,t[12]=qe^~ve&Ct,t[13]=Be^~he&dt,t[22]=zt^~cr&Pt,t[23]=at^~br&Et,t[32]=ie^~At&yt,t[33]=pe^~mt&Qe,t[42]=qt^~tt&De,t[43]=Ar^~wt&Ze,t[4]=Gt^~Q&ir,t[5]=Ft^~se&Qt,t[14]=ve^~Ct&Ot,t[15]=he^~dt&_t,t[24]=cr^~Pt&et,t[25]=br^~Et&it,t[34]=At^~yt&de,t[35]=mt^~Qe&ue,t[44]=tt^~De&Nt,t[45]=wt^~Ze&jt,t[6]=Q^~ir&F,t[7]=se^~Qt&z,t[16]=Ct^~Ot&Zt,t[17]=dt^~_t&Cr,t[26]=Pt^~et&ut,t[27]=Et^~it&pt,t[36]=yt^~de&we,t[37]=Qe^~ue&Re,t[46]=De^~Nt>,t[47]=Ze^~jt&Vt,t[8]=ir^~F&tr,t[9]=Qt^~z&Wt,t[18]=Ot^~Zt&qe,t[19]=_t^~Cr&Be,t[28]=et^~ut&zt,t[29]=it^~pt&at,t[38]=de^~we&ie,t[39]=ue^~Re&pe,t[48]=Nt^~gt&qt,t[49]=jt^~Vt&Ar,t[0]^=WL[e*2],t[1]^=WL[e*2+1]}};const j6=pQ;function Gg(){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}Gg.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};Gg.prototype.absorb=function(t){for(let e=0;e>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(j6.p1600(this.state),this.count=0);return e};Gg.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 rSe=Gg,nSe=tSe(rSe);const iSe=nSe;function gQ(t){return Buffer.allocUnsafe(t).fill(0)}function sSe(t){return t.toString(2).length}function mQ(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=xQ(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(s in e)i.push(Sc(t,e[s]));if(r==="dynamic"){var o=Sc("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([Sc("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,Hs.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=D1(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return Hs.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=D1(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=Dh(e);const a=Hs.bitLengthFromBigInt(n);if(a>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+a);if(n<0)throw new Error("Supplied uint is negative");return Hs.bufferBEFromBigInt(n,32)}else if(t.startsWith("int")){if(r=D1(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=Dh(e);const a=Hs.bitLengthFromBigInt(n);if(a>r)throw new Error("Supplied int exceeds width: "+r+" vs "+a);const l=Hs.twosFromBigInt(n,256);return Hs.bufferBEFromBigInt(l,32)}else if(t.startsWith("ufixed")){if(r=zL(t),n=Dh(e),n<0)throw new Error("Supplied ufixed is negative");return Sc("uint256",n*BigInt(2)**BigInt(r[1]))}else if(t.startsWith("fixed"))return r=zL(t),Sc("int256",Dh(e)*BigInt(2)**BigInt(r[1]))}throw new Error("Unsupported or invalid type: "+t)}function dSe(t){return t==="string"||t==="bytes"||xQ(t)==="dynamic"}function fSe(t){return t.lastIndexOf("]")===t.length-1}function hSe(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=_Q(t[s]),a=e[s],l=Sc(o,a);dSe(o)?(r.push(Sc("uint256",i)),n.push(l),i+=l.length):r.push(l)}return Buffer.concat(r.concat(n))}function EQ(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(Hs.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=D1(o),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=Dh(a);const l=Hs.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+l);i.push(Hs.bufferBEFromBigInt(n,r/8))}else if(o.startsWith("int")){if(r=D1(o),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=Dh(a);const l=Hs.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied int exceeds width: "+r+" vs "+l);const c=Hs.twosFromBigInt(n,r);i.push(Hs.bufferBEFromBigInt(c,r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function pSe(t,e){return Hs.keccak(EQ(t,e))}var gSe={rawEncode:hSe,solidityPack:EQ,soliditySHA3:pSe};const Il=bQ,Vy=gSe,CQ={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"]},_E={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,l,c)=>{if(r[l]!==void 0)return["bytes32",c==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Il.keccak(this.encodeData(l,c,r,n))];if(c===void 0)throw new Error(`missing value for field ${a} of type ${l}`);if(l==="bytes")return["bytes32",Il.keccak(c)];if(l==="string")return typeof c=="string"&&(c=Buffer.from(c,"utf8")),["bytes32",Il.keccak(c)];if(l.lastIndexOf("]")===l.length-1){const u=l.slice(0,l.lastIndexOf("[")),f=c.map(h=>o(a,u,h));return["bytes32",Il.keccak(Vy.rawEncode(f.map(([h])=>h),f.map(([,h])=>h)))]}return[l,c]};for(const a of r[t]){const[l,c]=o(a.name,a.type,e[a.name]);i.push(l),s.push(c)}}else for(const o of r[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=Il.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=Il.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=Il.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return Vy.rawEncode(i,s)},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:o,type:a})=>a+" "+o).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 Il.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Il.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in CQ.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)),Il.keccak(Buffer.concat(n))}};var mSe={TYPED_MESSAGE_SCHEMA:CQ,TypedDataUtils:_E,hashForSignTypedDataLegacy:function(t){return ySe(t.data)},hashForSignTypedData_v3:function(t){return _E.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return _E.hash(t.data)}};function ySe(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(s){return s.type==="bytes"?Il.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Vy.soliditySHA3(["bytes32","bytes32"],[Vy.soliditySHA3(new Array(t.length).fill("string"),i),Vy.soliditySHA3(n,r)])}var qc={};Object.defineProperty(qc,"__esModule",{value:!0});qc.APP_VERSION_KEY=qc.LOCAL_STORAGE_ADDRESSES_KEY=qc.WALLET_USER_NAME_KEY=void 0;qc.WALLET_USER_NAME_KEY="walletUsername";qc.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";qc.APP_VERSION_KEY="AppVersion";var Jv={};Object.defineProperty(Jv,"__esModule",{value:!0});Jv.RelayEventManager=void 0;const vSe=Yt;class wSe{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,vSe.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}Jv.RelayEventManager=wSe;var K8={},Y8={},Z8={};Object.defineProperty(Z8,"__esModule",{value:!0});Z8.WalletLinkCipher=void 0;const Cb=Yt;class bSe{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,Cb.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),a=16,l=o.slice(o.byteLength-a),c=o.slice(0,o.byteLength-a),u=new Uint8Array(l),f=new Uint8Array(c),h=new Uint8Array([...n,...u,...f]);return(0,Cb.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 s=await crypto.subtle.importKey("raw",(0,Cb.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,Cb.hexStringToUint8Array)(e),a=o.slice(0,12),l=o.slice(12,28),c=o.slice(28),u=new Uint8Array([...c,...l]),f={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(f,s,u),g=new TextDecoder;n(g.decode(h))}catch(h){i(h)}})()})}}Z8.WalletLinkCipher=bSe;var J8={};Object.defineProperty(J8,"__esModule",{value:!0});J8.WalletLinkHTTP=void 0;class _Se{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 s=(e=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}J8.WalletLinkHTTP=_Se;var lg={};Object.defineProperty(lg,"__esModule",{value:!0});lg.WalletLinkWebSocket=lg.ConnectionState=void 0;var _1;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(_1||(lg.ConnectionState=_1={}));class xSe{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(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,_1.CONNECTING),i.onclose=s=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,_1.DISCONNECTED)},i.onopen=s=>{var o;e(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,_1.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},i.onmessage=s=>{var o,a;if(s.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(s.data);(a=this.incomingDataListener)===null||a===void 0||a.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,_1.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)}}lg.WalletLinkWebSocket=xSe;Object.defineProperty(Y8,"__esModule",{value:!0});Y8.WalletLinkConnection=void 0;const HL=qc,ESe=Z8,CSe=J8,Ab=lg,Lp=Is,qL=1e4,ASe=6e4;class SSe{constructor({session:e,linkAPIUrl:r,listener:n,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Lp.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=o=>{if(!o)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>o.JsonRpcUrl&&this.handleChainUpdated(l,o.JsonRpcUrl)]]).forEach((l,c)=>{const u=o[c];u!==void 0&&l(u)})},this.handleDestroyed=o=>{var a;o==="1"&&((a=this.listener)===null||a===void 0||a.resetAndReload())},this.handleAccountUpdated=async o=>{var a;{const l=await this.cipher.decrypt(o);(a=this.listener)===null||a===void 0||a.accountUpdated(l)}},this.handleMetadataUpdated=async(o,a)=>{var l;{const c=await this.cipher.decrypt(a);(l=this.listener)===null||l===void 0||l.metadataUpdated(o,c)}},this.handleWalletUsernameUpdated=async o=>{this.handleMetadataUpdated(HL.WALLET_USER_NAME_KEY,o)},this.handleAppVersionUpdated=async o=>{this.handleMetadataUpdated(HL.APP_VERSION_KEY,o)},this.handleChainUpdated=async(o,a)=>{var l;{const c=await this.cipher.decrypt(o),u=await this.cipher.decrypt(a);(l=this.listener)===null||l===void 0||l.chainUpdated(c,u)}},this.session=e,this.cipher=new ESe.WalletLinkCipher(e.secret),this.listener=n;const s=new Ab.WalletLinkWebSocket(`${r}/rpc`,i);s.setConnectionStateListener(async o=>{let a=!1;switch(o){case Ab.ConnectionState.DISCONNECTED:if(!this.destroyed){const l=async()=>{await new Promise(c=>setTimeout(c,5e3)),this.destroyed||s.connect().catch(()=>{l()})};l()}break;case Ab.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),a=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},qL),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Ab.ConnectionState.CONNECTING:break}this.connected!==a&&(this.connected=a)}),s.setIncomingDataListener(o=>{var a;switch(o.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const l=o.type==="IsLinkedOK"?o.linked:void 0;this.linked=l||o.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(o.metadata);break}case"Event":{this.handleIncomingEvent(o);break}}o.id!==void 0&&((a=this.requestResolutions.get(o.id))===null||a===void 0||a(o))}),this.ws=s,this.http=new CSe.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,Lp.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"}))),s={type:"PublishEvent",id:(0,Lp.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(s);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>qL*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=ASe){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,o)=>{i=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,o=>{clearTimeout(i),s(o),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,Lp.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,Lp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,Lp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}Y8.WalletLinkConnection=SSe;var Q8={},AQ={exports:{}},SQ=Xf.Buffer;function X8(t,e){this._block=SQ.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}X8.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=SQ.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o=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 s=this._hash();return t?s.toString(t):s};X8.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Kg=X8,ISe=io,IQ=Kg,TSe=Xf.Buffer,$Se=[1518500249,1859775393,-1894007588,-899497514],kSe=new Array(80);function Qv(){this.init(),this._w=kSe,IQ.call(this,64,56)}ISe(Qv,IQ);Qv.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function NSe(t){return t<<5|t>>>27}function PSe(t){return t<<30|t>>>2}function RSe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Qv.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var l=0;l<80;++l){var c=~~(l/20),u=NSe(r)+RSe(c,n,i,s)+o+e[l]+$Se[c]|0;o=s,s=i,i=PSe(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=s+this._d|0,this._e=o+this._e|0};Qv.prototype._hash=function(){var t=TSe.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 MSe=Qv,OSe=io,TQ=Kg,jSe=Xf.Buffer,DSe=[1518500249,1859775393,-1894007588,-899497514],LSe=new Array(80);function Xv(){this.init(),this._w=LSe,TQ.call(this,64,56)}OSe(Xv,TQ);Xv.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function FSe(t){return t<<1|t>>>31}function USe(t){return t<<5|t>>>27}function BSe(t){return t<<30|t>>>2}function WSe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Xv.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=FSe(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=USe(r)+WSe(c,n,i,s)+o+e[l]+DSe[c]|0;o=s,s=i,i=BSe(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=s+this._d|0,this._e=o+this._e|0};Xv.prototype._hash=function(){var t=jSe.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 zSe=Xv,HSe=io,$Q=Kg,qSe=Xf.Buffer,VSe=[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],GSe=new Array(64);function ew(){this.init(),this._w=GSe,$Q.call(this,64,56)}HSe(ew,$Q);ew.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 KSe(t,e,r){return r^t&(e^r)}function YSe(t,e,r){return t&e|r&(t|e)}function ZSe(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function JSe(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function QSe(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function XSe(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}ew.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=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]=XSe(e[u-2])+e[u-7]+QSe(e[u-15])+e[u-16]|0;for(var f=0;f<64;++f){var h=c+JSe(o)+KSe(o,a,l)+VSe[f]+e[f]|0,g=ZSe(r)+YSe(r,n,i)|0;c=l,l=a,a=o,o=s+h|0,s=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=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=l+this._g|0,this._h=c+this._h|0};ew.prototype._hash=function(){var t=qSe.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 kQ=ew,eIe=io,tIe=kQ,rIe=Kg,nIe=Xf.Buffer,iIe=new Array(64);function e_(){this.init(),this._w=iIe,rIe.call(this,64,56)}eIe(e_,tIe);e_.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};e_.prototype._hash=function(){var t=nIe.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 sIe=e_,oIe=io,NQ=Kg,aIe=Xf.Buffer,VL=[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],lIe=new Array(160);function tw(){this.init(),this._w=lIe,NQ.call(this,128,112)}oIe(tw,NQ);tw.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 GL(t,e,r){return r^t&(e^r)}function KL(t,e,r){return t&e|r&(t|e)}function YL(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function ZL(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function cIe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function uIe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function dIe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function fIe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Ni(t,e){return t>>>0>>0?1:0}tw.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=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,E=this._gl|0,v=this._hl|0,_=0;_<32;_+=2)e[_]=t.readInt32BE(_*4),e[_+1]=t.readInt32BE(_*4+4);for(;_<160;_+=2){var A=e[_-30],C=e[_-15*2+1],R=cIe(A,C),B=uIe(C,A);A=e[_-2*2],C=e[_-2*2+1];var S=dIe(A,C),U=fIe(C,A),G=e[_-7*2],oe=e[_-7*2+1],K=e[_-16*2],N=e[_-16*2+1],k=B+oe|0,b=R+G+Ni(k,B)|0;k=k+U|0,b=b+S+Ni(k,U)|0,k=k+N|0,b=b+K+Ni(k,N)|0,e[_]=b,e[_+1]=k}for(var x=0;x<160;x+=2){b=e[x],k=e[x+1];var P=KL(r,n,i),L=KL(u,f,h),O=YL(r,u),j=YL(u,r),I=ZL(o,m),D=ZL(m,o),M=VL[x],X=VL[x+1],le=GL(o,a,l),H=GL(m,w,E),ee=v+D|0,Z=c+I+Ni(ee,v)|0;ee=ee+H|0,Z=Z+le+Ni(ee,H)|0,ee=ee+X|0,Z=Z+M+Ni(ee,X)|0,ee=ee+k|0,Z=Z+b+Ni(ee,k)|0;var te=j+L|0,re=O+P+Ni(te,j)|0;c=l,v=E,l=a,E=w,a=o,w=m,m=g+ee|0,o=s+Z+Ni(m,g)|0,s=i,g=h,i=n,h=f,n=r,f=u,u=ee+te|0,r=Z+re+Ni(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+E|0,this._hl=this._hl+v|0,this._ah=this._ah+r+Ni(this._al,u)|0,this._bh=this._bh+n+Ni(this._bl,f)|0,this._ch=this._ch+i+Ni(this._cl,h)|0,this._dh=this._dh+s+Ni(this._dl,g)|0,this._eh=this._eh+o+Ni(this._el,m)|0,this._fh=this._fh+a+Ni(this._fl,w)|0,this._gh=this._gh+l+Ni(this._gl,E)|0,this._hh=this._hh+c+Ni(this._hl,v)|0};tw.prototype._hash=function(){var t=aIe.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 PQ=tw,hIe=io,pIe=PQ,gIe=Kg,mIe=Xf.Buffer,yIe=new Array(160);function t_(){this.init(),this._w=yIe,gIe.call(this,128,112)}hIe(t_,pIe);t_.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};t_.prototype._hash=function(){var t=mIe.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 vIe=t_,Y0=AQ.exports=function(e){e=e.toLowerCase();var r=Y0[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};Y0.sha=MSe;Y0.sha1=zSe;Y0.sha224=sIe;Y0.sha256=kQ;Y0.sha384=vIe;Y0.sha512=PQ;var wIe=AQ.exports;Object.defineProperty(Q8,"__esModule",{value:!0});Q8.WalletLinkSession=void 0;const bIe=wIe,JL=Yt,QL="session:id",XL="session:secret",eF="session:linked";class jk{constructor(e,r,n,i){this._storage=e,this._id=r||(0,JL.randomBytesHex)(16),this._secret=n||(0,JL.randomBytesHex)(32),this._key=new bIe.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(QL),n=e.getItem(eF),i=e.getItem(XL);return r&&i?new jk(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(QL,this._id),this._storage.setItem(XL,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(eF,this._linked?"1":"0")}}Q8.WalletLinkSession=jk;var da={};Object.defineProperty(da,"__esModule",{value:!0});da.isDarkMode=da.isMobileWeb=da.getLocation=da.createQrUrl=void 0;function _Ie(t,e,r,n,i,s){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:t,secret:e,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${a}`}da.createQrUrl=_Ie;function xIe(){try{return window.frameElement!==null}catch{return!1}}function EIe(){try{return xIe()&&window.top?window.top.location:window.location}catch{return window.location}}da.getLocation=EIe;function CIe(){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)}da.isMobileWeb=CIe;function AIe(){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}da.isDarkMode=AIe;var r_={},rw={},Dk={};Object.defineProperty(Dk,"__esModule",{value:!0});Dk.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 SIe=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rw,"__esModule",{value:!0});rw.injectCssReset=void 0;const IIe=SIe(Dk);function TIe(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(IIe.default)),document.documentElement.appendChild(t)}rw.injectCssReset=TIe;var Lk={};function RQ(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&&(o.children=arguments.length>3?nw.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return Gy(t,o,n,i,null)}function Gy(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++OQ,__i:-1,__u:0};return i==null&&Cn.vnode!=null&&Cn.vnode(s),s}function NIe(){return{current:null}}function iw(t){return t.children}function Ky(t,e){this.props=t,this.context=e}function cg(t,e){if(e==null)return t.__?cg(t.__,t.__i+1):null;for(var r;ee&&Lh.sort(ZS));D6.__r=0}function WQ(t,e,r,n,i,s,o,a,l,c,u){var f,h,g,m,w,E,v=n&&n.__k||UQ,_=e.length;for(l=PIe(r,e,v,l,_),f=0;f<_;f++)(g=r.__k[f])!=null&&(h=g.__i===-1?tv:v[g.__i]||tv,g.__i=f,E=Bk(t,g,h,i,s,o,a,l,c,u),m=g.__e,g.ref&&h.ref!=g.ref&&(h.ref&&Wk(h.ref,null,g),u.push(g.ref,g.__c||m,g)),w==null&&m!=null&&(w=m),4&g.__u||h.__k===g.__k?l=zQ(g,l,t):typeof g.type=="function"&&E!==void 0?l=E:m&&(l=m.nextSibling),g.__u&=-7);return r.__e=w,l}function PIe(t,e,r,n,i){var s,o,a,l,c,u=r.length,f=u,h=0;for(t.__k=new Array(i),s=0;s0?Gy(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,a=null,(c=o.__i=RIe(o,r,l,f))!==-1&&(f--,(a=r[c])&&(a.__u|=2)),a==null||a.__v===null?(c==-1&&h--,typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,o.__u|=4))):t.__k[s]=null;if(f)for(s=0;s(l!=null&&!(2&l.__u)?1:0))for(i=r-1,s=r+1;i>=0||s=0){if((l=e[i])&&!(2&l.__u)&&o==l.key&&a===l.type)return i;i--}if(s2&&(a.children=arguments.length>3?nw.call(arguments,2):r),Gy(t.type,a,n||t.key,i||t.ref,null)}function DIe(t,e){var r={__c:e="__cC"+FQ++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=new Set,(s={})[e]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.forEach(function(a){a.__e=!0,eI(a)})},this.sub=function(o){i.add(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i&&i.delete(o),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}nw=UQ.slice,Cn={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},OQ=0,jQ=function(t){return t!=null&&t.constructor==null},Ky.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=rd({},this.state),typeof t=="function"&&(t=t(rd({},r),this.props)),t&&rd(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),eI(this))},Ky.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),eI(this))},Ky.prototype.render=iw,Lh=[],DQ=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ZS=function(t,e){return t.__v.__b-e.__v.__b},D6.__r=0,LQ=/(PointerCapture)$|Capture$/i,Fk=0,JS=iF(!1),QS=iF(!0),FQ=0;const LIe=Object.freeze(Object.defineProperty({__proto__:null,Component:Ky,Fragment:iw,cloneElement:jIe,createContext:DIe,createElement:XS,createRef:NIe,h:XS,hydrate:KQ,get isValidElement(){return jQ},get options(){return Cn},render:GQ,toChildArray:HQ},Symbol.toStringTag,{value:"Module"})),YQ=qf(LIe);var xd,yn,xE,sF,ug=0,ZQ=[],Hn=Cn,oF=Hn.__b,aF=Hn.__r,lF=Hn.diffed,cF=Hn.__c,uF=Hn.unmount,dF=Hn.__;function Z0(t,e){Hn.__h&&Hn.__h(yn,t,ug||e),ug=0;var r=yn.__H||(yn.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function JQ(t){return ug=1,QQ(eX,t)}function QQ(t,e,r){var n=Z0(xd++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):eX(void 0,e),function(a){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,a);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=yn,!yn.u)){var i=function(a,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!s||s.call(this,a,l,c);var f=n.__c.props!==a;return u.forEach(function(h){if(h.__N){var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(f=!0)}}),s&&s.call(this,a,l,c)||f};yn.u=!0;var s=yn.shouldComponentUpdate,o=yn.componentWillUpdate;yn.componentWillUpdate=function(a,l,c){if(this.__e){var u=s;s=void 0,i(a,l,c),s=u}o&&o.call(this,a,l,c)},yn.shouldComponentUpdate=i}return n.__N||n.__}function FIe(t,e){var r=Z0(xd++,3);!Hn.__s&&Hk(r.__H,e)&&(r.__=t,r.i=e,yn.__H.__h.push(r))}function XQ(t,e){var r=Z0(xd++,4);!Hn.__s&&Hk(r.__H,e)&&(r.__=t,r.i=e,yn.__h.push(r))}function UIe(t){return ug=5,zk(function(){return{current:t}},[])}function BIe(t,e,r){ug=6,XQ(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 zk(t,e){var r=Z0(xd++,7);return Hk(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function WIe(t,e){return ug=8,zk(function(){return t},e)}function zIe(t){var e=yn.context[t.__c],r=Z0(xd++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(yn)),e.props.value):t.__}function HIe(t,e){Hn.useDebugValue&&Hn.useDebugValue(e?e(t):t)}function qIe(t){var e=Z0(xd++,10),r=JQ();return e.__=t,yn.componentDidCatch||(yn.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function VIe(){var t=Z0(xd++,11);if(!t.__){for(var e=yn.__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 GIe(){for(var t;t=ZQ.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(E5),t.__H.__h.forEach(tI),t.__H.__h=[]}catch(e){t.__H.__h=[],Hn.__e(e,t.__v)}}Hn.__b=function(t){yn=null,oF&&oF(t)},Hn.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),dF&&dF(t,e)},Hn.__r=function(t){aF&&aF(t),xd=0;var e=(yn=t.__c).__H;e&&(xE===yn?(e.__h=[],yn.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(E5),e.__h.forEach(tI),e.__h=[],xd=0)),xE=yn},Hn.diffed=function(t){lF&&lF(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ZQ.push(e)!==1&&sF===Hn.requestAnimationFrame||((sF=Hn.requestAnimationFrame)||KIe)(GIe)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),xE=yn=null},Hn.__c=function(t,e){e.some(function(r){try{r.__h.forEach(E5),r.__h=r.__h.filter(function(n){return!n.__||tI(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Hn.__e(n,r.__v)}}),cF&&cF(t,e)},Hn.unmount=function(t){uF&&uF(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{E5(n)}catch(i){e=i}}),r.__H=void 0,e&&Hn.__e(e,r.__v))};var fF=typeof requestAnimationFrame=="function";function KIe(t){var e,r=function(){clearTimeout(n),fF&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);fF&&(e=requestAnimationFrame(r))}function E5(t){var e=yn,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),yn=e}function tI(t){var e=yn;t.__c=t.__(),yn=e}function Hk(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function eX(t,e){return typeof e=="function"?e(t):e}const YIe=Object.freeze(Object.defineProperty({__proto__:null,useCallback:WIe,useContext:zIe,useDebugValue:HIe,useEffect:FIe,useErrorBoundary:qIe,useId:VIe,useImperativeHandle:BIe,useLayoutEffect:XQ,useMemo:zk,useReducer:QQ,useRef:UIe,useState:JQ},Symbol.toStringTag,{value:"Module"})),ZIe=qf(YIe);var qk={};Object.defineProperty(qk,"__esModule",{value:!0});qk.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(MQ),n=YQ,i=ZIe,s=da,o=e(qk),a="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,s.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,o.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},h.children));t.SnackbarContainer=u;const f=({autoExpand:h,message:g,menuItems:m})=>{const[w,E]=(0,i.useState)(!0),[v,_]=(0,i.useState)(h??!1);(0,i.useEffect)(()=>{const C=[window.setTimeout(()=>{E(!1)},1),window.setTimeout(()=>{_(!0)},1e4)];return()=>{C.forEach(window.clearTimeout)}});const A=()=>{_(!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:a,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((C,R)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:C.onClick,key:R},(0,n.h)("svg",{width:C.svgWidth,height:C.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":C.defaultFillRule,"clip-rule":C.defaultClipRule,d:C.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},C.info)))))};t.SnackbarInstance=f})(Lk);Object.defineProperty(r_,"__esModule",{value:!0});r_.WalletLinkRelayUI=void 0;const JIe=rw,QIe=Lk;class XIe{constructor(){this.attached=!1,this.snackbar=new QIe.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,JIe.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)}}r_.WalletLinkRelayUI=XIe;var i_={},s_={},Vk={};Object.defineProperty(Vk,"__esModule",{value:!0});Vk.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 tX=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(s_,"__esModule",{value:!0});s_.RedirectDialog=void 0;const eTe=tX(MQ),$c=YQ,tTe=rw,rTe=Lk,nTe=da,iTe=tX(Vk);class sTe{constructor(){this.root=null,this.darkMode=(0,nTe.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,tTe.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,$c.render)(null,this.root),e&&(0,$c.render)((0,$c.h)(oTe,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}s_.RedirectDialog=sTe;const oTe=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,$c.h)(rTe.SnackbarContainer,{darkMode:r},(0,$c.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,$c.h)("style",null,iTe.default),(0,$c.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,$c.h)("div",{class:(0,eTe.default)("-cbwsdk-redirect-dialog-box",s)},(0,$c.h)("p",null,t),(0,$c.h)("button",{onClick:n},e))))};var Vc={};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.CBW_MOBILE_DEEPLINK_URL=Vc.WALLETLINK_URL=Vc.CB_KEYS_URL=void 0;Vc.CB_KEYS_URL="https://keys.coinbase.com/connect";Vc.WALLETLINK_URL="https://www.walletlink.org";Vc.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(i_,"__esModule",{value:!0});i_.WLMobileRelayUI=void 0;const aTe=s_,lTe=da,cTe=Vc;class uTe{constructor(){this.attached=!1,this.redirectDialog=new aTe.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(cTe.CBW_MOBILE_DEEPLINK_URL);r.searchParams.append("redirect_url",(0,lTe.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()}}}i_.WLMobileRelayUI=uTe;Object.defineProperty(K8,"__esModule",{value:!0});K8.WalletLinkRelay=void 0;const dTe=Y8,fTe=qc,hTe=Jv,EE=Q8,Fp=Vg,pTe=da,gTe=r_,hF=i_,mTe=uu,oi=Yt,yTe=du;class Ku{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,pTe.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=s=>{this.isLinked=s;const o=this.storage.getItem(fTe.LOCAL_STORAGE_ADDRESSES_KEY);if(s&&(this._session.linked=s),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),l=this.storage.getItem("IsStandaloneSigning")==="true";a[0]!==""&&!s&&this._session.linked&&!l&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(s,o)=>{this.storage.setItem(s,o)},this.chainUpdated=(s,o)=>{this.chainCallbackParams.chainId===s&&this.chainCallbackParams.jsonRpcUrl===o||(this.chainCallbackParams={chainId:s,jsonRpcUrl:o},this.chainCallback&&this.chainCallback(s,o))},this.accountUpdated=s=>{this.accountsCallback&&this.accountsCallback([s]),Ku.accountRequestCallbackIds.size>0&&(Array.from(Ku.accountRequestCallbackIds.values()).forEach(o=>{const a={type:"WEB3_RESPONSE",id:o,response:{method:"requestEthereumAccounts",result:[s]}};this.invokeCallback(Object.assign(Object.assign({},a),{id:o}))}),Ku.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 hTe.RelayEventManager,this.ui=n}subscribe(){const e=EE.WalletLinkSession.load(this.storage)||new EE.WalletLinkSession(this.storage).save(),{linkAPIUrl:r}=this,n=new dTe.WalletLinkConnection({session:e,linkAPIUrl:r,listener:this}),i=this.isMobileWeb?new hF.WLMobileRelayUI:new gTe.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=EE.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&yTe.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,oi.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,oi.hexStringFromBuffer)(e,!0),signature:(0,oi.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,oi.bigIntStringFromBigInt)(e.weiValue),data:(0,oi.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,oi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,oi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,oi.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,oi.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,oi.bigIntStringFromBigInt)(e.weiValue),data:(0,oi.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,oi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,oi.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,oi.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,oi.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,oi.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,oi.randomBytesHex)(8),i=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s),r==null||r()};return new Promise((s,o)=>{r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,a=>{if(r==null||r(),(0,Fp.isErrorResponse)(a))return o(new Error(a.errorMessage));s(a)}),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 hF.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"){Ku.accountRequestCallbackIds.forEach(n=>this.invokeCallback(Object.assign(Object.assign({},e),{id:n}))),Ku.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n){var i;const s=(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:s}})}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,oi.randomBytesHex)(8);return new Promise((n,i)=>{this.relayEventManager.callbacks.set(r,s=>{if((0,Fp.isErrorResponse)(s))return i(new Error(s.errorMessage));n(s)}),Ku.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,e)})}watchAsset(e,r,n,i,s,o){const a={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let l=null;const c=(0,oi.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.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,Fp.isErrorResponse)(g))return h(new Error(g.errorMessage));f(g)}),this.publishWeb3RequestEvent(c,a)})}addEthereumChain(e,r,n,i,s,o){const a={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let l=null;const c=(0,oi.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.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,Fp.isErrorResponse)(g))return h(new Error(g.errorMessage));f(g)}),this.publishWeb3RequestEvent(c,a)})}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,oi.randomBytesHex)(8);return new Promise((s,o)=>{this.relayEventManager.callbacks.set(i,a=>{if((0,Fp.isErrorResponse)(a)&&a.errorCode)return o(mTe.standardErrors.provider.custom({code:a.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,Fp.isErrorResponse)(a))return o(new Error(a.errorMessage));s(a)}),this.publishWeb3RequestEvent(i,n)})}}K8.WalletLinkRelay=Ku;Ku.accountRequestCallbackIds=new Set;var vTe=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W8,"__esModule",{value:!0});W8.WalletLinkSigner=void 0;const CE=vTe(mSe),pF=qc,wTe=Jv,ku=Vg,bTe=K8,gF=Vc,Pi=uu,Wr=Yt,_Te=du,AE="DefaultChainId",mF="DefaultJsonRpcUrl";class xTe{constructor(e){var r,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:i,appLogoUrl:s}=e.metadata;this._appName=i,this._appLogoUrl=s,this._storage=new _Te.ScopedLocalStorage("walletlink",gF.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new wTe.RelayEventManager,this._jsonRpcUrlFromOpts="";const o=this._storage.getItem(pF.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const l=o.split(" ");l[0]!==""&&(this._addresses=l.map(c=>(0,Wr.ensureAddressString)(c)),(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(AE)&&((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(mF))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(mF,e)}updateProviderInfo(e,r){var n;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(AE,r.toString(10)),((0,Wr.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,s,o){const l=await this.initializeRelay().watchAsset(e,r,n,i,s,o==null?void 0:o.toString());return(0,ku.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(e,r,n,i,s,o){var a,l;if((0,Wr.ensureIntNumber)(e)===this.getChainId())return!1;const c=this.initializeRelay();this._isAuthorized()||await c.requestEthereumAccounts();const u=await c.addEthereumChain(e.toString(),r,s,n,i,o);return(0,ku.isErrorResponse)(u)?!1:(((a=u.result)===null||a===void 0?void 0:a.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===Pi.standardErrorCodes.provider.unsupportedChain?Pi.standardErrors.provider.unsupportedChain():Pi.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 Pi.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 Pi.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 Pi.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}_setAddresses(e,r){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(s=>(0,Wr.ensureAddressString)(s));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(pF.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,Wr.ensureAddressString)(e);return this._addresses.map(i=>(0,Wr.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,Wr.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,Wr.ensureAddressString)(e.to):null,i=e.value!=null?(0,Wr.ensureBigInt)(e.value):BigInt(0),s=e.data?(0,Wr.ensureBuffer)(e.data):Buffer.alloc(0),o=e.nonce!=null?(0,Wr.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,Wr.ensureBigInt)(e.gasPrice):null,l=e.maxFeePerGas!=null?(0,Wr.ensureBigInt)(e.maxFeePerGas):null,c=e.maxPriorityFeePerGas!=null?(0,Wr.ensureBigInt)(e.maxPriorityFeePerGas):null,u=e.gas!=null?(0,Wr.ensureBigInt)(e.gas):null,f=e.chainId?(0,Wr.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:l,maxPriorityFeePerGas:c,gasLimit:u,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Pi.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Pi.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const o=await this.initializeRelay().signEthereumMessage(e,r,n,i);if((0,ku.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?Pi.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){const s=await this.initializeRelay().ethereumAddressFromSignedMessage(e,r,n);if((0,ku.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,Wr.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(AE);if(!e)return(0,Wr.ensureIntNumber)(1);const r=parseInt(e,10);return(0,Wr.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)?Pi.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,Wr.ensureAddressString)(e[0]),n=(0,Wr.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,Wr.ensureBuffer)(e[0]),n=(0,Wr.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,Wr.ensureBuffer)(e[0]),n=(0,Wr.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,Wr.ensureBuffer)(e[0]),n=(0,Wr.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)?Pi.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,Wr.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)?Pi.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,Wr.ensureParsedJSONObject)(e[0]),n=(0,Wr.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=CE.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,Wr.ensureAddressString)(e[0]),n=(0,Wr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=CE.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,Wr.ensureAddressString)(e[0]),n=(0,Wr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=CE.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _wallet_addEthereumChain(e){var r,n,i,s;const o=e[0];if(((r=o.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(!o.chainName||o.chainName.trim()==="")throw Pi.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw Pi.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.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 Pi.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw Pi.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw Pi.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw Pi.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,o,n)}}initializeRelay(){if(!this._relay){const e=new bTe.WalletLinkRelay({linkAPIUrl:gF.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}}W8.WalletLinkSigner=xTe;var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0});Ya.checkErrorForInvalidRequestArgs=Ya.getCoinbaseInjectedProvider=Ya.getCoinbaseInjectedSigner=Ya.fetchRPCRequest=void 0;const ETe=V0,C5=uu;async function CTe(t,e){if(!e.rpcUrl)throw C5.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":ETe.LIB_VERSION}})).json()).result}Ya.fetchRPCRequest=CTe;function rX(){return globalThis.coinbaseWalletSigner}Ya.getCoinbaseInjectedSigner=rX;function ATe({metadata:t,preference:e}){var r,n,i;const s=globalThis;if(e.options!=="smartWalletOnly"){if(rX())return;const l=s.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 o=(n=s.ethereum)!==null&&n!==void 0?n:(i=s.top)===null||i===void 0?void 0:i.ethereum;if(o!=null&&o.isCoinbaseBrowser)return o}Ya.getCoinbaseInjectedProvider=ATe;function STe(t){if(!t||typeof t!="object"||Array.isArray(t))return C5.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 C5.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 C5.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t})}Ya.checkErrorForInvalidRequestArgs=STe;Object.defineProperty(Fc,"__esModule",{value:!0});Fc.createSigner=Fc.fetchSignerType=Fc.storeSignerType=Fc.loadSignerType=void 0;const ITe=F8,nX=W8,TTe=uu,$Te=Ya,kTe=du,iX="SignerType",sX=new kTe.ScopedLocalStorage("CBWSDK","SignerConfigurator");function NTe(){return sX.getItem(iX)}Fc.loadSignerType=NTe;function PTe(t){sX.setItem(iX,t)}Fc.storeSignerType=PTe;async function RTe(t){const{communicator:e,metadata:r}=t;OTe(e,r).catch(()=>{});const n={id:crypto.randomUUID(),event:"selectSignerType",data:t.preference},{data:i}=await e.postRequestAndWaitForResponse(n);return i}Fc.fetchSignerType=RTe;function MTe(t){const{signerType:e,metadata:r,communicator:n,updateListener:i}=t;switch(e){case"scw":return new ITe.SCWSigner({metadata:r,updateListener:i,communicator:n});case"walletlink":return new nX.WalletLinkSigner({metadata:r,updateListener:i});case"extension":{const s=(0,$Te.getCoinbaseInjectedSigner)();if(!s)throw TTe.standardErrors.rpc.internal("injected signer not found");return s}}}Fc.createSigner=MTe;async function OTe(t,e){await t.onMessage(({event:n})=>n==="WalletLinkSessionRequest");const r=new nX.WalletLinkSigner({metadata:e});t.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var o_={},dg={};Object.defineProperty(dg,"__esModule",{value:!0});dg.closePopup=dg.openPopup=void 0;const jTe=uu,yF=420,vF=540;function DTe(t){const e=(window.innerWidth-yF)/2+window.screenX,r=(window.innerHeight-vF)/2+window.screenY,n=window.open(t,"Smart Wallet",`width=${yF}, height=${vF}, left=${e}, top=${r}`);if(n==null||n.focus(),!n)throw jTe.standardErrors.rpc.internal("Pop up window failed to open");return n}dg.openPopup=DTe;function LTe(t){t&&!t.closed&&t.close()}dg.closePopup=LTe;Object.defineProperty(o_,"__esModule",{value:!0});o_.Communicator=void 0;const FTe=V0,wF=dg,UTe=Vc,bF=uu;class BTe{constructor(e=UTe.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 s=o=>{if(o.origin!==this.url.origin)return;const a=o.data;r(a)&&(n(a),window.removeEventListener("message",s),this.listeners.delete(s))};window.addEventListener("message",s),this.listeners.set(s,{reject:i})}),this.disconnect=()=>{(0,wF.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:r},n)=>{r(bF.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,wF.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:FTe.LIB_VERSION}})}).then(()=>{if(!this.popup)throw bF.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}o_.Communicator=BTe;var a_={};Object.defineProperty(a_,"__esModule",{value:!0});a_.determineMethodCategory=void 0;const _F={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 WTe(t){for(const e in _F){const r=e;if(_F[r].includes(t))return r}}a_.determineMethodCategory=WTe;var zTe=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,Jm.hexStringFromIntNumber)((0,Ib.IntNumber)(this.chain.id))}),this.accounts;const u=await this.requestSignerSelection(),f=this.initSigner(u),h=await f.handshake();return this.signer=f,(0,Tb.storeSignerType)(u),this.emit("connect",{chainId:(0,Jm.hexStringFromIntNumber)((0,Ib.IntNumber)(this.chain.id))}),h}catch(u){throw this.handleUnauthorizedError(u),u}},sign:async c=>{if(!this.connected||!this.signer)throw Up.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,xF.fetchRPCRequest)(c,this.chain),state:c=>{const u=()=>{if(this.connected)return this.accounts;throw Up.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(c.method){case"eth_chainId":return(0,Jm.hexStringFromIntNumber)((0,Ib.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 Up.standardErrors.rpc.methodNotSupported(`Method ${c} is deprecated.`)},unsupported:({method:c})=>{throw Up.standardErrors.rpc.methodNotSupported(`Method ${c} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:c,source:u})=>{(0,Jm.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,Jm.hexStringFromIntNumber)((0,Ib.IntNumber)(c.id))))}},this.metadata=i,this.preference=a,this.communicator=new GTe.Communicator(o),this.chain={id:(n=(r=i.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1};const l=(0,Tb.loadSignerType)();this.signer=l?this.initSigner(l):null}get connected(){return this.accounts.length>0}async request(e){var r;try{const n=(0,xF.checkErrorForInvalidRequestArgs)(e);if(n)throw n;const i=(r=(0,KTe.determineMethodCategory)(e.method))!==null&&r!==void 0?r:"fetch";return this.handlers[i](e)}catch(n){return Promise.reject((0,VTe.serializeError)(n,e.method))}}handleUnauthorizedError(e){e.code===Up.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},YTe.ScopedLocalStorage.clearAll(),this.emit("disconnect",Up.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,Tb.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,Tb.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}O8.CoinbaseWalletProvider=ZTe;Object.defineProperty(X2,"__esModule",{value:!0});X2.CoinbaseWalletSDK=void 0;const JTe=M8,QTe=O8,XTe=du,e$e=V0,t$e=Yt,r$e=Ya;class n$e{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,t$e.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var r;const n={metadata:this.metadata,preference:e};return(r=(0,r$e.getCoinbaseInjectedProvider)(n))!==null&&r!==void 0?r:new QTe.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(e,r=240){return(0,JTe.walletLogo)(e,r)}storeLatestVersion(){new XTe.ScopedLocalStorage("CBWSDK").setItem("VERSION",e$e.LIB_VERSION)}}X2.CoinbaseWalletSDK=n$e;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;const e=X2;t.default=e.CoinbaseWalletSDK;var r=X2;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}})})(kJ);const rI=({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"})]}),i$e="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",eh={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"}}},oX={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},Gk={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"}}},aX={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},$d={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"}}},lX={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},s$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},Kk={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},o$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},a$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"}}},l$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"}}},c$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"}}},u$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"}}},cX={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},d$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},f$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"}}},fu={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"}}},J0={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"}}},uX={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"}}},dX={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},h$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/"}}},fX={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},hX={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"}}},p$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},g$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},L6=[eh,oX,fX,fu,J0,uX,kd,dX,Kk,o$e,a$e,l$e,$d,lX,s$e,f$e,cX,d$e,Gk,aX,hX,g$e,p$e,u$e,h$e,c$e],pX=new Set(L6.map(t=>t.id));let gX=class extends Nn{constructor(){super("Wallet timeout"),this.type="wallet_error"}},mX=class extends Nn{constructor(){super("User rejected connection"),this.type="wallet_error"}};const Q0=t=>{if(t instanceof Nn)return t;if(t!=null&&t.code&&(t!=null&&t.reason)){let e=new Vl(t);return t.code===xs.ACTION_REJECTED&&(e.details=qi.E4001_USER_REJECTED_REQUEST),e}return t!=null&&t.code?new Vl(t):new Nn("Unknown connector error",t)};let r0=class extends Lo{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}},Vl=class extends r0{constructor(e){var n,i,s;super(e.message,e.code,e.data);let r=Object.values(qi).find(o=>o.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:(s=e.message)!=null&&s.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=qi.E32002_WALLET_LOCKED))}};const uf={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 Yu(t){return t.type==="ethereum"}function nI(t,e){if(t.length!==e.length)return!1;for(let r=0;rt.rpcTimeouts&&t.rpcTimeouts[e]||P8;let Vs=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 Nn(`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 Q0(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 gX,i=this.rpcTimeoutDuration)=>new Promise((s,o)=>setTimeout(()=>{o(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 s;(s=this.walletProvider)==null||s.on(i.eventName,i.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=r||P8,this._subscriptions=[]}},F6=class extends Vs{constructor(e){super(e,e.rpcTimeoutDuration)}},iI=class extends Vs{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 Qm(t){return t.chainType==="ethereum"}let Yg=class extends yX{buildConnectedWallet(e,r,n,i){let s=async()=>!!this.wallets.find(o=>Ir(o.address)===Ir(e));return{type:"ethereum",address:Ir(e),chainId:r,meta:n,imported:i,switchChain:async o=>{var h,g,m,w;let a,l;if(!s)throw new Nn("Wallet is not currently connected.");let c=(h=this.wallets.find(E=>Ir(E.address)===Ir(e)))==null?void 0:h.chainId;if(!c)throw new Nn("Unable to determine current chainId.");if(typeof o=="number"?(a=`0x${o.toString(16)}`,l=o):(a=o,l=Number(o)),c===m5(a))return;let u=this.chains.find(E=>E.id===l);if(!u)throw new Nn(`Unsupported chainId: ${o}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})};try{return await f()}catch(E){if(((v,_)=>{var A;return _==="coinbase_wallet"?v.message.includes("addEthereumChain"):v.code===4902||((A=v.message)==null?void 0:A.includes("4902"))})(E,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:a,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=E.message)!=null&&w.includes("wallet_switchEthereumChain"))?new Nn(`Rainbow does not support the chainId ${r}`):E}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:s,getEthereumProvider:async()=>{if(!await s())throw new Nn("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await s())throw new Nn("Wallet is not currently connected.");return new m6(new F6(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await s())throw new Nn("Wallet is not currently connected.");return new iI(this.proxyProvider)},sign:async o=>{if(!await s())throw new Nn("Wallet is not currently connected.");return await this.sign(o)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let r,n=e;try{if(n===void 0){let l=await LS(()=>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],s=Ir(i),o=[];if(this.walletClientType==="privy"){let l=Dt.get(aE(s));this.chains.find(c=>c.id===Number(l))||(Dt.del(aE(s)),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 LS(()=>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 ${vL}`,l),r=vL}let a=m5(r);if(!o.find(l=>Ir(l.address)===s)){let l={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};o.push(this.buildConnectedWallet(Ir(i),a,l,this.connectorType==="embedded_imported"))}nI(o,this.wallets)||(this.wallets=o,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 m6(new F6(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=s=>{s.length===0?this.onDisconnect():this.syncAccounts(s)},this.onChainChanged=s=>{this.wallets.forEach(o=>{o.chainId=m5(s),this.walletClientType==="privy"&&Dt.put(aE(o.address),s)}),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=Yk(i,e),this.connected=!1,this.initialized=!1}},$b,m$e=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],EF=(t,e)=>t.makeWeb3Provider({options:e}),y$e=class extends Yg{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:i$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 Nn("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw Q0(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType=e==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(EF($b,this.connectionOptions))}constructor(e,r,n,i,s,o){if(super("coinbase_wallet",e,r,n),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new Vs(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"),!$b){let a=[r.id].concat(e.map(c=>c.id)),l=this.connectionOptions!=="eoaOnly"?a.filter(c=>!m$e.includes(c)):[];l.length>0&&!l.every(c=>pX.has(c))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${l.join(", ")}`),$b=new kJ.CoinbaseWalletSDK({appName:s,appLogoUrl:o,appChainIds:a})}this.proxyProvider.setWalletProvider(EF($b,this.connectionOptions))}};const vX=({...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 CF=class extends Yg{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:[T6((e==null?void 0:e.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:vX,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:r,defaultChain:n,rpcConfig:i,imported:s,walletIndex:o}){super("privy",r,n,i),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=o,s&&(this.connectorType="embedded_imported"),this.subscribeListeners()}};const v$e=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"],w$e=t=>v$e.includes(t),b$e=({as:t="div",...e},r)=>d.jsx(t,{...e,ref:r}),_$e=T.forwardRef(b$e),x$e="https://challenges.cloudflare.com/turnstile/v0/api.js",U6="cf-turnstile-script",E$e="cf-turnstile",wX="onloadTurnstileCallback",B6=t=>!!document.getElementById(t),C$e=({render:t="explicit",onLoadCallbackName:e=wX,scriptOptions:{nonce:r="",defer:n=!0,async:i=!0,id:s="",appendTo:o,onError:a,crossOrigin:l=""}={}})=>{const c=s||U6;if(B6(c))return;const u=document.createElement("script");if(u.id=c,u.src=`${x$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),a&&(u.onerror=a),(o==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(u)},vc={normal:{width:300,height:65},compact:{width:130,height:120},invisible:{width:0,height:0,overflow:"hidden"},interactionOnly:{width:"fit-content",height:"auto"}};function A$e(t){let e;return t!=="invisible"&&(e=t),e}function S$e(t=U6){const[e,r]=T.useState(!1);return T.useEffect(()=>{const n=()=>{B6(t)&&r(!0)},i=new MutationObserver(n);return i.observe(document,{childList:!0,subtree:!0}),n(),()=>{i.disconnect()}},[t]),e}const bX=T.forwardRef((t,e)=>{const{scriptOptions:r,options:n={},siteKey:i,onWidgetLoad:s,onSuccess:o,onExpire:a,onError:l,onBeforeInteractive:c,onAfterInteractive:u,onUnsupported:f,onLoadScript:h,id:g,style:m,as:w="div",injectScript:E=!0,...v}=t,_=n.size??"normal",[A,C]=T.useState(n.execution==="execute"?vc.invisible:n.appearance==="interaction-only"?vc.interactionOnly:vc[_]),R=T.useRef(null),B=T.useRef(!1),[S,U]=T.useState(),[G,oe]=T.useState(!1),K=g??E$e,N=E?(r==null?void 0:r.id)||`${U6}__${K}`:(r==null?void 0:r.id)||U6,k=S$e(N),b=r!=null&&r.onLoadCallbackName?`${r.onLoadCallbackName}__${K}`:`${wX}__${K}`,x=T.useMemo(()=>({sitekey:i,action:n.action,cData:n.cData,callback:o,"error-callback":l,"expired-callback":a,"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:A$e(_),retry:n.retry??"auto","retry-interval":n.retryInterval??8e3,"refresh-expired":n.refreshExpired??"auto",execution:n.execution??"render",appearance:n.appearance??"always"}),[i,n,o,l,a,_,c,u,f]),P=T.useMemo(()=>JSON.stringify(x),[x]);return T.useImperativeHandle(e,()=>{if(typeof window>"u"||!k)return;const{turnstile:L}=window;return{getResponse(){if(!(L!=null&&L.getResponse)||!S){console.warn("Turnstile has not been loaded");return}return L.getResponse(S)},reset(){if(!(L!=null&&L.reset)||!S){console.warn("Turnstile has not been loaded");return}n.execution==="execute"&&C(vc.invisible);try{L.reset(S)}catch(O){console.warn(`Failed to reset Turnstile widget ${S}`,O)}},remove(){if(!(L!=null&&L.remove)||!S){console.warn("Turnstile has not been loaded");return}U(""),C(vc.invisible),L.remove(S)},render(){if(!(L!=null&&L.render)||!R.current||S){console.warn("Turnstile has not been loaded or widget already rendered");return}const O=L.render(R.current,x);return U(O),n.execution!=="execute"&&C(vc[_]),O},execute(){if(n.execution==="execute"){if(!(L!=null&&L.execute)||!R.current||!S){console.warn("Turnstile has not been loaded or widget has not been rendered");return}L.execute(R.current,x),C(vc[_])}},isExpired(){if(!(L!=null&&L.isExpired)||!S){console.warn("Turnstile has not been loaded");return}return L.isExpired(S)}}},[k,S,n.execution,_,x,R]),T.useEffect(()=>(window[b]=()=>oe(!0),()=>{delete window[b]}),[b]),T.useEffect(()=>{E&&!G&&C$e({onLoadCallbackName:b,scriptOptions:{...r,id:N}})},[E,G,b,r,N]),T.useEffect(()=>{k&&!G&&window.turnstile&&oe(!0)},[G,k]),T.useEffect(()=>{if(!i){console.warn("sitekey was not provided");return}if(!k||!R.current||!G||B.current)return;const L=window.turnstile.render(R.current,x);U(L),B.current=!0},[k,i,x,B,G]),T.useEffect(()=>{if(window.turnstile&&R.current&&S){B6(S)&&window.turnstile.remove(S);const L=window.turnstile.render(R.current,x);U(L),B.current=!0}},[P,i]),T.useEffect(()=>{if(window.turnstile&&S&&B6(S))return s==null||s(S),()=>{window.turnstile.remove(S)}},[S,s]),T.useEffect(()=>{C(n.execution==="execute"?vc.invisible:x.appearance==="interaction-only"?vc.interactionOnly:vc[_])},[n.execution,_,x.appearance]),T.useEffect(()=>{!k||typeof h!="function"||h()},[k,h]),d.jsx(_$e,{ref:R,as:w,id:K,style:{...A,...m},...v})});bX.displayName="Turnstile";const I$e=t=>{let{enabled:e,siteKey:r,appId:n,setError:i,setToken:s,setExecuting:o,ref:a}=Ca(),[,l]=T.useMemo(()=>(r==null?void 0:r.split("t:"))||[],[r]);if(T.useEffect(()=>{var c;return(c=a.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(bX,{...t,ref:a,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"),o(!1)},onSuccess:c=>{var u;(u=t.onSuccess)==null||u.call(t,c),s(c),o(!1)},onExpire:()=>{var c,u;(c=t.onExpire)==null||c.call(t);try{(u=a.current)==null||u.reset(),i(void 0),s(void 0)}catch{i("expired_and_failed_reset")}}})})};var Ns=function(){return Ns=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0?Wi(Zg,--rl):0,pg--,gi===10&&(pg=1,c_--),gi}function Gl(){return gi=rl2||oI(gi)>3?"":" "}function D$e(t,e){for(;--e&&Gl()&&!(gi<48||gi>102||gi>57&&gi<65||gi>70&&gi<97););return d_(t,S5()+(e<6&&n0()==32&&Gl()==32))}function aI(t){for(;Gl();)switch(gi){case t:return rl;case 34:case 39:t!==34&&t!==39&&aI(gi);break;case 40:t===41&&aI(t);break;case 92:Gl();break}return rl}function L$e(t,e){for(;Gl()&&t+gi!==57;)if(t+gi===84&&n0()===47)break;return"/*"+d_(e,rl-1)+"*"+Jk(t===47?t:Gl())}function F$e(t){for(;!oI(n0());)Gl();return d_(t,rl)}function U$e(t){return O$e(I5("",null,null,null,[""],t=M$e(t),0,[0],t))}function I5(t,e,r,n,i,s,o,a,l){for(var c=0,u=0,f=o,h=0,g=0,m=0,w=1,E=1,v=1,_=0,A="",C=i,R=s,B=n,S=A;E;)switch(m=_,_=Gl()){case 40:if(m!=108&&Wi(S,f-1)==58){A5(S+=xr(SE(_),"&","&\f"),"&\f",EX(c?a[c-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:S+=SE(_);break;case 9:case 10:case 13:case 32:S+=j$e(m);break;case 92:S+=D$e(S5()-1,7);continue;case 47:switch(n0()){case 42:case 47:Ey(B$e(L$e(Gl(),S5()),e,r,l),l);break;default:S+="/"}break;case 123*w:a[c++]=kc(S)*v;case 125*w:case 59:case 0:switch(_){case 0:case 125:E=0;case 59+u:v==-1&&(S=xr(S,/\f/g,"")),g>0&&kc(S)-f&&Ey(g>32?IF(S+";",n,r,f-1,l):IF(xr(S," ","")+";",n,r,f-2,l),l);break;case 59:S+=";";default:if(Ey(B=SF(S,e,r,c,u,i,a,A,C=[],R=[],f,s),s),_===123)if(u===0)I5(S,e,B,B,C,s,f,a,R);else switch(h===99&&Wi(S,3)===110?100:h){case 100:case 108:case 109:case 115:I5(t,B,B,n&&Ey(SF(t,B,B,0,0,i,a,A,i,C=[],f,R),R),i,R,f,a,n?C:R);break;default:I5(S,B,B,B,[""],R,0,a,R)}}c=u=g=0,w=v=1,A=S="",f=o;break;case 58:f=1+kc(S),g=m;default:if(w<1){if(_==123)--w;else if(_==125&&w++==0&&R$e()==125)continue}switch(S+=Jk(_),_*w){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(kc(S)-1)*v,v=1;break;case 64:n0()===45&&(S+=SE(Gl())),h=n0(),u=f=kc(A=S+=F$e(S5())),_++;break;case 45:m===45&&kc(S)==2&&(w=0)}}return s}function SF(t,e,r,n,i,s,o,a,l,c,u,f){for(var h=i-1,g=i===0?s:[""],m=AX(g),w=0,E=0,v=0;w0?g[_]+" "+A:xr(A,/&\f/g,g[_])))&&(l[v++]=C);return u_(t,e,r,i===0?l_:a,l,c,u,f)}function B$e(t,e,r,n){return u_(t,e,r,_X,Jk(P$e()),hg(t,2,-2),0,n)}function IF(t,e,r,n,i){return u_(t,e,r,Zk,hg(t,0,n),hg(t,n+1,-1),n,i)}function IX(t,e,r){switch(k$e(t,e)){case 5103:return en+"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 en+t+t;case 4789:return Yy+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return en+t+Yy+t+kn+t+t;case 5936:switch(Wi(t,e+11)){case 114:return en+t+kn+xr(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return en+t+kn+xr(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return en+t+kn+xr(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return en+t+kn+t+t;case 6165:return en+t+kn+"flex-"+t+t;case 5187:return en+t+xr(t,/(\w+).+(:[^]+)/,en+"box-$1$2"+kn+"flex-$1$2")+t;case 5443:return en+t+kn+"flex-item-"+xr(t,/flex-|-self/g,"")+(Uu(t,/flex-|baseline/)?"":kn+"grid-row-"+xr(t,/flex-|-self/g,""))+t;case 4675:return en+t+kn+"flex-line-pack"+xr(t,/align-content|flex-|-self/g,"")+t;case 5548:return en+t+kn+xr(t,"shrink","negative")+t;case 5292:return en+t+kn+xr(t,"basis","preferred-size")+t;case 6060:return en+"box-"+xr(t,"-grow","")+en+t+kn+xr(t,"grow","positive")+t;case 4554:return en+xr(t,/([^-])(transform)/g,"$1"+en+"$2")+t;case 6187:return xr(xr(xr(t,/(zoom-|grab)/,en+"$1"),/(image-set)/,en+"$1"),t,"")+t;case 5495:case 3959:return xr(t,/(image-set\([^]*)/,en+"$1$`$1");case 4968:return xr(xr(t,/(.+:)(flex-)?(.*)/,en+"box-pack:$3"+kn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+en+t+t;case 4200:if(!Uu(t,/flex-|baseline/))return kn+"grid-column-align"+hg(t,e)+t;break;case 2592:case 3360:return kn+xr(t,"template-","")+t;case 4384:case 3616:return r&&r.some(function(n,i){return e=i,Uu(n.props,/grid-\w+-end/)})?~A5(t+(r=r[e].value),"span",0)?t:kn+xr(t,"-start","")+t+kn+"grid-row-span:"+(~A5(r,"span",0)?Uu(r,/\d+/):+Uu(r,/\d+/)-+Uu(t,/\d+/))+";":kn+xr(t,"-start","")+t;case 4896:case 4128:return r&&r.some(function(n){return Uu(n.props,/grid-\w+-start/)})?t:kn+xr(xr(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return xr(t,/(.+)-inline(.+)/,en+"$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(kc(t)-1-e>6)switch(Wi(t,e+1)){case 109:if(Wi(t,e+4)!==45)break;case 102:return xr(t,/(.+:)(.+)-([^]+)/,"$1"+en+"$2-$3$1"+Yy+(Wi(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~A5(t,"stretch",0)?IX(xr(t,"stretch","fill-available"),e,r)+t:t}break;case 5152:case 5920:return xr(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,i,s,o,a,l,c){return kn+i+":"+s+c+(o?kn+i+"-span:"+(a?l:+l-+s)+c:"")+t});case 4949:if(Wi(t,e+6)===121)return xr(t,":",":"+en)+t;break;case 6444:switch(Wi(t,Wi(t,14)===45?18:11)){case 120:return xr(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+en+(Wi(t,14)===45?"inline-":"")+"box$3$1"+en+"$2$3$1"+kn+"$2box$3")+t;case 100:return xr(t,":",":"+kn)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return xr(t,"scroll-","scroll-snap-")+t}return t}function W6(t,e){for(var r="",n=0;n-1&&!t.return)switch(t.type){case Zk:t.return=IX(t.value,t.length,r);return;case xX:return W6([Qd(t,{value:xr(t.value,"@","@"+en)})],n);case l_:if(t.length)return N$e(r=t.props,function(i){switch(Uu(i,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Bp(Qd(t,{props:[xr(i,/:(read-\w+)/,":"+Yy+"$1")]})),Bp(Qd(t,{props:[i]})),sI(t,{props:AF(r,n)});break;case"::placeholder":Bp(Qd(t,{props:[xr(i,/:(plac\w+)/,":"+en+"input-$1")]})),Bp(Qd(t,{props:[xr(i,/:(plac\w+)/,":"+Yy+"$1")]})),Bp(Qd(t,{props:[xr(i,/:(plac\w+)/,kn+"input-$1")]})),Bp(Qd(t,{props:[i]})),sI(t,{props:AF(r,n)});break}return""})}}var V$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},ra={},gg=typeof process<"u"&&ra!==void 0&&(ra.REACT_APP_SC_ATTR||ra.SC_ATTR)||"data-styled",TX="active",$X="data-styled-version",f_="6.1.13",Qk=`/*!sc*/ -`,z6=typeof window<"u"&&"HTMLElement"in window,G$e=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&ra!==void 0&&ra.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&ra.REACT_APP_SC_DISABLE_SPEEDY!==""?ra.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&ra.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&ra!==void 0&&ra.SC_DISABLE_SPEEDY!==void 0&&ra.SC_DISABLE_SPEEDY!==""&&ra.SC_DISABLE_SPEEDY!=="false"&&ra.SC_DISABLE_SPEEDY),K$e={},h_=Object.freeze([]),mg=Object.freeze({});function kX(t,e,r){return r===void 0&&(r=mg),t.theme!==r.theme&&t.theme||e||r.theme}var NX=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"]),Y$e=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Z$e=/(^-|-$)/g;function TF(t){return t.replace(Y$e,"-").replace(Z$e,"")}var J$e=/(a)(d)/gi,kb=52,$F=function(t){return String.fromCharCode(t+(t>25?39:97))};function lI(t){var e,r="";for(e=Math.abs(t);e>kb;e=e/kb|0)r=$F(e%kb)+r;return($F(e%kb)+r).replace(J$e,"$1-$2")}var IE,PX=5381,x1=function(t,e){for(var r=e.length;r;)t=33*t^e.charCodeAt(--r);return t},RX=function(t){return x1(PX,t)};function Xk(t){return lI(RX(t)>>>0)}function Q$e(t){return t.displayName||t.name||"Component"}function TE(t){return typeof t=="string"&&!0}var MX=typeof Symbol=="function"&&Symbol.for,OX=MX?Symbol.for("react.memo"):60115,X$e=MX?Symbol.for("react.forward_ref"):60112,eke={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},tke={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},jX={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},rke=((IE={})[X$e]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},IE[OX]=jX,IE);function kF(t){return("type"in(e=t)&&e.type.$$typeof)===OX?jX:"$$typeof"in t?rke[t.$$typeof]:eke;var e}var nke=Object.defineProperty,ike=Object.getOwnPropertyNames,NF=Object.getOwnPropertySymbols,ske=Object.getOwnPropertyDescriptor,oke=Object.getPrototypeOf,PF=Object.prototype;function DX(t,e,r){if(typeof e!="string"){if(PF){var n=oke(e);n&&n!==PF&&DX(t,n,r)}var i=ike(e);NF&&(i=i.concat(NF(e)));for(var s=kF(t),o=kF(e),a=0;a0?" Args: ".concat(e.join(", ")):""))}var ake=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,s=i;e>=s;)if((s<<=1)<0)throw sw(16,"".concat(e));this.groupSizes=new Uint32Array(s),this.groupSizes.set(n),this.length=s;for(var o=i;o=this.length||this.groupSizes[e]===0)return r;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),s=i+n,o=i;o=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&&(E+="".concat(v,","))}),l+="".concat(m).concat(w,'{content:"').concat(E,'"}').concat(Qk)},u=0;u0?".".concat(e):h},u=l.slice();u.push(function(h){h.type===l_&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(vke,r).replace(n,c))}),o.prefix&&u.push(q$e),u.push(W$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 E=h.replace(wke,""),v=U$e(m||g?"".concat(m," ").concat(g," { ").concat(E," }"):E);o.namespace&&(v=FX(v,o.namespace));var _=[];return W6(v,z$e(u.concat(H$e(function(A){return _.push(A)})))),_};return f.hash=l.length?l.reduce(function(h,g){return g.name||sw(15),x1(h,g.name)},PX).toString():"",f}var _ke=new V6,uI=bke(),UX=It.createContext({shouldForwardProp:void 0,styleSheet:_ke,stylis:uI});UX.Consumer;It.createContext(void 0);function dI(){return T.useContext(UX)}var BX=function(){function t(e,r){var n=this;this.inject=function(i,s){s===void 0&&(s=uI);var o=n.name+s.hash;i.hasNameForId(n.id,o)||i.insertRules(n.id,o,s(n.rules,o,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=r,tN(this,function(){throw sw(12,String(n.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=uI),this.name+e.hash},t}(),xke=function(t){return t>="A"&&t<="Z"};function OF(t){for(var e="",r=0;r>>0);if(!r.hasNameForId(this.componentId,o)){var a=n(s,".".concat(o),void 0,this.componentId);r.insertRules(this.componentId,o,a)}i=Vh(i,o),this.staticRulesId=o}else{for(var l=x1(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=Vh(i,g)}}return i},t}(),rN=It.createContext(void 0);rN.Consumer;var $E={};function Ake(t,e,r){var n=eN(t),i=t,s=!TE(t),o=e.attrs,a=o===void 0?h_:o,l=e.componentId,c=l===void 0?function(C,R){var B=typeof C!="string"?"sc":TF(C);$E[B]=($E[B]||0)+1;var S="".concat(B,"-").concat(Xk(f_+B+$E[B]));return R?"".concat(R,"-").concat(S):S}(e.displayName,e.parentComponentId):l,u=e.displayName,f=u===void 0?function(C){return TE(C)?"styled.".concat(C):"Styled(".concat(Q$e(C),")")}(t):u,h=e.displayName&&e.componentId?"".concat(TF(e.displayName),"-").concat(e.componentId):e.componentId||c,g=n&&i.attrs?i.attrs.concat(a).filter(Boolean):a,m=e.shouldForwardProp;if(n&&i.shouldForwardProp){var w=i.shouldForwardProp;if(e.shouldForwardProp){var E=e.shouldForwardProp;m=function(C,R){return w(C,R)&&E(C,R)}}else m=w}var v=new Cke(r,h,n?i.componentStyle:void 0);function _(C,R){return function(B,S,U){var G=B.attrs,oe=B.componentStyle,K=B.defaultProps,N=B.foldedComponentIds,k=B.styledComponentId,b=B.target,x=It.useContext(rN),P=dI(),L=B.shouldForwardProp||P.shouldForwardProp,O=kX(S,x,K)||mg,j=function(H,ee,Z){for(var te,re=Ns(Ns({},ee),{className:void 0,theme:Z}),W=0;W2&&V6.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,r,n,i)},t}();function Ike(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 $ke=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"]),LF=t=>$ke.has(t),FF=(t,e,r)=>r.indexOf(t)===e;const kke=({input:t,overrides:e})=>e?e.primary.concat(e.overflow??[]).filter(LF).filter(FF):t?t.filter(LF).filter(FF):Jo.appearance.walletList;function nN(t){let e=t.filter(r=>!pX.has(r.id));return L6.concat(e)}function Nke(t,e){return{...t,rpcUrls:{...t.rpcUrls,privy:{http:[e]}}}}const Pke="https://api.mainnet-beta.solana.com",Rke="https://api.testnet.solana.com",Mke="https://api.devnet.solana.com",hI=792703809,pI="11111111111111111111111111111111",Oke="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function iN(t){return t.includes("testnet")?"testnet":t.includes("devnet")?"devnet":"mainnet-beta"}function jke(t,e){return`https://explorer.solana.com/tx/${t}?cluster=${e}`}function Dke(t,e){return`https://explorer.solana.com/account/${t}?cluster=${e}`}function Lke({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 G6(t){"@babel/helpers - typeof";return G6=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},G6(t)}var Fke=/^\s+/,Uke=/\s+$/;function Mt(t,e){if(t=t||"",e=e||{},t instanceof Mt)return t;if(!(this instanceof Mt))return new Mt(t,e);var r=Bke(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}Mt.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,s,o,a;return r=e.r/255,n=e.g/255,i=e.b/255,r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*o+.0722*a},setAlpha:function(e){return this._a=GX(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=BF(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=BF(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=UF(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=UF(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 WF(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return qke(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(jn(this._r,255)*100)+"%",g:Math.round(jn(this._g,255)*100)+"%",b:Math.round(jn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(jn(this._r,255)*100)+"%, "+Math.round(jn(this._g,255)*100)+"%, "+Math.round(jn(this._b,255)*100)+"%)":"rgba("+Math.round(jn(this._r,255)*100)+"%, "+Math.round(jn(this._g,255)*100)+"%, "+Math.round(jn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:nNe[WF(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+zF(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(e){var s=Mt(e);n="#"+zF(s._r,s._g,s._b,s._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,s=!r&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return s?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 Mt(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(Yke,arguments)},brighten:function(){return this._applyModification(Zke,arguments)},darken:function(){return this._applyModification(Jke,arguments)},desaturate:function(){return this._applyModification(Vke,arguments)},saturate:function(){return this._applyModification(Gke,arguments)},greyscale:function(){return this._applyModification(Kke,arguments)},spin:function(){return this._applyModification(Qke,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(tNe,arguments)},complement:function(){return this._applyCombination(Xke,arguments)},monochromatic:function(){return this._applyCombination(rNe,arguments)},splitcomplement:function(){return this._applyCombination(eNe,arguments)},triad:function(){return this._applyCombination(HF,[3])},tetrad:function(){return this._applyCombination(HF,[4])}};Mt.fromRatio=function(t,e){if(G6(t)=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=Cy(t[n]));t=r}return Mt(t,e)};function Bke(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,s=null,o=!1,a=!1;return typeof t=="string"&&(t=aNe(t)),G6(t)=="object"&&(Nu(t.r)&&Nu(t.g)&&Nu(t.b)?(e=Wke(t.r,t.g,t.b),o=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Nu(t.h)&&Nu(t.s)&&Nu(t.v)?(n=Cy(t.s),i=Cy(t.v),e=Hke(t.h,n,i),o=!0,a="hsv"):Nu(t.h)&&Nu(t.s)&&Nu(t.l)&&(n=Cy(t.s),s=Cy(t.l),e=zke(t.h,n,s),o=!0,a="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=GX(r),{ok:o,format:t.format||a,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 Wke(t,e,r){return{r:jn(t,255)*255,g:jn(e,255)*255,b:jn(r,255)*255}}function UF(t,e,r){t=jn(t,255),e=jn(e,255),r=jn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),s,o,a=(n+i)/2;if(n==i)s=o=0;else{var l=n-i;switch(o=a>.5?l/(2-n-i):l/(n+i),n){case t:s=(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=s=r;else{var a=r<.5?r*(1+e):r+e-r*e,l=2*r-a;n=o(l,a,t+1/3),i=o(l,a,t),s=o(l,a,t-1/3)}return{r:n*255,g:i*255,b:s*255}}function BF(t,e,r){t=jn(t,255),e=jn(e,255),r=jn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),s,o,a=n,l=n-i;if(o=n===0?0:l/n,n==i)s=0;else{switch(n){case t:s=(e-r)/l+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,s.push(Mt(n));return s}function rNe(t,e){e=e||6;for(var r=Mt(t).toHsv(),n=r.h,i=r.s,s=r.v,o=[],a=1/e;e--;)o.push(Mt({h:n,s:i,v:s})),s=(s+a)%1;return o}Mt.mix=function(t,e,r){r=r===0?0:r||50;var n=Mt(t).toRgb(),i=Mt(e).toRgb(),s=r/100,o={r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a};return Mt(o)};Mt.readability=function(t,e){var r=Mt(t),n=Mt(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};Mt.isReadable=function(t,e,r){var n=Mt.readability(t,e),i,s;switch(s=!1,i=lNe(r),i.level+i.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s};Mt.mostReadable=function(t,e,r){var n=null,i=0,s,o,a,l;r=r||{},o=r.includeFallbackColors,a=r.level,l=r.size;for(var c=0;ci&&(i=s,n=Mt(e[c]));return Mt.isReadable(t,n,{level:a,size:l})||!o?n:(r.includeFallbackColors=!1,Mt.mostReadable(t,["#fff","#000"],r))};var gI=Mt.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"},nNe=Mt.hexNames=iNe(gI);function iNe(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function GX(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function jn(t,e){sNe(t)&&(t="100%");var r=oNe(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 p_(t){return Math.min(1,Math.max(0,t))}function Qo(t){return parseInt(t,16)}function sNe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function oNe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Fl(t){return t.length==1?"0"+t:""+t}function Cy(t){return t<=1&&(t=t*100+"%"),t}function KX(t){return Math.round(parseFloat(t)*255).toString(16)}function qF(t){return Qo(t)/255}var Tl=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 Nu(t){return!!Tl.CSS_UNIT.exec(t)}function aNe(t){t=t.replace(Fke,"").replace(Uke,"").toLowerCase();var e=!1;if(gI[t])t=gI[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Tl.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Tl.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Tl.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Tl.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Tl.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Tl.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Tl.hex8.exec(t))?{r:Qo(r[1]),g:Qo(r[2]),b:Qo(r[3]),a:qF(r[4]),format:e?"name":"hex8"}:(r=Tl.hex6.exec(t))?{r:Qo(r[1]),g:Qo(r[2]),b:Qo(r[3]),format:e?"name":"hex"}:(r=Tl.hex4.exec(t))?{r:Qo(r[1]+""+r[1]),g:Qo(r[2]+""+r[2]),b:Qo(r[3]+""+r[3]),a:qF(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=Tl.hex3.exec(t))?{r:Qo(r[1]+""+r[1]),g:Qo(r[2]+""+r[2]),b:Qo(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function lNe(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 VF="#FFFFFF";function cNe(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 vo(t,e){let r=Math.max(0,Math.min(1,t.toHsl().l+e));return Mt({...t.toHsl(),l:r})}function uNe({backgroundTheme:t,accentHex:e}){let r;switch(t){case"light":r=VF;break;case"dark":r="#1E1E1D";break;default:r=t}let n=Mt(r),i=Mt(e),s=Mt("#51BA81"),o=Mt("#FFB74D"),a=Mt("#EC6351"),l=cNe(n.getLuminance()),c=vo(n,l==="light"?-.04:.11),u=vo(n,l==="light"?-.08:.16),f=vo(n,l==="light"?-.88:.87),h=vo(n,l==="light"?-.7:.75),g=vo(n,l==="light"?-.43:.45).desaturate(l==="light"?60:20),m=vo(n,l==="light"?-.08:.25).desaturate(l==="light"?60:20),w=vo(i,.15),E=vo(i,.25),v=vo(i,-.06),_=vo(i,-.6),A=vo(a,.3),C=vo(o,.3),R=Mt(i.getLuminance()>.5?"#040217":VF),B=vo(s,-.16),S=vo(s,.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:E.toHslString(),accentDark:v.toHslString(),accentDarkest:_.toHslString(),foregroundAccent:R.toHslString(),success:s.toHslString(),successDark:B.toHslString(),successLight:S.toHslString(),error:a.toHslString(),errorLight:A.toHslString(),warn:o.toHslString(),warnLight:C.toHslString()}}function YX(t,e,r){var I,D,M,X,le,H,ee,Z,te,re,W,q,J,me,be,Ce,Fe,Ue,Ye,lt,xe,He,Ve,Ie,Ne,Oe,Me,Y,F,z,ie,pe,ve,he,De,Ze,et,it,ut,pt,tr;let n,i,s,o,a,l,c,u,f,h,g,m,w,E,v,_,A=r?console.warn:()=>{};e!=null&&e.loginMethods?(n=e.loginMethods.includes("email"),i=e.loginMethods.includes("sms"),o=e.loginMethods.includes("wallet"),a=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=e.loginMethods.includes("farcaster"),v=e.loginMethods.includes("telegram")):(n=t.emailAuth,i=t.smsAuth,o=t.walletAuth||t.solanaWalletAuth,a=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,E=t.farcasterAuth,v=t.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?s=!1:t.passkeyAuth&&(s=!0);let C=[n,i].filter(Boolean),R=[a,l,c,m,f,h,u,g,w,E,v].filter(Boolean),B=[o].filter(Boolean);if(C.length+R.length+B.length===0)throw Error("You must enable at least one login method");let S=((I=e==null?void 0:e.appearance)==null?void 0:I.showWalletLoginFirst)!==void 0?(D=e==null?void 0:e.appearance)==null?void 0:D.showWalletLoginFirst:t.showWalletLoginFirst;S&&B.length===0?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):S||R.length+C.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0);let U=((X=(M=e==null?void 0:e.externalWallets)==null?void 0:M.walletConnect)==null?void 0:X.enabled)??!0;e!=null&&e.loginMethods&&e.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=kke({input:(le=e==null?void 0:e.appearance)==null?void 0:le.walletList,overrides:e==null?void 0:e.loginMethodsAndOrder}),oe=Tke({input:e==null?void 0:e.loginMethodsAndOrder}),K=((H=e==null?void 0:e.intl)==null?void 0:H.defaultCountry)??"US",{chains:N,defaultChain:k}=fNe({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}),b=!!(e!=null&&e.defaultChain),x=((Z=e==null?void 0:e.customAuth)==null?void 0:Z.getCustomAccessToken)&&((te=e==null?void 0:e.customAuth)==null?void 0:te.enabled)!==!1,P=!(t.enforceWalletUis??1);if(_=t.legacyWalletUiConfig??1?x?((re=e==null?void 0:e.embeddedWallets)==null?void 0:re.noPromptOnSignature)??!0:((W=e==null?void 0:e.embeddedWallets)==null?void 0:W.noPromptOnSignature)??P:P,((q=e==null?void 0:e.embeddedWallets)==null?void 0:q.waitForTransactionConfirmation)===!1&&_!==!0)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:L,...O}=(e==null?void 0:e.embeddedWallets)??{},j=(e==null?void 0:e.solanaClusters)??[];return t.solanaWalletAuth&&!((me=(J=e==null?void 0:e.externalWallets)==null?void 0:J.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)??Jo.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):(Ye=e==null?void 0:e.appearance)==null?void 0:Ye.loginMessage,palette:uNe({backgroundTheme:((lt=e==null?void 0:e.appearance)==null?void 0:lt.theme)??Jo.appearance.theme,accentHex:((xe=e==null?void 0:e.appearance)==null?void 0:xe.accentColor)??t.accentColor??Jo.appearance.accentColor}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!((He=e==null?void 0:e.appearance)!=null&&He.hideDirectWeb2Inputs),walletList:G,walletChainType:((Ve=e==null?void 0:e.appearance)==null?void 0:Ve.walletChainType)??(({evmWalletAuth:Wt,solanaWalletAuth:At})=>Wt&&At?"ethereum-and-solana":Wt?"ethereum-only":At?"solana-only":"ethereum-only")({evmWalletAuth:t.walletAuth??!1,solanaWalletAuth:t.solanaWalletAuth??!1})},loginMethods:{wallet:o,email:n,sms:i,passkey:s,google:a,twitter:l,discord:c,github:m,spotify:f,instagram:h,tiktok:u,linkedin:g,apple:w,farcaster:E,telegram:v},disablePlusEmails:t.disablePlusEmails,loginMethodsAndOrder:oe,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??Jo.walletConnectCloudProjectId,rpcConfig:{rpcUrls:((Oe=e==null?void 0:e.rpcConfig)==null?void 0:Oe.rpcUrls)??Jo.rpcConfig.rpcUrls,rpcTimeouts:((Me=e==null?void 0:e.rpcConfig)==null?void 0:Me.rpcTimeouts)??Jo.rpcConfig.rpcTimeouts},chains:N,solanaClusters:{"mainnet-beta":((Y=j.find(Wt=>Wt.name==="mainnet-beta"))==null?void 0:Y.rpcUrl)||Pke,testnet:((F=j.find(Wt=>Wt.name==="testnet"))==null?void 0:F.rpcUrl)||Rke,devnet:((z=j.find(Wt=>Wt.name==="devnet"))==null?void 0:z.rpcUrl)||Mke},defaultChain:k,intl:{defaultCountry:K},shouldEnforceDefaultChainOnConnect:b,captchaEnabled:t.captchaEnabled??Jo.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)??Jo.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U},solana:{connectors:(he=(ve=e==null?void 0:e.externalWallets)==null?void 0:ve.solana)==null?void 0:he.connectors}},embeddedWallets:{...t.embeddedWalletConfig,...typeof L=="boolean"?{requireUserOwnedRecoveryOnCreate:L}:{},...x?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...O,noPromptOnSignature:_,showWalletUIs:(De=e==null?void 0:e.embeddedWallets)==null?void 0:De.showWalletUIs,extendedCalldataDecoding:(Ze=e==null?void 0:e.embeddedWallets)==null?void 0:Ze.extendedCalldataDecoding},mfa:{methods:t.mfaMethods??[],noPromptOnMfaRequired:((et=e==null?void 0:e.mfa)==null?void 0:et.noPromptOnMfaRequired)??!1},customAuth:x?{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)??Jo._render.standalone},fundingConfig:t.fundingConfig,fundingMethodConfig:{...(e==null?void 0:e.fundingMethodConfig)??Jo.fundingMethodConfig,moonpay:{...((ut=e==null?void 0:e.fundingMethodConfig)==null?void 0:ut.moonpay)??Jo.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)??Jo.fundingMethodConfig.moonpay.useSandbox}}}}function dNe(t,e){var l,c;if(!t)return{legacyCreateEmbeddedWalletFlag:e};let{appearance:r,additionalChains:n,supportedChains:i,defaultChain:s,externalWallets:o,...a}=t;return{...a,...n?{additionalChains:n.map(u=>u.id)}:void 0,...i?{supportedChains:i.map(u=>u.id)}:void 0,...s?{defaultChain:s.id}:void 0,...o?{walletConnect:o.walletConnect,coinbaseWallet:o.coinbaseWallet,solana:{connectors:(c=(l=o.solana)==null?void 0:l.connectors)==null?void 0:c.get().map(u=>u.walletClientType)}}:void 0,legacyCreateEmbeddedWalletFlag:e}}function fNe({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(a=>a.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(a=>{var u;if(a.rpcUrls.privyWalletOverride)return a;let l=L6.find(f=>f.id===a.id),c=(u=l==null?void 0:l.rpcUrls.privy)==null?void 0:u.http[0];return c?Nke(a,c):a})}else i=L6.concat(t??[]);let s=e?i[0]:fu,o=r??s;if(!i.find(a=>a.id===o.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:o}}const hNe=function(t,e=0){let r=3735928559^e,n=1103547991^e;for(let i,s=0;s>>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 ZX={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 JX=YX(ZX,void 0,!1);let sN=T.createContext({appConfig:JX,isServerConfigLoaded:!1});const pNe=({children:t,legacyCreateEmbeddedWalletFlag:e,client:r,clientConfig:n})=>{let[i,s]=T.useState(null),o=T.useMemo(()=>YX(i??ZX,n,!!i),[i,n]);return T.useEffect(()=>{if(!i)return;let a=dNe(n,e),l=hNe(JSON.stringify(a)).toString(),c=`privy:sent:${i.id}:${l}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:a}),localStorage.setItem(c,"t"))},[n,e,i]),T.useEffect(()=>{i||(async()=>{try{let a=await r.getServerConfig();a.customApiUrl&&r.updateApiUrl(a.customApiUrl),s(a)}catch(a){console.warn("Error generating app config: ",a)}})()},[]),d.jsx(sN.Provider,{value:{appConfig:o,isServerConfigLoaded:!!i},children:t})},wi=()=>{let{appConfig:t}=T.useContext(sN);return t},gNe=()=>{let{isServerConfigLoaded:t}=T.useContext(sN);return t},QX=T.createContext({setAuthenticated:je,setUser:je,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:je,initializeWalletProxy:je,getAuthMeta:je,getAuthFlow:je,closePrivyModal:je,openPrivyModal:je,connectWallet:je,initLoginWithWallet:je,loginWithWallet:je,initLoginWithFarcaster:je,loginWithFarcaster:je,loginWithCode:je,initLoginWithEmail:je,initLoginWithSms:je,initUpdateEmail:je,initUpdatePhone:je,resendEmailCode:je,resendSmsCode:je,initLoginWithHeadlessOAuth:je,loginWithHeadlessOAuth:je,crossAppAuthFlow:je,initLoginWithOAuth:je,recoveryOAuthFlow:je,loginWithOAuth:je,passkeyAuthState:{status:"initial"},setPasskeyAuthState:je,initLoginWithPasskey:je,loginWithPasskey:je,initLinkWithPasskey:je,linkWithPasskey:je,refreshUser:je,loginWithGuestAccountFlow:je,walletProxy:null,createAnalyticsEvent:je,acceptTerms:je,getUsdTokenPrice:je,getUsdPriceForSol:je,recoverPrimaryWallet:je,updateWallets:je,fundWallet:je,openModal:je,setReadyToTrue:je,requestFarcasterSignerStatus:je,initLoginWithTelegram:je,loginWithTelegram:je,generateSiweMessage:je,generateSiweMessageForSmartWallet:je,linkWithSiwe:je,linkSmartWallet:je,delegateWallet:je,revokeDelegatedWallets:je,createEmbeddedSolanaWallet:je,exportSolanaWallet:je,solanaSignMessage:je,connectCoinbaseSmartWallet:je,initiateAccountTransfer:je,emailOtpState:{status:"initial"},setEmailOtpState:je,smsOtpState:{status:"initial"},setSmsOtpState:je,siweState:{status:"initial"},setSiweState:je,oAuthState:{status:"initial"},setOAuthState:je,isHeadlessOAuthLoading:!1}),xt=()=>T.useContext(QX);function mNe({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 XX=T.createContext({ready:!1,app:JX,currentScreen:null,lastScreen:null,navigate:je,navigateBack:je,resetNavigation:je,setModalData:je,onUserCloseViaDialogOrKeybindRef:void 0});let yNe=[ye.LANDING,ye.CONNECT_ONLY_LANDING_SCREEN,null];const vNe=t=>{var a;let e=wi(),r=t.authenticated,[n,i]=T.useState(t.initialScreen);T.useEffect(()=>{r||yNe.includes(t.initialScreen)||t.setInitialScreen(null)},[r]);let s=T.useRef(null);T.useEffect(()=>{t.open||(s.current=null)},[t.open]),T.useEffect(()=>{s.current=null},[t.initialScreen]);let o={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:s};return d.jsxs(XX.Provider,{value:o,children:[(typeof e.appearance.logo=="string"||((a=e.appearance.logo)==null?void 0:a.type)==="img")&&d.jsx(mNe,{src:typeof e.appearance.logo=="string"?e.appearance.logo:e.appearance.logo.props.src}),t.children]})},vt=()=>T.useContext(XX),Jg=T.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:je,login:je,connectOrCreateWallet:je,linkEmail:je,linkPhone:je,linkFarcaster:je,linkWallet:je,startCrossAppAuthFlow:je,linkGoogle:je,linkTwitter:je,linkDiscord:je,linkGithub:je,linkSpotify:je,linkInstagram:je,linkTelegram:je,linkTiktok:je,linkLinkedIn:je,linkApple:je,linkPasskey:je,updateEmail:je,updatePhone:je,logout:je,getAccessToken:je,getEthereumProvider:je,getEthersProvider:je,getWeb3jsProvider:je,unlinkEmail:je,unlinkPhone:je,unlinkWallet:je,unlinkGoogle:je,unlinkTwitter:je,unlinkDiscord:je,unlinkGithub:je,unlinkSpotify:je,unlinkInstagram:je,unlinkTiktok:je,unlinkLinkedIn:je,unlinkApple:je,unlinkCrossAppAccount:je,unlinkFarcaster:je,unlinkTelegram:je,unlinkPasskey:je,setActiveWallet:je,forkSession:je,createWallet:je,signMessage:je,signTypedData:je,enrollInMfa:je,initEnrollmentWithSms:je,initEnrollmentWithTotp:je,initEnrollmentWithPasskey:je,promptMfa:je,init:je,submitEnrollmentWithSms:je,submitEnrollmentWithTotp:je,submitEnrollmentWithPasskey:je,unenroll:je,submit:je,cancel:je,sendTransaction:je,sendSolanaTransaction:je,exportWallet:je,setWalletPassword:je,setWalletRecovery:je,requestFarcasterSignerFromWarpcast:je,getFarcasterSignerPublicKey:je,signFarcasterMessage:je,createGuestAccount:je,signMessageWithCrossAppWallet:je,signTypedDataWithCrossAppWallet:je,sendTransactionWithCrossAppWallet:je,isModalOpen:!1,mfaMethods:[]}),Pr=()=>T.useContext(Jg),wNe=t=>{let[e,r]=T.useState("auto");return T.useEffect(()=>{let n=new ResizeObserver(i=>{var s;r(((s=i[0])==null?void 0:s.contentRect.height)??"auto")});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),e},bNe={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:[]}},eee=T.createContext(void 0);let tee=()=>T.useContext(eee);function oN(t,e){if(!e)return;let r=tee().current[t];return T.useEffect(()=>{var n;for(let[i,s]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(s);return()=>{var i;for(let[s,o]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,s)||console.warn(`Invalid event type "${s}" for action "${t}"`),r[s]=(i=r[s])==null?void 0:i.filter(a=>a!==o)}},[e])}function We(t,e,r,...n){for(let i of t.current[e][r])i(...n)}function aN(){let t=tee();return(e,r,...n)=>We(t,e,r,...n)}function _Ne(t){oN("configureMfa",t)}function xNe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 i0=T.forwardRef(xNe),ec=({success:t,fail:e})=>d.jsxs(d.Fragment,{children:[d.jsx(nl,{className:t?"success":e?"fail":""}),d.jsx(lN,{className:t?"success":e?"fail":""})]}),nl=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)"),lN=fe(nl).withConfig({displayName:"LoaderFaint",componentId:"sc-ce7792e2-1"})(["&&{border-bottom-color:",";animation:none;opacity:0.5;}"],t=>t.color??"var(--privy-color-accent)"),th=t=>d.jsx(ENe,{color:t.color||"var(--privy-color-foreground-3)"});let ENe=fe(nl).withConfig({displayName:"StyledButtonLoader",componentId:"sc-ce7792e2-2"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const g_=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;}"]),Lt=({children:t,loading:e,disabled:r,success:n,loadingText:i="Loading...",...s})=>d.jsx(ree,{disabled:e||r,success:n,...s,children:e?d.jsxs("span",{children:[d.jsx(th,{}),i?d.jsx("span",{children:i}):null]}):t}),nv=({children:t,loading:e,disabled:r,...n})=>d.jsx(CNe,{disabled:r,...n,children:e?d.jsx(th,{color:"var(--privy-color-foreground-accent)"}):t});let CNe=fe(g_).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 ANe=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(ree,{as:"a",disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(th,{}),n?d.jsx("span",{children:n}):null]}):t});let ree=fe(g_).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?es(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;pointer-events:none;}"]):"");const Ed=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(SNe,{disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(th,{}),n?d.jsx("span",{children:n}):null]}):t});let SNe=fe(g_).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 cN=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&&es(["pointer-events:none;"])),uN=({children:t,onClick:e,disabled:r,isSubmitting:n,...i})=>d.jsxs(INe,{$isSubmitting:n,onClick:e,disabled:r,...i,children:[d.jsx("span",{children:t}),d.jsx("span",{children:d.jsx(th,{})})]});let INe=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 nee=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 TNe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const $Ne=T.forwardRef(TNe);function kNe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const NNe=T.forwardRef(kNe);function PNe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const RNe=T.forwardRef(PNe),iee=({backFn:t})=>d.jsx("div",{children:d.jsx(m_,{onClick:t,children:d.jsx($Ne,{height:"16px",width:"16px",strokeWidth:2})})}),MNe=({nextFn:t})=>d.jsx("div",{children:d.jsx(m_,{onClick:t,children:d.jsx(NNe,{height:"16px",width:"16px",strokeWidth:2})})}),ONe=({infoFn:t})=>d.jsx("div",{children:d.jsx(DNe,{"aria-label":"info",onClick:t,children:d.jsx(i0,{height:"22px",width:"22px",strokeWidth:2})})}),jNe=t=>d.jsx("div",{children:d.jsx(m_,{"aria-label":"close modal",onClick:t.onClose,children:d.jsx(RNe,{height:"16px",width:"16px",strokeWidth:2})})}),ft=({backFn:t,infoFn:e,onClose:r,title:n,closeable:i=!0})=>{let{closePrivyModal:s}=xt(),o=wi();return d.jsxs(LNe,{children:[d.jsxs(FNe,{children:[t&&d.jsx(iee,{backFn:t}),e&&d.jsx(ONe,{infoFn:e})]}),n&&d.jsx(BNe,{id:"privy-dialog-title",children:n}),d.jsx(UNe,{children:!o.render.standalone&&i&&d.jsx(jNe,{onClose:r||(()=>s())})})]})};let m_=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;}}"]),DNe=fe(m_).withConfig({displayName:"TransparentStyledButton",componentId:"sc-f295093d-1"})(["&&{background-color:transparent;}"]),LNe=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);}"]),FNe=fe.div.withConfig({displayName:"LeftActionContainer",componentId:"sc-f295093d-3"})(["flex:1;align-items:center;display:flex;gap:8px;"]),UNe=fe.div.withConfig({displayName:"RightActionContainer",componentId:"sc-f295093d-4"})(["flex:1;display:flex;justify-content:flex-end;"]),BNe=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);"]),Fo=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 Ff=fe.div.withConfig({displayName:"Grow",componentId:"sc-b51c7c74-0"})(["text-align:left;flex-grow:1;"]),see=fe.div.withConfig({displayName:"AlignBottom",componentId:"sc-b51c7c74-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),Uf=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;}"]),WNe=fe(Uf).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 oee=es(["&&{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 aee=fe.div.withConfig({displayName:"Subtitle",componentId:"sc-b51c7c74-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Vn=fe.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-b51c7c74-5"})(["",""],oee),GF=fe.a.withConfig({displayName:"LoginMethodButtonLink",componentId:"sc-b51c7c74-6"})(["",""],oee),I0=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;":""),zNe=fe.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-b51c7c74-8"})(["width:100%;height:100%;padding:",";"],t=>t.$withPadding?"64px 0px":"0px"),HNe=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;}"]),qNe=()=>{let{navigate:t,app:e}=vt();return d.jsxs(d.Fragment,{children:[d.jsx(ft,{}),d.jsxs(VNe,{children:[d.jsx(Fo,{children:d.jsxs("div",{children:[d.jsx(nee,{color:"var(--privy-color-warn-light)"}),d.jsx(i0,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),d.jsxs(GNe,{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(Ff,{}),d.jsx(Lt,{onClick:()=>t(ye.LANDING),children:"Try logging in again"})]})]})};let VNe=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;"]),GNe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-408d3d00-1"})(["display:flex;flex-direction:column;gap:8px;"]);function KNe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 Nd=T.forwardRef(KNe);function YNe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 ow=T.forwardRef(YNe),dN=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 ZNe(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 KF=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 fN(t){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:r,requireUsersAcceptTerms:n}}=t.app;if(n&&!t.alwaysShowImplicitConsent||!r&&!e)return d.jsx(KF,{});let i=!(!e||!r);return d.jsxs(KF,{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 Jt=()=>d.jsx($r,{children:d.jsx("a",{href:"https://www.privy.io/",target:"_blank",children:d.jsx(ZNe,{height:13,width:150})})}),$r=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 JNe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const QNe=T.forwardRef(JNe);function XNe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 lee=T.forwardRef(XNe),ca=({address:t,showCopyIcon:e,url:r,className:n})=>{let[i,s]=T.useState(!1);return T.useEffect(()=>{if(i){let o=setTimeout(()=>s(!1),2e3);return()=>clearTimeout(o)}},[i]),r?d.jsx("a",{title:t,className:n,href:`${r}/address/${t}`,target:"_blank",children:Ys(t)}):d.jsxs("button",{title:t,className:n,onClick:o=>(o.stopPropagation(),navigator.clipboard.writeText(t).then(()=>s(!0)).catch(console.error)),children:[Ys(t),e&&d.jsx(i?tPe:ePe,{})]})};let ePe=fe(lee).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);"]),tPe=fe(QNe).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 cee(t){return t.charAt(0).toUpperCase()+t.slice(1)}const uee=({onTransfer:t,isTransferring:e,transferSuccess:r})=>d.jsx(Lt,{...r?{success:!0,children:"Success!"}:{warn:!0,loading:e,onClick:t,children:"Transfer and delete account"}});function rPe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 y_=T.forwardRef(rPe),dee=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;"]),mI=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-aa2e65ff-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),fee=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;"]),hee=fe(y_).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`),nPe=fe(lee).withConfig({displayName:"StyledCopyIcon",componentId:"sc-aa2e65ff-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),iPe=fe.ol.withConfig({displayName:"ListContainer",componentId:"sc-aa2e65ff-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),YF=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;}"]),sPe=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 oPe=()=>d.jsx(sPe,{children:d.jsx(hee,{iconSize:60})});const aPe=({address:t,onClose:e,onRetry:r,onTransfer:n,isTransferring:i,transferSuccess:s})=>{var l;let{defaultChain:o}=wi(),a=((l=o.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(dee,{children:[d.jsx(oPe,{}),d.jsxs(mI,{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(iPe,{children:[d.jsx("p",{children:" To check your balance, you can:"}),d.jsx(YF,{children:"Log out and log back into the other account, or "}),d.jsxs(YF,{children:["Copy your wallet address and use a"," ",d.jsx("u",{children:d.jsx("a",{target:"_blank",href:a,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),d.jsxs(fee,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[d.jsx(ow,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(ca,{address:t,showCopyIcon:!1}),d.jsx(nPe,{})]}),d.jsx(uee,{onTransfer:n,isTransferring:i,transferSuccess:s})]})]}),d.jsx(Jt,{})]})},lPe=()=>{let{initiateAccountTransfer:t,closePrivyModal:e}=xt(),{data:r,navigate:n,lastScreen:i,setModalData:s}=vt(),[o,a]=T.useState(void 0),[l,c]=T.useState(!1),[u,f]=T.useState(!1),h=async()=>{var g,m,w,E,v,_,A,C,R;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:(E=r==null?void 0:r.accountTransfer)==null?void 0:E.account,accountType:(v=r==null?void 0:r.accountTransfer)==null?void 0:v.linkMethod,externalWalletMetadata:(_=r==null?void 0:r.accountTransfer)==null?void 0:_.externalWalletMetadata,telegramAuthResult:(A=r==null?void 0:r.accountTransfer)==null?void 0:A.telegramAuthResult,farcasterEmbeddedAddress:(C=r==null?void 0:r.accountTransfer)==null?void 0:C.farcasterEmbeddedAddress,oAuthUserInfo:(R=r==null?void 0:r.accountTransfer)==null?void 0:R.oAuthUserInfo}),c(!0),f(!1),setTimeout(e,1e3)}catch(B){s({errorModalData:{error:B,previousScreen:i||ye.LINK_CONFLICT_SCREEN}}),n(ye.ERROR_SCREEN,!0)}};return o?d.jsx(aPe,{address:o,onClose:e,onRetry:()=>a(void 0),onTransfer:h,isTransferring:u,transferSuccess:l}):d.jsx(cPe,{onClose:e,onInfo:()=>{var g;return a((g=r==null?void 0:r.accountTransfer)==null?void 0:g.embeddedWalletAddress)},onContinue:()=>{var g;return a((g=r==null?void 0:r.accountTransfer)==null?void 0:g.embeddedWalletAddress)},onTransfer:h,isTransferring:u,transferSuccess:l,data:r})},cPe=({onClose:t,onContinue:e,onInfo:r,onTransfer:n,transferSuccess:i,isTransferring:s,data:o})=>{var l,c,u,f,h,g,m;if(!((l=o==null?void 0:o.accountTransfer)!=null&&l.linkMethod)||!((c=o==null?void 0:o.accountTransfer)!=null&&c.displayName))return;let a={method:(u=o==null?void 0:o.accountTransfer)==null?void 0:u.linkMethod,handle:(f=o==null?void 0:o.accountTransfer)==null?void 0:f.displayName,disclosedAccount:(h=o==null?void 0:o.accountTransfer)!=null&&h.embeddedWalletAddress?{type:"wallet",handle:(g=o==null?void 0:o.accountTransfer)==null?void 0:g.embeddedWalletAddress}:void 0};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!0}),d.jsxs(dee,{children:[d.jsx(Fo,{children:d.jsxs("div",{children:[d.jsx(dN,{color:"var(--privy-color-error)"}),d.jsx(Nd,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),d.jsxs(mI,{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`${cee(w.replace("_oauth",""))} profile`;default:return w}}(a.method)," is associated with another account"]}),d.jsxs("p",{children:["Do you want to transfer",d.jsx("b",{children:a.handle?` ${a.handle}`:""})," to this account instead? This will delete your other account."]}),d.jsx(uPe,{onClick:r,disclosedAccount:a.disclosedAccount})]}),d.jsxs(mI,{style:{gap:12,marginTop:12},children:[(m=o==null?void 0:o.accountTransfer)!=null&&m.embeddedWalletAddress?d.jsx(Lt,{onClick:e,children:"Continue"}):d.jsx(uee,{onTransfer:n,transferSuccess:i,isTransferring:s}),d.jsx(Ed,{onClick:t,children:"No thanks"})]})]}),d.jsx(Jt,{})]})};function uPe({disclosedAccount:t,onClick:e}){return t?d.jsxs(fee,{onClick:e,children:[d.jsx(ow,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(ca,{address:t.handle,showCopyIcon:!1}),d.jsx(hee,{iconSize:15})]}):null}function dPe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 yI=T.forwardRef(dPe);function fPe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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"}),T.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 hPe=T.forwardRef(fPe),v_=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;}"]),un=fe.div.withConfig({displayName:"Title",componentId:"sc-a63b1990-1"})(["font-size:18px;line-height:30px;text-align:center;font-weight:600;margin-bottom:10px;"]),dn=fe.div.withConfig({displayName:"SubTitle",componentId:"sc-a63b1990-2"})(["font-size:0.875rem;text-align:center;"]),T0=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;}"]),w_=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%;"]),Gc=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);}"]),Kc=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;"]),jl=fe.div.withConfig({displayName:"BottomSection",componentId:"sc-a63b1990-7"})(["display:flex;flex-direction:column;gap:10px;padding-top:20px;"]),pee=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%;"]),kE=fe.div.withConfig({displayName:"MethodListItem",componentId:"sc-a63b1990-9"})(["display:flex;gap:5px;width:100%;position:relative;"]),NE=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);}"]),PE=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;}"]),RE=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)"),ME=fe.div.withConfig({displayName:"SmsInsecureText",componentId:"sc-a63b1990-13"})(["width:100%;display:flex;justify-content:space-between;"]),pPe=fe.p.withConfig({displayName:"TermsText",componentId:"sc-a63b1990-14"})(["text-align:left;width:100%;color:var(--privy-color-foreground-3) !important;"]),vI=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)"),$s=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;}"]),gee=fe.div.withConfig({displayName:"ErrorMessage",componentId:"sc-a63b1990-17"})(["color:var(--privy-color-error);"]),gPe=()=>{let{user:t,logout:e}=Pr(),{app:r,onUserCloseViaDialogOrKeybindRef:n,setModalData:i,navigate:s}=vt(),{acceptTerms:o,closePrivyModal:a,createAnalyticsEvent:l}=xt(),c=u=>{u==null||u.preventDefault(),a({shouldCallAuthOnSuccess:!1}),e()};return n.current=c,d.jsx(mPe,{termsAndConditionsUrl:r==null?void 0:r.legal.termsAndConditionsUrl,privacyPolicyUrl:r==null?void 0:r.legal.privacyPolicyUrl,onAccept:async u=>{var f;u.preventDefault(),await o(),t&&wd(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}}),s(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)):a()},onDecline:c})},mPe=({termsAndConditionsUrl:t,privacyPolicyUrl:e,onAccept:r,onDecline:n})=>d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(hPe,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),d.jsx(un,{style:{marginTop:24},children:"One last step"}),d.jsx(dn,{children:"By signing up, you agree to our terms and privacy policy."}),d.jsxs(Uf,{style:{marginTop:24},children:[t&&d.jsxs(GF,{target:"_blank",href:t,children:["View Terms ",d.jsx(yI,{style:{marginLeft:"auto"}})]}),e&&d.jsxs(GF,{target:"_blank",href:e,children:["View Privacy Policy ",d.jsx(yI,{style:{marginLeft:"auto"}})]})]}),d.jsxs(yPe,{style:{marginTop:24},children:[d.jsx(Ed,{onClick:n,children:"No thanks"}),d.jsx(Lt,{onClick:r,children:"Accept"})]}),d.jsx(Jt,{})]});let yPe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-4aff18c8-0"})(["display:flex;gap:10px;"]);const mee=({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"})}),vPe=()=>{let{navigate:t,app:e}=vt(),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(wPe,{children:[d.jsx(Fo,{children:d.jsxs("div",{children:[d.jsx(dN,{}),d.jsx(mee,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),d.jsxs(bPe,{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(Lt,{as:"a",href:e.allowlistConfig.errorCtaLink,children:i}):d.jsx(Lt,{onClick:()=>{t(ye.LANDING)},children:i})]})]})};let wPe=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;"]),bPe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-ed4ecf-1"})(["display:flex;flex-direction:column;gap:8px;"]);function _Pe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 xPe=T.forwardRef(_Pe);function EPe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 X0=T.forwardRef(EPe);function CPe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 tc=T.forwardRef(CPe),ep=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;"]),rc=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%;"]),hN=fe.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),pN=fe(rc).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),Pd=fe(rc).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),b_=fe.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),ya=fe.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),APe=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;}"]),Qr=fe.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),tn=fe.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"})(["height:12px;"]),SPe=fe.div.withConfig({displayName:"RelativeContainer",componentId:"sc-cb963810-11"})(["position:relative;"]),gN=fe.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],t=>t.height??"12"),IPe=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;"]),__=({title:t,description:e,children:r,...n})=>d.jsx(yee,{...n,children:d.jsxs(d.Fragment,{children:[d.jsx("h3",{children:t}),typeof e=="string"?d.jsx("p",{children:e}):e,r]})}),aw=fe(__).withConfig({displayName:"PaddedScreenHeader",componentId:"sc-523a75d6-0"})(["margin-bottom:24px;"]),Fn=({title:t,description:e,icon:r,children:n,...i})=>d.jsxs(TPe,{...i,children:[r||null,d.jsx("h3",{children:t}),e&&typeof e=="string"?d.jsx("p",{children:e}):e,n]});let yee=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;}"]),TPe=fe(yee).withConfig({displayName:"CenteredStyledSection",componentId:"sc-523a75d6-2"})(["align-items:center;text-align:center;gap:16px;h3{margin-bottom:24px;}"]),ZF=Array(6).fill("");var Xm,ey,$Pe=((Xm=$Pe||{})[Xm.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",Xm[Xm.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",Xm),kPe=((ey=kPe||{})[ey.EMAIL=0]="EMAIL",ey[ey.SMS=1]="SMS",ey);const NPe=()=>{var x,P,L;let{app:t,navigate:e,lastScreen:r,navigateBack:n,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=vt(),{closePrivyModal:o,resendEmailCode:a,resendSmsCode:l,getAuthMeta:c,loginWithCode:u,updateWallets:f,createAnalyticsEvent:h}=xt(),{authenticated:g,logout:m,user:w}=Pr(),[E,v]=T.useState(ZF),[_,A]=T.useState(!1),[C,R]=T.useState(null),[B,S]=T.useState(null),[U,G]=T.useState(0);s.current=()=>null;let oe=(x=c())!=null&&x.email?0:1,K=Rn-500;T.useEffect(()=>{if(U){let O=setTimeout(()=>{G(U-1)},1e3);return()=>clearTimeout(O)}},[U]),T.useEffect(()=>{var O;if(g&&_&&w){if(t!=null&&t.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms){let j=setTimeout(()=>{e(ye.AFFIRMATIVE_CONSENT_SCREEN)},K);return()=>clearTimeout(j)}if(wd(w,(O=t==null?void 0:t.embeddedWallets)==null?void 0:O.createOnLogin)){let j=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:I=>{console.error(I),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:I,screen:"AwaitingPasswordlessCodeScreen"}}),m()},callAuthOnSuccessOnClose:!0}}),e(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},K);return()=>clearTimeout(j)}{f();let j=setTimeout(()=>o({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Rn);return()=>clearTimeout(j)}}},[g,_,w]),T.useEffect(()=>{if(C&&B===0){let O=setTimeout(()=>{v(ZF),R(null);let j=document.querySelector("input[name=code-0]");j==null||j.focus()},1400);return()=>clearTimeout(O)}},[C]);let N=O=>{var le;O.preventDefault();let j=O.currentTarget.value.replace(" ","");if(j==="")return;if(isNaN(Number(j)))return R("Code should be numeric"),void S(1);R(null),S(null);let I=Number((le=O.currentTarget.name)==null?void 0:le.charAt(5)),D=[...j||[""]].slice(0,6-I),M=[...E.slice(0,I),...D,...E.slice(I+D.length)];v(M);let X=Math.min(Math.max(I+D.length,0),5);if(!isNaN(Number(O.currentTarget.value))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.focus()}if(M.every(H=>H&&!isNaN(+H))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.blur(),u(M.join("")).then(()=>A(!0)).catch(ee=>{var Z,te,re,W,q,J,me,be,Ce,Fe,Ue,Ye;if(ee instanceof Ha&&ee.privyErrorCode===Se.INVALID_CREDENTIALS)R("Invalid or expired verification code");else if(ee instanceof Ha&&ee.privyErrorCode===Se.CANNOT_LINK_MORE_OF_TYPE)R(ee.message);else{if(ee instanceof Ha&&ee.privyErrorCode===Se.USER_LIMIT_REACHED)return console.error(new Vv(ee).toString()),void e(ye.USER_LIMIT_REACHED_SCREEN);if(ee instanceof Ha&&ee.privyErrorCode===Se.USER_DOES_NOT_EXIST)return void e(ye.ACCOUNT_NOT_FOUND_SCREEN);if(ee instanceof Ha&&ee.privyErrorCode===Se.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:ee,previousScreen:r??ye.AWAITING_PASSWORDLESS_CODE}}),void e(ye.ERROR_SCREEN,!1);if(ee instanceof Ha&&ee.privyErrorCode===Se.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:ee}}),void e(ye.CONNECT_OR_CREATE,!1);if(ee instanceof Ha&&ee.privyErrorCode===Se.ACCOUNT_TRANSFER_REQUIRED&&((te=(Z=ee.data)==null?void 0:Z.data)!=null&&te.nonce))return i({accountTransfer:{nonce:(W=(re=ee.data)==null?void 0:re.data)==null?void 0:W.nonce,account:oe===0?(q=c())==null?void 0:q.email:(J=c())==null?void 0:J.phoneNumber,displayName:(Ce=(be=(me=ee.data)==null?void 0:me.data)==null?void 0:be.account)==null?void 0:Ce.displayName,linkMethod:oe===0?"email":"sms",embeddedWalletAddress:(Ye=(Ue=(Fe=ee.data)==null?void 0:Fe.data)==null?void 0:Ue.otherUser)==null?void 0:Ye.embeddedWalletAddress}}),void e(ye.LINK_CONFLICT_SCREEN);R("Issue verifying code")}S(0)})}},k=oe==0?d.jsx(X0,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):d.jsx(tc,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),b=d.jsxs("p",oe==0?{children:["Please check ",d.jsx(JF,{children:(P=c())==null?void 0:P.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",d.jsx(JF,{children:(L=c())==null?void 0:L.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(PPe,{children:[d.jsx(Fn,{title:"Enter confirmation code",description:b,icon:k}),d.jsxs(hN,{children:[d.jsxs(RPe,{children:[d.jsx(MPe,{$fail:!!C,$success:_,children:d.jsx("span",{children:C||(_?"Success!":"")})}),d.jsx("div",{children:E.map((O,j)=>d.jsx("input",{name:`code-${j}`,type:"text",value:E[j],onChange:N,onKeyUp:I=>{I.key==="Backspace"&&(D=>{if(B===1&&(R(null),S(null)),v([...E.slice(0,D),"",...E.slice(D+1)]),D>0){let M=document.querySelector(`input[name=code-${D-1}]`);M==null||M.focus()}})(j)},inputMode:"numeric",autoFocus:j===0,pattern:"[0-9]",className:`${_?"success":""} ${C?"fail":""}`,autoComplete:cs?"one-time-code":"off"},j))})]}),d.jsxs(OPe,{children:[d.jsxs("span",{children:["Didn't get ",oe==0?"an email":"a message","?"]}),U?d.jsxs(DPe,{children:[d.jsx(xPe,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),d.jsx("span",{children:"Code sent"})]}):d.jsx(jPe,{children:d.jsx("button",{onClick:async()=>{G(30),oe==0?await a():await l()},children:"Resend code"})})]})]})]}),d.jsx(Jt,{})]})};let PPe=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;"]),RPe=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);}}"]),MPe=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)"),OPe=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;"]),jPe=fe.div.withConfig({displayName:"ResendButtonContainer",componentId:"sc-463c12b2-4"})(["color:var(--privy-color-accent);padding:2px 0;> button{text-decoration:underline;}"]),DPe=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);"]),JF=fe.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-463c12b2-6"})(["font-weight:500;word-break:break-all;"]);function LPe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 $0=T.forwardRef(LPe);function FPe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 x_=T.forwardRef(FPe),UPe=({icon:t})=>d.jsx(d.Fragment,{children:d.jsx(BPe,{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 BPe=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 WPe=()=>{let{lastScreen:t,currentScreen:e,data:r,navigateBack:n,navigate:i,setModalData:s}=vt(),{status:o,token:a,waitForResult:l,reset:c,execute:u}=Ca(),f=T.useRef([]),h=N=>{f.current=[N,...f.current]},[g,m]=T.useState(!0);T.useEffect(()=>(h(setTimeout(m,1e3,!1)),()=>{f.current.forEach(N=>clearTimeout(N)),f.current=[]}),[]);let[w,E]=T.useState(""),[v,_]=T.useState("Checking that you are a human..."),[A,C]=T.useState(d.jsx(Lt,{onClick:()=>{},disabled:!0,children:"Continue"})),[R,B]=T.useState(!1),[S,U]=T.useState(3),G=r==null?void 0:r.captchaModalData,oe=async N=>{try{await(G==null?void 0:G.callback(N)),G!=null&&G.onSuccessNavigateTo&&i(G==null?void 0:G.onSuccessNavigateTo,!1)}catch(k){if(k instanceof R8)return;s({errorModalData:{error:k,previousScreen:t||ye.LANDING}}),i((G==null?void 0:G.onErrorNavigateTo)||ye.ERROR_SCREEN,!1)}};T.useEffect(()=>{o==="success"?h(setTimeout(async()=>{let N=await l();!N||G!=null&&G.userIntentRequired||oe(N)},1e3)):o==="ready"&&h(setTimeout(()=>{o==="ready"&&u()},500))},[o]),T.useEffect(()=>{if(!g)switch(o){case"success":E("Success!"),_("CAPTCHA passed successfully."),C(d.jsx(Lt,{onClick:()=>{B(!0),oe(a)},disabled:!(G!=null&&G.userIntentRequired),loading:R,children:G!=null&&G.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":E(""),_("Checking that you are a human..."),C(d.jsx(Lt,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":E("Something went wrong"),S<=0?(_("If you use an adblocker or VPN, try disabling and re-attempting."),C(null)):(_("You did not pass CAPTCHA. Please try again."),C(d.jsx(Lt,{onClick:K,children:"Retry"})))}},[o,g,R]);let K=async()=>{if(S<=0)return;U(k=>k-1),c(),u();let N=await l();!N||G!=null&&G.userIntentRequired||oe(N)};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:t&&e!==t?n:void 0}),d.jsxs(zPe,{children:[o==="success"?d.jsx($0,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):o==="error"?d.jsx(x_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(UPe,{}),d.jsxs(ya,{children:[w?d.jsx("h3",{children:w}):null,d.jsx("p",{children:v})]}),A]}),d.jsx($r,{})]})};let zPe=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 k5=({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(zNe,{$withPadding:e,children:d.jsxs(HNe,{children:[d.jsx(i0,{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")},vee=({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(ow,{}):t?d.jsx(t,{}):null;let HPe=VX(["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 wee=es(["",""],t=>t.$isLoading?es(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],HPe):""),nc=({children:t,color:e,isLoading:r,isPulsing:n,...i})=>d.jsx(qPe,{$color:e,$isLoading:r,$isPulsing:n,...i,children:t});let qPe=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=VX(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],r,r);return es(["color:",";background-color:",";",";"],e,r,t.$isPulsing&&es(["animation:"," 3s linear infinite;"],n))},wee);const VPe=({...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"})]}),GPe=({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"})]})})]}),KPe=({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"})]})]})]}),bee=({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"})]}),YPe="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=",E_=({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"})]}),_ee="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyB2aWV3Qm94PScwIDAgMTA4IDEwOCcgZmlsbD0nbm9uZScgc3R5bGU9J2hlaWdodDoyOHB4O3dpZHRoOjI4cHgnPjxyZWN0IHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyByeD0nMjMnIGZpbGw9JyNBQjlGRjInPjwvcmVjdD48cGF0aCBmaWxsLXJ1bGU9J2V2ZW5vZGQnIGNsaXAtcnVsZT0nZXZlbm9kZCcgZD0nTTQ2LjUyNjcgNjkuOTIyOUM0Mi4wMDU0IDc2Ljg1MDkgMzQuNDI5MiA4NS42MTgyIDI0LjM0OCA4NS42MTgyQzE5LjU4MjQgODUuNjE4MiAxNSA4My42NTYzIDE1IDc1LjEzNDJDMTUgNTMuNDMwNSA0NC42MzI2IDE5LjgzMjcgNzIuMTI2OCAxOS44MzI3Qzg3Ljc2OCAxOS44MzI3IDk0IDMwLjY4NDYgOTQgNDMuMDA3OUM5NCA1OC44MjU4IDgzLjczNTUgNzYuOTEyMiA3My41MzIxIDc2LjkxMjJDNzAuMjkzOSA3Ni45MTIyIDY4LjcwNTMgNzUuMTM0MiA2OC43MDUzIDcyLjMxNEM2OC43MDUzIDcxLjU3ODMgNjguODI3NSA3MC43ODEyIDY5LjA3MTkgNjkuOTIyOUM2NS41ODkzIDc1Ljg2OTkgNTguODY4NSA4MS4zODc4IDUyLjU3NTQgODEuMzg3OEM0Ny45OTMgODEuMzg3OCA0NS42NzEzIDc4LjUwNjMgNDUuNjcxMyA3NC40NTk4QzQ1LjY3MTMgNzIuOTg4NCA0NS45NzY4IDcxLjQ1NTYgNDYuNTI2NyA2OS45MjI5Wk04My42NzYxIDQyLjU3OTRDODMuNjc2MSA0Ni4xNzA0IDgxLjU1NzUgNDcuOTY1OCA3OS4xODc1IDQ3Ljk2NThDNzYuNzgxNiA0Ny45NjU4IDc0LjY5ODkgNDYuMTcwNCA3NC42OTg5IDQyLjU3OTRDNzQuNjk4OSAzOC45ODg1IDc2Ljc4MTYgMzcuMTkzMSA3OS4xODc1IDM3LjE5MzFDODEuNTU3NSAzNy4xOTMxIDgzLjY3NjEgMzguOTg4NSA4My42NzYxIDQyLjU3OTRaTTcwLjIxMDMgNDIuNTc5NUM3MC4yMTAzIDQ2LjE3MDQgNjguMDkxNiA0Ny45NjU4IDY1LjcyMTYgNDcuOTY1OEM2My4zMTU3IDQ3Ljk2NTggNjEuMjMzIDQ2LjE3MDQgNjEuMjMzIDQyLjU3OTVDNjEuMjMzIDM4Ljk4ODUgNjMuMzE1NyAzNy4xOTMxIDY1LjcyMTYgMzcuMTkzMUM2OC4wOTE2IDM3LjE5MzEgNzAuMjEwMyAzOC45ODg1IDcwLjIxMDMgNDIuNTc5NVonIGZpbGw9JyNGRkZERjgnPjwvcGF0aD48L3N2Zz4=",ZPe=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"})]})]})]}),JPe=({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"})})]})]}),QPe=({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"})]}),XPe=({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"})]})]}),eRe=({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"})]})]})]}),xee=({style:t,...e})=>{let{app:r}=vt();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)"})})})]})},tRe="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",rRe=({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"})})})]}),Yc={coinbase_wallet:{logo:rI,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:rI,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:bee,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:E_,displayName:"Phantom"},rainbow:{logo:JPe,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:xee,displayName:"WalletConnect"},zerion:{logo:rRe,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:VPe,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:KPe,displayName:"Crypto.com Onchain",rdns:"com.crypto.wallet"},uniswap:{logo:XPe,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:ZPe,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:QPe},universal_profile:{displayName:"Universal Profile",logo:eRe},bybit_wallet:{displayName:"Bybit Wallet",logo:GPe}},Qg=(t,e,r)=>{var n;return(n=Yc[t])!=null&&n.displayName?t==="coinbase_wallet"?Yc[r].displayName:Yc[t].displayName:e==="wallet_connect_v2"&&t==="wallet_connect"?"Wallet Connect":void 0},Eee=(t,e,r)=>{var n;return(n=Yc[t])!=null&&n.logo?t==="coinbase_wallet"?Yc[r].logo:Yc[t].logo:e==="wallet_connect_v2"&&t==="wallet_connect"?xee:void 0};function wI(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 Cee=T.createContext({});const nRe=({children:t})=>{let e=wi(),[r,n]=T.useState({});return oN("login",{onComplete:(i,s,o,a,l)=>{l&&l.type!=="passkey"&&l.type!=="cross_app"&&(l.type!=="wallet"||l.walletClientType!=="privy")&&(Dt.put(QF(e.id),l.type),l.type==="wallet"?(Dt.put(OE(e.id),l.walletClientType),Dt.put(jE(e.id),l.chainType),n({accountType:l.type,walletClientType:l.walletClientType,chainType:l.chainType})):(Dt.del(OE(e.id)),Dt.del(jE(e.id)),n({accountType:l.type})))}}),T.useEffect(()=>{if(!e.id)return;let i=Dt.get(QF(e.id)),s=Dt.get(OE(e.id)),o=Dt.get(jE(e.id));i&&n(i==="wallet"?{accountType:i,walletClientType:s,chainType:o}:{accountType:i})},[e.id]),d.jsx(Cee.Provider,{value:r,children:t})};let QF=t=>`privy:${t}:recent-login-method`,OE=t=>`privy:${t}:recent-login-wallet-client`,jE=t=>`privy:${t}:recent-login-chain-type`;const rh=()=>T.useContext(Cee),Pu=({provider:t,displayName:e,logo:r,connectOnly:n,connector:i})=>{let{navigate:s}=vt(),{connectWallet:o}=xt(),a=rh(),l=i.connectorType==="wallet_connect_v2"?t:i.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches;return d.jsxs(iRe,{onClick:i.connectorType==="phantom"||i.connectorType==="solana_adapter"&&i.walletClientType==="phantom"?()=>{k8()||i.chainType==="solana"&&"isInstalled"in i&&i.isInstalled?(o(i,l),s(n?ye.AWAITING_CONNECT_ONLY_CONNECTION:ye.AWAITING_CONNECTION)):s(cs?ye.PHANTOM_INTERSTITIAL_SCREEN:ye.INSTALL_PHANTOM_SCREEN)}:i.connectorType!=="coinbase_wallet"||i.connectionOptions!=="eoaOnly"||!cs||c||pJ()?()=>{(!wI(window.navigator.userAgent)||event!=null&&event.isTrusted)&&(o(i,l),s(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(vee,{icon:Eee(t,i.connectorType,i.walletClientType)??r,name:i.walletClientType}),d.jsx("span",{children:Qg(t,i.connectorType,i.walletClientType)||e||i.walletClientType}),d.jsxs(sRe,{id:"chip-container",children:[(a==null?void 0:a.walletClientType)===l&&(a==null?void 0:a.chainType)===i.chainType?d.jsx(XF,{color:"gray",children:"Recent"}):d.jsx("span",{id:"connect-text",children:"Connect"}),i.connectorType==="solana_adapter"&&d.jsx(XF,{color:"gray",children:"Solana"})]})]})};let iRe=fe(Vn).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;}}"]),XF=fe(nc).withConfig({displayName:"StyledChip",componentId:"sc-b6343d12-1"})(["margin-left:auto;"]),sRe=fe.div.withConfig({displayName:"ChipContainer",componentId:"sc-b6343d12-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const oRe=["coinbase_wallet"];let aRe=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom"];const lRe=["safe"],cRe=["phantom","universal_profile"],mN=({wallets:t})=>{let{app:e}=vt();return t.length===0?d.jsx(k5,{chainType:e.appearance.walletChainType,withPadding:!0}):d.jsx(d.Fragment,{children:t})},k0=({walletList:t,walletChainType:e,connectors:r,connectOnly:n,ignore:i,walletConnectEnabled:s,forceWallet:o})=>{var h,g;let a=[],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(o?[o.wallet]:t).entries()){if(w==="detected_ethereum_wallets"||w==="detected_wallets")for(let[E,v]of u.filter(({chainType:_,connectorType:A,walletClientType:C})=>_!=="solana"&&(C==="uniswap_wallet_extension"||C==="uniswap_extension"?!i.includes("uniswap"):C==="crypto.com_wallet_extension"||C==="crypto.com_onchain"?!i.includes("cryptocom"):A==="injected"&&!i.includes(C))).entries()){let{walletClientType:_,walletBranding:A,chainType:C}=v;(_==="unknown"?l:a).push(d.jsx(Pu,{connectOnly:n,provider:_,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${_}-${C}-${E}`))}if(w==="detected_solana_wallets"||w==="detected_wallets")for(let[E,v]of u.filter(({chainType:_,walletClientType:A})=>{if(_==="solana")return e!=="ethereum-only"&&!i.includes(A)}).entries()){let{walletClientType:_,walletBranding:A,chainType:C}=v;(_==="unknown"?l:a).push(d.jsx(Pu,{connectOnly:n,provider:_,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${_}-${C}-${E}`))}if(cRe.includes(w)){let E=u.find(v=>v.connectorType==="injected"&&v.walletClientType===w||v.connectorType===w);if(E&&a.push(d.jsx(Pu,{connectOnly:n,provider:w,connector:E},`${m}-${w}`)),e==="solana-only"||e==="ethereum-and-solana"){let v=u.find(({chainType:_,connectorType:A,walletClientType:C})=>_==="solana"&&A==="solana_adapter"&&C===w);v&&a.push(d.jsx(Pu,{connectOnly:n,provider:w,connector:v},`${w}-solana`))}}else if(aRe.includes(w)){let E=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);s&&!E&&(E=f),E&&a.push(d.jsx(Pu,{connectOnly:n,provider:w,connector:E,logo:E.connectorType==="injected"?E.walletBranding.icon:void 0,displayName:E.connectorType==="injected"?E.walletBranding.name:void 0},`${m}-${w}`))}else if(oRe.includes(w)){let E=u.find(({connectorType:v})=>v===w);E&&a.push(d.jsx(Pu,{connectOnly:n,provider:w,connector:E},`${m}-${w}`))}else if(lRe.includes(w))f&&c.push(d.jsx(Pu,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w==="wallet_connect")f&&c.push(d.jsx(Pu,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w===(o==null?void 0:o.wallet)){let E=o.chainType==="ethereum"&&t.includes("detected_ethereum_wallets"),v=o.chainType==="solana"&&t.includes("detected_solana_wallets");if(t.includes("detected_wallets")||E||v){let _=u.find(({walletClientType:A})=>A===w);_&&a.push(d.jsx(Pu,{connectOnly:n,provider:w,displayName:(h=_.walletBranding)==null?void 0:h.name,logo:(g=_.walletBranding)==null?void 0:g.icon,connector:_},`${m}-${w}`))}}}return[...l,...a,...c]},uRe=()=>{var o,a;let{app:t,data:e}=vt(),r=(o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.suggestedAddress,n=r?`Connect the wallet with address ${Ys(r)} ${t!=null&&t.name?`to ${t.name}.`:"."}`:`Connect a wallet to ${t==null?void 0:t.name}`,{connectors:i}=xt(),s=k0({walletList:((a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.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"),s.length>0&&d.jsx(aw,{title:"Connect your wallet",description:n}),d.jsx(Uf,{children:d.jsx(mN,{wallets:s})}),d.jsx(Jt,{})]})},dRe=()=>{var o,a;let{app:t,data:e}=vt(),r=(o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.suggestedAddress,n=r?d.jsxs("span",{children:["Connect the wallet with address ",d.jsx(ca,{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}=xt(),s=k0({walletList:((a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.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"),s.length>0&&d.jsx(__,{title:"Connect your wallet",description:n}),d.jsx(Uf,{children:d.jsx(mN,{wallets:s})}),t&&d.jsx(fN,{app:t,alwaysShowImplicitConsent:!0}),d.jsx(Jt,{})]})},yN=({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"})}),eU=t=>{var r;let e=(r=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses"))==null?void 0:r.split(" ").filter(n=>Zl(n,{strict:!0})).map(n=>q$(n));return!!(e!=null&&e.length)&&!!(t!=null&&t.linkedAccounts.filter(n=>n.type=="wallet"&&e.includes(n.address)).length)};var tU=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new mRe:typeof navigator<"u"?xRe(navigator.userAgent):CRe()}function _Re(t){return t!==""&&wRe.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function xRe(t){var e=_Re(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new gRe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.lengthi)throw new RangeError('The value "'+Y+'" is invalid for option "size"');const F=new Uint8Array(Y);return Object.setPrototypeOf(F,o.prototype),F}function o(Y,F,z){if(typeof Y=="number"){if(typeof F=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(Y)}return l(Y,F,z)}o.poolSize=8192;function l(Y,F,z){if(typeof Y=="string")return h(Y,F);if(ArrayBuffer.isView(Y))return m(Y);if(Y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y);if(Ve(Y,ArrayBuffer)||Y&&Ve(Y.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ve(Y,SharedArrayBuffer)||Y&&Ve(Y.buffer,SharedArrayBuffer)))return w(Y,F,z);if(typeof Y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ie=Y.valueOf&&Y.valueOf();if(ie!=null&&ie!==Y)return o.from(ie,F,z);const pe=E(Y);if(pe)return pe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Y[Symbol.toPrimitive]=="function")return o.from(Y[Symbol.toPrimitive]("string"),F,z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y)}o.from=function(Y,F,z){return l(Y,F,z)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function c(Y){if(typeof Y!="number")throw new TypeError('"size" argument must be of type number');if(Y<0)throw new RangeError('The value "'+Y+'" is invalid for option "size"')}function u(Y,F,z){return c(Y),Y<=0?a(Y):F!==void 0?typeof z=="string"?a(Y).fill(F,z):a(Y).fill(F):a(Y)}o.alloc=function(Y,F,z){return u(Y,F,z)};function f(Y){return c(Y),a(Y<0?0:v(Y)|0)}o.allocUnsafe=function(Y){return f(Y)},o.allocUnsafeSlow=function(Y){return f(Y)};function h(Y,F){if((typeof F!="string"||F==="")&&(F="utf8"),!o.isEncoding(F))throw new TypeError("Unknown encoding: "+F);const z=A(Y,F)|0;let ie=a(z);const pe=ie.write(Y,F);return pe!==z&&(ie=ie.slice(0,pe)),ie}function g(Y){const F=Y.length<0?0:v(Y.length)|0,z=a(F);for(let ie=0;ie=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return Y|0}function _(Y){return+Y!=Y&&(Y=0),o.alloc(+Y)}o.isBuffer=function(F){return F!=null&&F._isBuffer===!0&&F!==o.prototype},o.compare=function(F,z){if(Ve(F,Uint8Array)&&(F=o.from(F,F.offset,F.byteLength)),Ve(z,Uint8Array)&&(z=o.from(z,z.offset,z.byteLength)),!o.isBuffer(F)||!o.isBuffer(z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(F===z)return 0;let ie=F.length,pe=z.length;for(let ve=0,he=Math.min(ie,pe);vepe.length?(o.isBuffer(he)||(he=o.from(he)),he.copy(pe,ve)):Uint8Array.prototype.set.call(pe,he,ve);else if(o.isBuffer(he))he.copy(pe,ve);else throw new TypeError('"list" argument must be an Array of Buffers');ve+=he.length}return pe};function A(Y,F){if(o.isBuffer(Y))return Y.length;if(ArrayBuffer.isView(Y)||Ve(Y,ArrayBuffer))return Y.byteLength;if(typeof Y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Y);const z=Y.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&z===0)return 0;let pe=!1;for(;;)switch(F){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return Ue(Y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z*2;case"hex":return z>>>1;case"base64":return xe(Y).length;default:if(pe)return ie?-1:Ue(Y).length;F=(""+F).toLowerCase(),pe=!0}}o.byteLength=A;function C(Y,F,z){let ie=!1;if((F===void 0||F<0)&&(F=0),F>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0,F>>>=0,z<=F))return"";for(Y||(Y="utf8");;)switch(Y){case"hex":return j(this,F,z);case"utf8":case"utf-8":return b(this,F,z);case"ascii":return D(this,F,z);case"latin1":case"binary":return O(this,F,z);case"base64":return k(this,F,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,F,z);default:if(ie)throw new TypeError("Unknown encoding: "+Y);Y=(Y+"").toLowerCase(),ie=!0}}o.prototype._isBuffer=!0;function R(Y,F,z){const ie=Y[F];Y[F]=Y[z],Y[z]=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 z=0;zz&&(F+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(F,z,ie,pe,ve){if(Ve(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(z===void 0&&(z=0),ie===void 0&&(ie=F?F.length:0),pe===void 0&&(pe=0),ve===void 0&&(ve=this.length),z<0||ie>F.length||pe<0||ve>this.length)throw new RangeError("out of range index");if(pe>=ve&&z>=ie)return 0;if(pe>=ve)return-1;if(z>=ie)return 1;if(z>>>=0,ie>>>=0,pe>>>=0,ve>>>=0,this===F)return 0;let he=ve-pe,Le=ie-z;const Ze=Math.min(he,Le),et=this.slice(pe,ve),it=F.slice(z,ie);for(let ut=0;ut2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),z=+z,Ie(z)&&(z=pe?0:Y.length-1),z<0&&(z=Y.length+z),z>=Y.length){if(pe)return-1;z=Y.length-1}else if(z<0)if(pe)z=0;else return-1;if(typeof F=="string"&&(F=o.from(F,ie)),o.isBuffer(F))return F.length===0?-1:S(Y,F,z,ie,pe);if(typeof F=="number")return F=F&255,typeof Uint8Array.prototype.indexOf=="function"?pe?Uint8Array.prototype.indexOf.call(Y,F,z):Uint8Array.prototype.lastIndexOf.call(Y,F,z):S(Y,[F],z,ie,pe);throw new TypeError("val must be string, number or Buffer")}function S(Y,F,z,ie,pe){let ve=1,he=Y.length,Le=F.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(Y.length<2||F.length<2)return-1;ve=2,he/=2,Le/=2,z/=2}function Ze(it,ut){return ve===1?it[ut]:it.readUInt16BE(ut*ve)}let et;if(pe){let it=-1;for(et=z;ethe&&(z=he-Le),et=z;et>=0;et--){let it=!0;for(let ut=0;utpe&&(ie=pe)):ie=pe;const ve=F.length;ie>ve/2&&(ie=ve/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 ve=this.length-z;if((ie===void 0||ie>ve)&&(ie=ve),F.length>0&&(ie<0||z<0)||z>this.length)throw new RangeError("Attempt to write outside buffer bounds");pe||(pe="utf8");let he=!1;for(;;)switch(pe){case"hex":return U(this,F,z,ie);case"utf8":case"utf-8":return G(this,F,z,ie);case"ascii":case"latin1":case"binary":return ae(this,F,z,ie);case"base64":return K(this,F,z,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,F,z,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(Y,F,z){return F===0&&z===Y.length?e.fromByteArray(Y):e.fromByteArray(Y.slice(F,z))}function b(Y,F,z){z=Math.min(Y.length,z);const ie=[];let pe=F;for(;pe239?4:ve>223?3:ve>191?2:1;if(pe+Le<=z){let Ze,et,it,ut;switch(Le){case 1:ve<128&&(he=ve);break;case 2:Ze=Y[pe+1],(Ze&192)===128&&(ut=(ve&31)<<6|Ze&63,ut>127&&(he=ut));break;case 3:Ze=Y[pe+1],et=Y[pe+2],(Ze&192)===128&&(et&192)===128&&(ut=(ve&15)<<12|(Ze&63)<<6|et&63,ut>2047&&(ut<55296||ut>57343)&&(he=ut));break;case 4:Ze=Y[pe+1],et=Y[pe+2],it=Y[pe+3],(Ze&192)===128&&(et&192)===128&&(it&192)===128&&(ut=(ve&15)<<18|(Ze&63)<<12|(et&63)<<6|it&63,ut>65535&&ut<1114112&&(he=ut))}}he===null?(he=65533,Le=1):he>65535&&(he-=65536,ie.push(he>>>10&1023|55296),he=56320|he&1023),ie.push(he),pe+=Le}return P(ie)}const x=4096;function P(Y){const F=Y.length;if(F<=x)return String.fromCharCode.apply(String,Y);let z="",ie=0;for(;ieie)&&(z=ie);let pe="";for(let ve=F;veie&&(F=ie),z<0?(z+=ie,z<0&&(z=0)):z>ie&&(z=ie),zz)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(F,z,ie){F=F>>>0,z=z>>>0,ie||L(F,z,this.length);let pe=this[F],ve=1,he=0;for(;++he>>0,z=z>>>0,ie||L(F,z,this.length);let pe=this[F+--z],ve=1;for(;z>0&&(ve*=256);)pe+=this[F+--z]*ve;return pe},o.prototype.readUint8=o.prototype.readUInt8=function(F,z){return F=F>>>0,z||L(F,1,this.length),this[F]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(F,z){return F=F>>>0,z||L(F,2,this.length),this[F]|this[F+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(F,z){return F=F>>>0,z||L(F,2,this.length),this[F]<<8|this[F+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(F,z){return F=F>>>0,z||L(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,z){return F=F>>>0,z||L(F,4,this.length),this[F]*16777216+(this[F+1]<<16|this[F+2]<<8|this[F+3])},o.prototype.readBigUInt64LE=Oe(function(F){F=F>>>0,me(F,"offset");const z=this[F],ie=this[F+7];(z===void 0||ie===void 0)&&be(F,this.length-8);const pe=z+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24,ve=this[++F]+this[++F]*2**8+this[++F]*2**16+ie*2**24;return BigInt(pe)+(BigInt(ve)<>>0,me(F,"offset");const z=this[F],ie=this[F+7];(z===void 0||ie===void 0)&&be(F,this.length-8);const pe=z*2**24+this[++F]*2**16+this[++F]*2**8+this[++F],ve=this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+ie;return(BigInt(pe)<>>0,z=z>>>0,ie||L(F,z,this.length);let pe=this[F],ve=1,he=0;for(;++he=ve&&(pe-=Math.pow(2,8*z)),pe},o.prototype.readIntBE=function(F,z,ie){F=F>>>0,z=z>>>0,ie||L(F,z,this.length);let pe=z,ve=1,he=this[F+--pe];for(;pe>0&&(ve*=256);)he+=this[F+--pe]*ve;return ve*=128,he>=ve&&(he-=Math.pow(2,8*z)),he},o.prototype.readInt8=function(F,z){return F=F>>>0,z||L(F,1,this.length),this[F]&128?(255-this[F]+1)*-1:this[F]},o.prototype.readInt16LE=function(F,z){F=F>>>0,z||L(F,2,this.length);const ie=this[F]|this[F+1]<<8;return ie&32768?ie|4294901760:ie},o.prototype.readInt16BE=function(F,z){F=F>>>0,z||L(F,2,this.length);const ie=this[F+1]|this[F]<<8;return ie&32768?ie|4294901760:ie},o.prototype.readInt32LE=function(F,z){return F=F>>>0,z||L(F,4,this.length),this[F]|this[F+1]<<8|this[F+2]<<16|this[F+3]<<24},o.prototype.readInt32BE=function(F,z){return F=F>>>0,z||L(F,4,this.length),this[F]<<24|this[F+1]<<16|this[F+2]<<8|this[F+3]},o.prototype.readBigInt64LE=Oe(function(F){F=F>>>0,me(F,"offset");const z=this[F],ie=this[F+7];(z===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 z=this[F],ie=this[F+7];(z===void 0||ie===void 0)&&be(F,this.length-8);const pe=(z<<24)+this[++F]*2**16+this[++F]*2**8+this[++F];return(BigInt(pe)<>>0,z||L(F,4,this.length),r.read(this,F,!0,23,4)},o.prototype.readFloatBE=function(F,z){return F=F>>>0,z||L(F,4,this.length),r.read(this,F,!1,23,4)},o.prototype.readDoubleLE=function(F,z){return F=F>>>0,z||L(F,8,this.length),r.read(this,F,!0,52,8)},o.prototype.readDoubleBE=function(F,z){return F=F>>>0,z||L(F,8,this.length),r.read(this,F,!1,52,8)};function M(Y,F,z,ie,pe,ve){if(!o.isBuffer(Y))throw new TypeError('"buffer" argument must be a Buffer instance');if(F>pe||FY.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(F,z,ie,pe){if(F=+F,z=z>>>0,ie=ie>>>0,!pe){const Le=Math.pow(2,8*ie)-1;M(this,F,z,ie,Le,0)}let ve=1,he=0;for(this[z]=F&255;++he>>0,ie=ie>>>0,!pe){const Le=Math.pow(2,8*ie)-1;M(this,F,z,ie,Le,0)}let ve=ie-1,he=1;for(this[z+ve]=F&255;--ve>=0&&(he*=256);)this[z+ve]=F/he&255;return z+ie},o.prototype.writeUint8=o.prototype.writeUInt8=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,1,255,0),this[z]=F&255,z+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,2,65535,0),this[z]=F&255,this[z+1]=F>>>8,z+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,2,65535,0),this[z]=F>>>8,this[z+1]=F&255,z+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,4,4294967295,0),this[z+3]=F>>>24,this[z+2]=F>>>16,this[z+1]=F>>>8,this[z]=F&255,z+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,4,4294967295,0),this[z]=F>>>24,this[z+1]=F>>>16,this[z+2]=F>>>8,this[z+3]=F&255,z+4};function X(Y,F,z,ie,pe){J(F,ie,pe,Y,z,7);let ve=Number(F&BigInt(4294967295));Y[z++]=ve,ve=ve>>8,Y[z++]=ve,ve=ve>>8,Y[z++]=ve,ve=ve>>8,Y[z++]=ve;let he=Number(F>>BigInt(32)&BigInt(4294967295));return Y[z++]=he,he=he>>8,Y[z++]=he,he=he>>8,Y[z++]=he,he=he>>8,Y[z++]=he,z}function le(Y,F,z,ie,pe){J(F,ie,pe,Y,z,7);let ve=Number(F&BigInt(4294967295));Y[z+7]=ve,ve=ve>>8,Y[z+6]=ve,ve=ve>>8,Y[z+5]=ve,ve=ve>>8,Y[z+4]=ve;let he=Number(F>>BigInt(32)&BigInt(4294967295));return Y[z+3]=he,he=he>>8,Y[z+2]=he,he=he>>8,Y[z+1]=he,he=he>>8,Y[z]=he,z+8}o.prototype.writeBigUInt64LE=Oe(function(F,z=0){return X(this,F,z,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Oe(function(F,z=0){return le(this,F,z,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(F,z,ie,pe){if(F=+F,z=z>>>0,!pe){const Ze=Math.pow(2,8*ie-1);M(this,F,z,ie,Ze-1,-Ze)}let ve=0,he=1,Le=0;for(this[z]=F&255;++ve>0)-Le&255;return z+ie},o.prototype.writeIntBE=function(F,z,ie,pe){if(F=+F,z=z>>>0,!pe){const Ze=Math.pow(2,8*ie-1);M(this,F,z,ie,Ze-1,-Ze)}let ve=ie-1,he=1,Le=0;for(this[z+ve]=F&255;--ve>=0&&(he*=256);)F<0&&Le===0&&this[z+ve+1]!==0&&(Le=1),this[z+ve]=(F/he>>0)-Le&255;return z+ie},o.prototype.writeInt8=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,1,127,-128),F<0&&(F=255+F+1),this[z]=F&255,z+1},o.prototype.writeInt16LE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,2,32767,-32768),this[z]=F&255,this[z+1]=F>>>8,z+2},o.prototype.writeInt16BE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,2,32767,-32768),this[z]=F>>>8,this[z+1]=F&255,z+2},o.prototype.writeInt32LE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,4,2147483647,-2147483648),this[z]=F&255,this[z+1]=F>>>8,this[z+2]=F>>>16,this[z+3]=F>>>24,z+4},o.prototype.writeInt32BE=function(F,z,ie){return F=+F,z=z>>>0,ie||M(this,F,z,4,2147483647,-2147483648),F<0&&(F=4294967295+F+1),this[z]=F>>>24,this[z+1]=F>>>16,this[z+2]=F>>>8,this[z+3]=F&255,z+4},o.prototype.writeBigInt64LE=Oe(function(F,z=0){return X(this,F,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Oe(function(F,z=0){return le(this,F,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(Y,F,z,ie,pe,ve){if(z+ie>Y.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function ee(Y,F,z,ie,pe){return F=+F,z=z>>>0,pe||H(Y,F,z,4),r.write(Y,F,z,ie,23,4),z+4}o.prototype.writeFloatLE=function(F,z,ie){return ee(this,F,z,!0,ie)},o.prototype.writeFloatBE=function(F,z,ie){return ee(this,F,z,!1,ie)};function Z(Y,F,z,ie,pe){return F=+F,z=z>>>0,pe||H(Y,F,z,8),r.write(Y,F,z,ie,52,8),z+8}o.prototype.writeDoubleLE=function(F,z,ie){return Z(this,F,z,!0,ie)},o.prototype.writeDoubleBE=function(F,z,ie){return Z(this,F,z,!1,ie)},o.prototype.copy=function(F,z,ie,pe){if(!o.isBuffer(F))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!pe&&pe!==0&&(pe=this.length),z>=F.length&&(z=F.length),z||(z=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-z>>0,ie=ie===void 0?this.length:ie>>>0,F||(F=0);let ve;if(typeof F=="number")for(ve=z;ve2**32?pe=W(String(z)):typeof z=="bigint"&&(pe=String(z),(z>BigInt(2)**BigInt(32)||z<-(BigInt(2)**BigInt(32)))&&(pe=W(pe)),pe+="n"),ie+=` It must be ${F}. Received ${pe}`,ie},RangeError);function W(Y){let F="",z=Y.length;const ie=Y[0]==="-"?1:0;for(;z>=ie+4;z-=3)F=`_${Y.slice(z-3,z)}${F}`;return`${Y.slice(0,z)}${F}`}function q(Y,F,z){me(F,"offset"),(Y[F]===void 0||Y[F+z]===void 0)&&be(F,Y.length-(z+1))}function J(Y,F,z,ie,pe,ve){if(Y>z||Y= 0${he} and < 2${he} ** ${(ve+1)*8}${he}`:Le=`>= -(2${he} ** ${(ve+1)*8-1}${he}) and < 2 ** ${(ve+1)*8-1}${he}`,new te.ERR_OUT_OF_RANGE("value",Le,Y)}q(ie,pe,ve)}function me(Y,F){if(typeof Y!="number")throw new te.ERR_INVALID_ARG_TYPE(F,"number",Y)}function be(Y,F,z){throw Math.floor(Y)!==Y?(me(Y,z),new te.ERR_OUT_OF_RANGE("offset","an integer",Y)):F<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${F}`,Y)}const Ce=/[^+/0-9A-Za-z-_]/g;function Fe(Y){if(Y=Y.split("=")[0],Y=Y.trim().replace(Ce,""),Y.length<2)return"";for(;Y.length%4!==0;)Y=Y+"=";return Y}function Ue(Y,F){F=F||1/0;let z;const ie=Y.length;let pe=null;const ve=[];for(let he=0;he55295&&z<57344){if(!pe){if(z>56319){(F-=3)>-1&&ve.push(239,191,189);continue}else if(he+1===ie){(F-=3)>-1&&ve.push(239,191,189);continue}pe=z;continue}if(z<56320){(F-=3)>-1&&ve.push(239,191,189),pe=z;continue}z=(pe-55296<<10|z-56320)+65536}else pe&&(F-=3)>-1&&ve.push(239,191,189);if(pe=null,z<128){if((F-=1)<0)break;ve.push(z)}else if(z<2048){if((F-=2)<0)break;ve.push(z>>6|192,z&63|128)}else if(z<65536){if((F-=3)<0)break;ve.push(z>>12|224,z>>6&63|128,z&63|128)}else if(z<1114112){if((F-=4)<0)break;ve.push(z>>18|240,z>>12&63|128,z>>6&63|128,z&63|128)}else throw new Error("Invalid code point")}return ve}function Ye(Y){const F=[];for(let z=0;z>8,pe=z%256,ve.push(pe),ve.push(ie);return ve}function xe(Y){return e.toByteArray(Fe(Y))}function He(Y,F,z,ie){let pe;for(pe=0;pe=F.length||pe>=Y.length);++pe)F[pe+z]=Y[pe];return pe}function Ve(Y,F){return Y instanceof F||Y!=null&&Y.constructor!=null&&Y.constructor.name!=null&&Y.constructor.name===F.name}function Ie(Y){return Y!==Y}const Ne=function(){const Y="0123456789abcdef",F=new Array(256);for(let z=0;z<16;++z){const ie=z*16;for(let pe=0;pe<16;++pe)F[ie+pe]=Y[z]+Y[pe]}return F}();function Oe(Y){return typeof BigInt>"u"?Me:Y}function Me(){throw new Error("BigInt not supported")}})(Xv);var wE,GD;function pSe(){if(GD)return wE;GD=1;function t(m,w){var E=Object.keys(m);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(m);w&&(v=v.filter(function(_){return Object.getOwnPropertyDescriptor(m,_).enumerable})),E.push.apply(E,v)}return E}function e(m){for(var w=1;w0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(E){var v={data:E,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";for(var v=this.head,_=""+v.data;v=v.next;)_+=E+v.data;return _}},{key:"concat",value:function(E){if(this.length===0)return c.alloc(0);for(var v=c.allocUnsafe(E>>>0),_=this.head,A=0;_;)g(_.data,v,A),A+=_.data.length,_=_.next;return v}},{key:"consume",value:function(E,v){var _;return EC.length?C.length:E;if(R===C.length?A+=C:A+=C.slice(0,E),E-=R,E===0){R===C.length?(++_,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=C.slice(R));break}++_}return this.length-=_,A}},{key:"_getBuffer",value:function(E){var v=c.allocUnsafe(E),_=this.head,A=1;for(_.data.copy(v),E-=_.data.length;_=_.next;){var C=_.data,R=E>C.length?C.length:E;if(C.copy(v,v.length-E,0,R),E-=R,E===0){R===C.length?(++A,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=C.slice(R));break}++A}return this.length-=A,v}},{key:h,value:function(E,v){return f(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),m}(),wE}function gSe(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(tI,this,t)):process.nextTick(tI,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(A5,r):(r._writableState.errorEmitted=!0,process.nextTick(KD,r,s)):process.nextTick(KD,r,s):e?(process.nextTick(A5,r),e(s)):process.nextTick(A5,r)}),this)}function KD(t,e){tI(t,e),A5(t)}function A5(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function mSe(){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 tI(t,e){t.emit("error",e)}function ySe(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var IQ={destroy:gSe,undestroy:mSe,errorOrDestroy:ySe},J0={};function vSe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var TQ={};function cl(t,e,r){r||(r=Error);function n(s,a,o){return typeof e=="string"?e:e(s,a,o)}var i=function(s){vSe(a,s);function a(o,l,c){return s.call(this,n(o,l,c))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=t,TQ[t]=i}function YD(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 wSe(t,e,r){return t.substr(0,e.length)===e}function bSe(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function _Se(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}cl("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);cl("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&wSe(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(bSe(t," argument"))i="The ".concat(t," ").concat(n," ").concat(YD(e,"type"));else{var s=_Se(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(YD(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);cl("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");cl("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});cl("ERR_STREAM_PREMATURE_CLOSE","Premature close");cl("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});cl("ERR_MULTIPLE_CALLBACK","Callback called multiple times");cl("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");cl("ERR_STREAM_WRITE_AFTER_END","write after end");cl("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);cl("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);cl("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");J0.codes=TQ;var xSe=J0.codes.ERR_INVALID_OPT_VALUE;function ESe(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function CSe(t,e,r,n){var i=ESe(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new xSe(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var $Q={getHighWaterMark:CSe},ASe=SSe;function SSe(t,e){if(bE("noDeprecation"))return t;var r=!1;function n(){if(!r){if(bE("throwDeprecation"))throw new Error(e);bE("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function bE(t){try{if(!Xt.localStorage)return!1}catch{return!1}var e=Xt.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var _E,ZD;function kQ(){if(ZD)return _E;ZD=1,_E=U;function t(ee){var Z=this;this.next=null,this.entry=null,this.finish=function(){H(Z,ee)}}var e;U.WritableState=B;var r={deprecate:ASe},n=AQ,i=Xv.Buffer,s=(typeof Xt<"u"?Xt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(ee){return i.from(ee)}function o(ee){return i.isBuffer(ee)||ee instanceof s}var l=IQ,c=$Q,u=c.getHighWaterMark,f=J0.codes,h=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_MULTIPLE_CALLBACK,w=f.ERR_STREAM_CANNOT_PIPE,E=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,A=f.ERR_UNKNOWN_ENCODING,C=l.errorOrDestroy;ia(U,n);function R(){}function B(ee,Z,te){e=e||cg(),ee=ee||{},typeof te!="boolean"&&(te=Z 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(W){P(Z,W)},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)}B.prototype.getBuffer=function(){for(var Z=this.bufferedRequest,te=[];Z;)te.push(Z),Z=Z.next;return te},function(){try{Object.defineProperty(B.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var S;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(S=Function.prototype[Symbol.hasInstance],Object.defineProperty(U,Symbol.hasInstance,{value:function(Z){return S.call(this,Z)?!0:this!==U?!1:Z&&Z._writableState instanceof B}})):S=function(Z){return Z instanceof this};function U(ee){e=e||cg();var Z=this instanceof e;if(!Z&&!S.call(U,this))return new U(ee);this._writableState=new B(ee,this,Z),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)}U.prototype.pipe=function(){C(this,new w)};function G(ee,Z){var te=new _;C(ee,te),process.nextTick(Z,te)}function ae(ee,Z,te,re){var W;return te===null?W=new v:typeof te!="string"&&!Z.objectMode&&(W=new h("chunk",["string","Buffer"],te)),W?(C(ee,W),process.nextTick(re,W),!1):!0}U.prototype.write=function(ee,Z,te){var re=this._writableState,W=!1,q=!re.objectMode&&o(ee);return q&&!i.isBuffer(ee)&&(ee=a(ee)),typeof Z=="function"&&(te=Z,Z=null),q?Z="buffer":Z||(Z=re.defaultEncoding),typeof te!="function"&&(te=R),re.ending?G(this,te):(q||ae(this,re,ee,te))&&(re.pendingcb++,W=N(this,re,q,ee,Z,te)),W},U.prototype.cork=function(){this._writableState.corked++},U.prototype.uncork=function(){var ee=this._writableState;ee.corked&&(ee.corked--,!ee.writing&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&j(this,ee))},U.prototype.setDefaultEncoding=function(Z){if(typeof Z=="string"&&(Z=Z.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Z+"").toLowerCase())>-1))throw new A(Z);return this._writableState.defaultEncoding=Z,this},Object.defineProperty(U.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function K(ee,Z,te){return!ee.objectMode&&ee.decodeStrings!==!1&&typeof Z=="string"&&(Z=i.from(Z,te)),Z}Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(ee,Z,te,re,W,q){if(!te){var J=K(Z,re,W);re!==J&&(te=!0,W="buffer",re=J)}var me=Z.objectMode?1:re.length;Z.length+=me;var be=Z.length */(function(t,e){var r=Xv,n=r.Buffer;function i(a,o){for(var l in a)o[l]=a[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(a,o,l){return n(a,o,l)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,o,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,o,l)},s.alloc=function(a,o,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var c=n(a);return o!==void 0?typeof l=="string"?c.fill(o,l):c.fill(o):c.fill(0),c},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(rI,rI.exports);var rh=rI.exports,QD;function XD(){if(QD)return EE;QD=1;var t=rh.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 _;;)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(_)return;v=(""+v).toLowerCase(),_=!0}}function n(v){var _=r(v);if(typeof _!="string"&&(t.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return _||v}EE.StringDecoder=i;function i(v){this.encoding=n(v);var _;switch(this.encoding){case"utf16le":this.text=f,this.end=h,_=4;break;case"utf8":this.fillLast=l,_=4;break;case"base64":this.text=g,this.end=m,_=3;break;default:this.write=w,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(_)}i.prototype.write=function(v){if(v.length===0)return"";var _,A;if(this.lastNeed){if(_=this.fillLast(v),_===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 a(v,_,A){var C=_.length-1;if(C=0?(R>0&&(v.lastNeed=R-1),R):--C=0?(R>0&&(v.lastNeed=R-2),R):--C=0?(R>0&&(R===2?R=0:v.lastNeed=R-3),R):0))}function o(v,_,A){if((_[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return v.lastNeed=2,"�"}}function l(v){var _=this.lastTotal-this.lastNeed,A=o(this,v);if(A!==void 0)return A;if(this.lastNeed<=v.length)return v.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,_,0,v.length),this.lastNeed-=v.length}function c(v,_){var A=a(this,v,_);if(!this.lastNeed)return v.toString("utf8",_);this.lastTotal=A;var C=v.length-(A-this.lastNeed);return v.copy(this.lastChar,0,C),v.toString("utf8",_,C)}function u(v){var _=v&&v.length?this.write(v):"";return this.lastNeed?_+"�":_}function f(v,_){if((v.length-_)%2===0){var A=v.toString("utf16le",_);if(A){var C=A.charCodeAt(A.length-1);if(C>=55296&&C<=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",_,v.length-1)}function h(v){var _=v&&v.length?this.write(v):"";if(this.lastNeed){var A=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,A)}return _}function g(v,_){var A=(v.length-_)%3;return A===0?v.toString("base64",_):(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",_,v.length-A))}function m(v){var _=v&&v.length?this.write(v):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function w(v){return v.toString(this.encoding)}function E(v){return v&&v.length?this.write(v):""}return EE}var eF=J0.codes.ERR_STREAM_PREMATURE_CLOSE;function ISe(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof J!="string"&&!Fe.objectMode&&Object.getPrototypeOf(J)!==n.prototype&&(J=s(J)),be)Fe.endEmitted?R(q,new v):K(q,Fe,J,!0);else if(Fe.ended)R(q,new w);else{if(Fe.destroyed)return!1;Fe.reading=!1,Fe.decoder&&!me?(J=Fe.decoder.write(J),Fe.objectMode||J.length!==0?K(q,Fe,J,!1):j(q,Fe)):K(q,Fe,J,!1)}else be||(Fe.reading=!1,j(q,Fe))}return!Fe.ended&&(Fe.length=k?q=k:(q--,q|=q>>>1,q|=q>>>2,q|=q>>>4,q|=q>>>8,q|=q>>>16,q++),q}function x(q,J){return q<=0||J.length===0&&J.ended?0:J.objectMode?1:q!==q?J.flowing&&J.length?J.buffer.head.data.length:J.length:(q>J.highWaterMark&&(J.highWaterMark=b(q)),q<=J.length?q:J.ended?J.length:(J.needReadable=!0,0))}G.prototype.read=function(q){l("read",q),q=parseInt(q,10);var J=this._readableState,me=q;if(q!==0&&(J.emittedReadable=!1),q===0&&J.needReadable&&((J.highWaterMark!==0?J.length>=J.highWaterMark:J.length>0)||J.ended))return l("read: emitReadable",J.length,J.ended),J.length===0&&J.ended?te(this):D(this),null;if(q=x(q,J),q===0&&J.ended)return J.length===0&&te(this),null;var be=J.needReadable;l("need readable",be),(J.length===0||J.length-q0?Ce=Z(q,J):Ce=null,Ce===null?(J.needReadable=J.length<=J.highWaterMark,q=0):(J.length-=q,J.awaitDrain=0),J.length===0&&(J.ended||(J.needReadable=!0),me!==q&&J.ended&&te(this)),Ce!==null&&this.emit("data",Ce),Ce};function P(q,J){if(l("onEofChunk"),!J.ended){if(J.decoder){var me=J.decoder.end();me&&me.length&&(J.buffer.push(me),J.length+=J.objectMode?1:me.length)}J.ended=!0,J.sync?D(q):(J.needReadable=!1,J.emittedReadable||(J.emittedReadable=!0,O(q)))}}function D(q){var J=q._readableState;l("emitReadable",J.needReadable,J.emittedReadable),J.needReadable=!1,J.emittedReadable||(l("emitReadable",J.flowing),J.emittedReadable=!0,process.nextTick(O,q))}function O(q){var J=q._readableState;l("emitReadable_",J.destroyed,J.length,J.ended),!J.destroyed&&(J.length||J.ended)&&(q.emit("readable"),J.emittedReadable=!1),J.needReadable=!J.flowing&&!J.ended&&J.length<=J.highWaterMark,ee(q)}function j(q,J){J.readingMore||(J.readingMore=!0,process.nextTick(T,q,J))}function T(q,J){for(;!J.reading&&!J.ended&&(J.length1&&W(be.pipes,q)!==-1)&&!xe&&(l("false write response, pause",be.awaitDrain),be.awaitDrain++),me.pause())}function Ie(Y){l("onerror",Y),Me(),q.removeListener("error",Ie),e(q,"error")===0&&R(q,Y)}S(q,"error",Ie);function Ne(){q.removeListener("finish",Oe),Me()}q.once("close",Ne);function Oe(){l("onfinish"),q.removeListener("close",Ne),Me()}q.once("finish",Oe);function Me(){l("unpipe"),me.unpipe(q)}return q.emit("pipe",me),be.flowing||(l("pipe resume"),me.resume()),q};function L(q){return function(){var me=q._readableState;l("pipeOnDrain",me.awaitDrain),me.awaitDrain&&me.awaitDrain--,me.awaitDrain===0&&e(q,"data")&&(me.flowing=!0,ee(q))}}G.prototype.unpipe=function(q){var J=this._readableState,me={hasUnpiped:!1};if(J.pipesCount===0)return this;if(J.pipesCount===1)return q&&q!==J.pipes?this:(q||(q=J.pipes),J.pipes=null,J.pipesCount=0,J.flowing=!1,q&&q.emit("unpipe",this,me),this);if(!q){var be=J.pipes,Ce=J.pipesCount;J.pipes=null,J.pipesCount=0,J.flowing=!1;for(var Fe=0;Fe0,be.flowing!==!1&&this.resume()):q==="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?D(this):be.reading||process.nextTick(X,this)),me},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(q,J){var me=r.prototype.removeListener.call(this,q,J);return q==="readable"&&process.nextTick(M,this),me},G.prototype.removeAllListeners=function(q){var J=r.prototype.removeAllListeners.apply(this,arguments);return(q==="readable"||q===void 0)&&process.nextTick(M,this),J};function M(q){var J=q._readableState;J.readableListening=q.listenerCount("readable")>0,J.resumeScheduled&&!J.paused?J.flowing=!0:q.listenerCount("data")>0&&q.resume()}function X(q){l("readable nexttick read 0"),q.read(0)}G.prototype.resume=function(){var q=this._readableState;return q.flowing||(l("resume"),q.flowing=!q.readableListening,le(this,q)),q.paused=!1,this};function le(q,J){J.resumeScheduled||(J.resumeScheduled=!0,process.nextTick(H,q,J))}function H(q,J){l("resume",J.reading),J.reading||q.read(0),J.resumeScheduled=!1,q.emit("resume"),ee(q),J.flowing&&!J.reading&&q.read(0)}G.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(q){var J=q._readableState;for(l("flow",J.flowing);J.flowing&&q.read()!==null;);}G.prototype.wrap=function(q){var J=this,me=this._readableState,be=!1;q.on("end",function(){if(l("wrapped end"),me.decoder&&!me.ended){var Ue=me.decoder.end();Ue&&Ue.length&&J.push(Ue)}J.push(null)}),q.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 Ye=J.push(Ue);Ye||(be=!0,q.pause())}});for(var Ce in q)this[Ce]===void 0&&typeof q[Ce]=="function"&&(this[Ce]=function(Ye){return function(){return q[Ye].apply(q,arguments)}}(Ce));for(var Fe=0;Fe=J.length?(J.decoder?me=J.buffer.join(""):J.buffer.length===1?me=J.buffer.first():me=J.buffer.concat(J.length),J.buffer.clear()):me=J.buffer.consume(q,J.decoder),me}function te(q){var J=q._readableState;l("endReadable",J.endEmitted),J.endEmitted||(J.ended=!0,process.nextTick(re,J,q))}function re(q,J){if(l("endReadableNT",q.endEmitted,q.length),!q.endEmitted&&q.length===0&&(q.endEmitted=!0,J.readable=!1,J.emit("end"),q.autoDestroy)){var me=J._writableState;(!me||me.autoDestroy&&me.finished)&&J.destroy()}}typeof Symbol=="function"&&(G.from=function(q,J){return C===void 0&&(C=NSe()),C(G,q,J)});function W(q,J){for(var me=0,be=q.length;me0;return zSe(a,l,c,function(u){i||(i=u),u&&s.forEach(aF),!l&&(s.forEach(aF),n(i))})});return e.reduce(HSe)}var GSe=VSe;(function(t,e){e=t.exports=PQ(),e.Stream=e,e.Readable=e,e.Writable=kQ(),e.Duplex=cg(),e.Transform=RQ,e.PassThrough=DSe,e.finished=Vk,e.pipeline=GSe})(eI,eI.exports);var jQ=eI.exports;const{Transform:KSe}=jQ;var YSe=t=>class LQ extends KSe{constructor(r,n,i,s,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=a,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_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 LQ(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:ZSe}=jQ;var JSe=t=>class DQ extends ZSe{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_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 DQ(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const QSe=YSe,XSe=JSe;var eIe=function(t){const e=QSe(t),r=XSe(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)}}},FQ={};const oF=[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];FQ.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],s=t[3]^t[13]^t[23]^t[33]^t[43],a=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|s>>>31),g=f^(s<<1|i>>>31);const m=t[0]^h,w=t[1]^g,E=t[10]^h,v=t[11]^g,_=t[20]^h,A=t[21]^g,C=t[30]^h,R=t[31]^g,B=t[40]^h,S=t[41]^g;h=r^(a<<1|o>>>31),g=n^(o<<1|a>>>31);const U=t[2]^h,G=t[3]^g,ae=t[12]^h,K=t[13]^g,N=t[22]^h,k=t[23]^g,b=t[32]^h,x=t[33]^g,P=t[42]^h,D=t[43]^g;h=i^(l<<1|c>>>31),g=s^(c<<1|l>>>31);const O=t[4]^h,j=t[5]^g,T=t[14]^h,L=t[15]^g,M=t[24]^h,X=t[25]^g,le=t[34]^h,H=t[35]^g,ee=t[44]^h,Z=t[45]^g;h=a^(u<<1|f>>>31),g=o^(f<<1|u>>>31);const te=t[6]^h,re=t[7]^g,W=t[16]^h,q=t[17]^g,J=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 Ye=t[8]^h,lt=t[9]^g,xe=t[18]^h,He=t[19]^g,Ve=t[28]^h,Ie=t[29]^g,Ne=t[38]^h,Oe=t[39]^g,Me=t[48]^h,Y=t[49]^g,F=m,z=w,ie=v<<4|E>>>28,pe=E<<4|v>>>28,ve=_<<3|A>>>29,he=A<<3|_>>>29,Le=R<<9|C>>>23,Ze=C<<9|R>>>23,et=B<<18|S>>>14,it=S<<18|B>>>14,ut=U<<1|G>>>31,pt=G<<1|U>>>31,tr=K<<12|ae>>>20,Wt=ae<<12|K>>>20,At=N<<10|k>>>22,mt=k<<10|N>>>22,Ct=x<<13|b>>>19,dt=b<<13|x>>>19,Nt=P<<2|D>>>30,jt=D<<2|P>>>30,gt=j<<30|O>>>2,Vt=O<<30|j>>>2,zt=T<<6|L>>>26,ot=L<<6|T>>>26,Gt=X<<11|M>>>21,Ft=M<<11|X>>>21,yt=le<<15|H>>>17,Qe=H<<15|le>>>17,Ot=Z<<29|ee>>>3,_t=ee<<29|Z>>>3,Zt=te<<28|re>>>4,Cr=re<<28|te>>>4,qt=q<<23|W>>>9,Ar=W<<23|q>>>9,cr=J<<25|me>>>7,br=me<<25|J>>>7,Q=be<<21|Ce>>>11,se=Ce<<21|be>>>11,de=Ue<<24|Fe>>>8,ue=Fe<<24|Ue>>>8,we=Ye<<27|lt>>>5,Re=lt<<27|Ye>>>5,qe=xe<<20|He>>>12,Be=He<<20|xe>>>12,tt=Ie<<7|Ve>>>25,wt=Ve<<7|Ie>>>25,Pt=Ne<<8|Oe>>>24,Et=Oe<<8|Ne>>>24,ir=Me<<14|Y>>>18,Qt=Y<<14|Me>>>18;t[0]=F^~tr&Gt,t[1]=z^~Wt&Ft,t[10]=Zt^~qe&ve,t[11]=Cr^~Be&he,t[20]=ut^~zt&cr,t[21]=pt^~ot&br,t[30]=we^~ie&At,t[31]=Re^~pe&mt,t[40]=gt^~qt&tt,t[41]=Vt^~Ar&wt,t[2]=tr^~Gt&Q,t[3]=Wt^~Ft&se,t[12]=qe^~ve&Ct,t[13]=Be^~he&dt,t[22]=zt^~cr&Pt,t[23]=ot^~br&Et,t[32]=ie^~At&yt,t[33]=pe^~mt&Qe,t[42]=qt^~tt&Le,t[43]=Ar^~wt&Ze,t[4]=Gt^~Q&ir,t[5]=Ft^~se&Qt,t[14]=ve^~Ct&Ot,t[15]=he^~dt&_t,t[24]=cr^~Pt&et,t[25]=br^~Et&it,t[34]=At^~yt&de,t[35]=mt^~Qe&ue,t[44]=tt^~Le&Nt,t[45]=wt^~Ze&jt,t[6]=Q^~ir&F,t[7]=se^~Qt&z,t[16]=Ct^~Ot&Zt,t[17]=dt^~_t&Cr,t[26]=Pt^~et&ut,t[27]=Et^~it&pt,t[36]=yt^~de&we,t[37]=Qe^~ue&Re,t[46]=Le^~Nt>,t[47]=Ze^~jt&Vt,t[8]=ir^~F&tr,t[9]=Qt^~z&Wt,t[18]=Ot^~Zt&qe,t[19]=_t^~Cr&Be,t[28]=et^~ut&zt,t[29]=it^~pt&ot,t[38]=de^~we&ie,t[39]=ue^~Re&pe,t[48]=Nt^~gt&qt,t[49]=jt^~Vt&Ar,t[0]^=oF[e*2],t[1]^=oF[e*2+1]}};const B4=FQ;function Yg(){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}Yg.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};Yg.prototype.absorb=function(t){for(let e=0;e>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(B4.p1600(this.state),this.count=0);return e};Yg.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 tIe=Yg,rIe=eIe(tIe);const nIe=rIe;function UQ(t){return Buffer.allocUnsafe(t).fill(0)}function iIe(t){return t.toString(2).length}function BQ(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=GQ(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(s in e)i.push(Ic(t,e[s]));if(r==="dynamic"){var a=Ic("uint256",e.length);i.unshift(a)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([Ic("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,Hs.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=F1(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return Hs.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=F1(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=Uh(e);const o=Hs.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 Hs.bufferBEFromBigInt(n,32)}else if(t.startsWith("int")){if(r=F1(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=Uh(e);const o=Hs.bitLengthFromBigInt(n);if(o>r)throw new Error("Supplied int exceeds width: "+r+" vs "+o);const l=Hs.twosFromBigInt(n,256);return Hs.bufferBEFromBigInt(l,32)}else if(t.startsWith("ufixed")){if(r=lF(t),n=Uh(e),n<0)throw new Error("Supplied ufixed is negative");return Ic("uint256",n*BigInt(2)**BigInt(r[1]))}else if(t.startsWith("fixed"))return r=lF(t),Ic("int256",Uh(e)*BigInt(2)**BigInt(r[1]))}throw new Error("Unsupported or invalid type: "+t)}function uIe(t){return t==="string"||t==="bytes"||GQ(t)==="dynamic"}function dIe(t){return t.lastIndexOf("]")===t.length-1}function fIe(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var a=VQ(t[s]),o=e[s],l=Ic(a,o);uIe(a)?(r.push(Ic("uint256",i)),n.push(l),i+=l.length):r.push(l)}return Buffer.concat(r.concat(n))}function KQ(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(Hs.setLengthRight(o,r))}else if(a.startsWith("uint")){if(r=F1(a),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=Uh(o);const l=Hs.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+l);i.push(Hs.bufferBEFromBigInt(n,r/8))}else if(a.startsWith("int")){if(r=F1(a),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=Uh(o);const l=Hs.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied int exceeds width: "+r+" vs "+l);const c=Hs.twosFromBigInt(n,r);i.push(Hs.bufferBEFromBigInt(c,r/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function hIe(t,e){return Hs.keccak(KQ(t,e))}var pIe={rawEncode:fIe,solidityPack:KQ,soliditySHA3:hIe};const Il=qQ,Ky=pIe,YQ={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"]},TE={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const a=(o,l,c)=>{if(r[l]!==void 0)return["bytes32",c==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Il.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",Il.keccak(c)];if(l==="string")return typeof c=="string"&&(c=Buffer.from(c,"utf8")),["bytes32",Il.keccak(c)];if(l.lastIndexOf("]")===l.length-1){const u=l.slice(0,l.lastIndexOf("[")),f=c.map(h=>a(o,u,h));return["bytes32",Il.keccak(Ky.rawEncode(f.map(([h])=>h),f.map(([,h])=>h)))]}return[l,c]};for(const o of r[t]){const[l,c]=a(o.name,o.type,e[o.name]);i.push(l),s.push(c)}}else for(const a of r[t]){let o=e[a.name];if(o!==void 0)if(a.type==="bytes")i.push("bytes32"),o=Il.keccak(o),s.push(o);else if(a.type==="string")i.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=Il.keccak(o),s.push(o);else if(r[a.type]!==void 0)i.push("bytes32"),o=Il.keccak(this.encodeData(a.type,o,r,n)),s.push(o);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(o)}}return Ky.rawEncode(i,s)},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:a,type:o})=>o+" "+a).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 Il.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Il.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in YQ.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)),Il.keccak(Buffer.concat(n))}};var gIe={TYPED_MESSAGE_SCHEMA:YQ,TypedDataUtils:TE,hashForSignTypedDataLegacy:function(t){return mIe(t.data)},hashForSignTypedData_v3:function(t){return TE.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return TE.hash(t.data)}};function mIe(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(s){return s.type==="bytes"?Il.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Ky.soliditySHA3(["bytes32","bytes32"],[Ky.soliditySHA3(new Array(t.length).fill("string"),i),Ky.soliditySHA3(n,r)])}var Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.APP_VERSION_KEY=Gc.LOCAL_STORAGE_ADDRESSES_KEY=Gc.WALLET_USER_NAME_KEY=void 0;Gc.WALLET_USER_NAME_KEY="walletUsername";Gc.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Gc.APP_VERSION_KEY="AppVersion";var ew={};Object.defineProperty(ew,"__esModule",{value:!0});ew.RelayEventManager=void 0;const yIe=Yt;class vIe{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,yIe.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}ew.RelayEventManager=vIe;var e_={},t_={},r_={};Object.defineProperty(r_,"__esModule",{value:!0});r_.WalletLinkCipher=void 0;const Ib=Yt;class wIe{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,Ib.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),o=16,l=a.slice(a.byteLength-o),c=a.slice(0,a.byteLength-o),u=new Uint8Array(l),f=new Uint8Array(c),h=new Uint8Array([...n,...u,...f]);return(0,Ib.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 s=await crypto.subtle.importKey("raw",(0,Ib.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,Ib.hexStringToUint8Array)(e),o=a.slice(0,12),l=a.slice(12,28),c=a.slice(28),u=new Uint8Array([...c,...l]),f={name:"AES-GCM",iv:new Uint8Array(o)};try{const h=await window.crypto.subtle.decrypt(f,s,u),g=new TextDecoder;n(g.decode(h))}catch(h){i(h)}})()})}}r_.WalletLinkCipher=wIe;var n_={};Object.defineProperty(n_,"__esModule",{value:!0});n_.WalletLinkHTTP=void 0;class bIe{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 s=(e=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}n_.WalletLinkHTTP=bIe;var ug={};Object.defineProperty(ug,"__esModule",{value:!0});ug.WalletLinkWebSocket=ug.ConnectionState=void 0;var E1;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(E1||(ug.ConnectionState=E1={}));class _Ie{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(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,E1.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,E1.DISCONNECTED)},i.onopen=s=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,E1.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},i.onmessage=s=>{var a,o;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(s.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,E1.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)}}ug.WalletLinkWebSocket=_Ie;Object.defineProperty(t_,"__esModule",{value:!0});t_.WalletLinkConnection=void 0;const cF=Gc,xIe=r_,EIe=n_,Tb=ug,Up=Is,uF=1e4,CIe=6e4;class AIe{constructor({session:e,linkAPIUrl:r,listener:n,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Up.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>a.JsonRpcUrl&&this.handleChainUpdated(l,a.JsonRpcUrl)]]).forEach((l,c)=>{const u=a[c];u!==void 0&&l(u)})},this.handleDestroyed=a=>{var o;a==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async a=>{var o;{const l=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.accountUpdated(l)}},this.handleMetadataUpdated=async(a,o)=>{var l;{const c=await this.cipher.decrypt(o);(l=this.listener)===null||l===void 0||l.metadataUpdated(a,c)}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(cF.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(cF.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,o)=>{var l;{const c=await this.cipher.decrypt(a),u=await this.cipher.decrypt(o);(l=this.listener)===null||l===void 0||l.chainUpdated(c,u)}},this.session=e,this.cipher=new xIe.WalletLinkCipher(e.secret),this.listener=n;const s=new Tb.WalletLinkWebSocket(`${r}/rpc`,i);s.setConnectionStateListener(async a=>{let o=!1;switch(a){case Tb.ConnectionState.DISCONNECTED:if(!this.destroyed){const l=async()=>{await new Promise(c=>setTimeout(c,5e3)),this.destroyed||s.connect().catch(()=>{l()})};l()}break;case Tb.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),o=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},uF),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Tb.ConnectionState.CONNECTING:break}this.connected!==o&&(this.connected=o)}),s.setIncomingDataListener(a=>{var o;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const l=a.type==="IsLinkedOK"?a.linked:void 0;this.linked=l||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((o=this.requestResolutions.get(a.id))===null||o===void 0||o(a))}),this.ws=s,this.http=new EIe.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,Up.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"}))),s={type:"PublishEvent",id:(0,Up.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>uF*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=CIe){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,Up.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,Up.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,Up.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}t_.WalletLinkConnection=AIe;var i_={},ZQ={exports:{}},JQ=rh.Buffer;function s_(t,e){this._block=JQ.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}s_.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=JQ.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,a=0;a=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 s=this._hash();return t?s.toString(t):s};s_.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Zg=s_,SIe=ia,QQ=Zg,IIe=rh.Buffer,TIe=[1518500249,1859775393,-1894007588,-899497514],$Ie=new Array(80);function tw(){this.init(),this._w=$Ie,QQ.call(this,64,56)}SIe(tw,QQ);tw.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function kIe(t){return t<<5|t>>>27}function NIe(t){return t<<30|t>>>2}function PIe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}tw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=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=kIe(r)+PIe(c,n,i,s)+a+e[l]+TIe[c]|0;a=s,s=i,i=NIe(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=s+this._d|0,this._e=a+this._e|0};tw.prototype._hash=function(){var t=IIe.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 RIe=tw,MIe=ia,XQ=Zg,OIe=rh.Buffer,jIe=[1518500249,1859775393,-1894007588,-899497514],LIe=new Array(80);function rw(){this.init(),this._w=LIe,XQ.call(this,64,56)}MIe(rw,XQ);rw.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function DIe(t){return t<<1|t>>>31}function FIe(t){return t<<5|t>>>27}function UIe(t){return t<<30|t>>>2}function BIe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}rw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=DIe(e[o-3]^e[o-8]^e[o-14]^e[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=FIe(r)+BIe(c,n,i,s)+a+e[l]+jIe[c]|0;a=s,s=i,i=UIe(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=s+this._d|0,this._e=a+this._e|0};rw.prototype._hash=function(){var t=OIe.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 WIe=rw,zIe=ia,eX=Zg,HIe=rh.Buffer,qIe=[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],VIe=new Array(64);function nw(){this.init(),this._w=VIe,eX.call(this,64,56)}zIe(nw,eX);nw.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 GIe(t,e,r){return r^t&(e^r)}function KIe(t,e,r){return t&e|r&(t|e)}function YIe(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function ZIe(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function JIe(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function QIe(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}nw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=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]=QIe(e[u-2])+e[u-7]+JIe(e[u-15])+e[u-16]|0;for(var f=0;f<64;++f){var h=c+ZIe(a)+GIe(a,o,l)+qIe[f]+e[f]|0,g=YIe(r)+KIe(r,n,i)|0;c=l,l=o,o=a,a=s+h|0,s=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=s+this._d|0,this._e=a+this._e|0,this._f=o+this._f|0,this._g=l+this._g|0,this._h=c+this._h|0};nw.prototype._hash=function(){var t=HIe.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 tX=nw,XIe=ia,eTe=tX,tTe=Zg,rTe=rh.Buffer,nTe=new Array(64);function a_(){this.init(),this._w=nTe,tTe.call(this,64,56)}XIe(a_,eTe);a_.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};a_.prototype._hash=function(){var t=rTe.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 iTe=a_,sTe=ia,rX=Zg,aTe=rh.Buffer,dF=[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],oTe=new Array(160);function iw(){this.init(),this._w=oTe,rX.call(this,128,112)}sTe(iw,rX);iw.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 fF(t,e,r){return r^t&(e^r)}function hF(t,e,r){return t&e|r&(t|e)}function pF(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function gF(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function lTe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function cTe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function uTe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function dTe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Ni(t,e){return t>>>0>>0?1:0}iw.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,a=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,E=this._gl|0,v=this._hl|0,_=0;_<32;_+=2)e[_]=t.readInt32BE(_*4),e[_+1]=t.readInt32BE(_*4+4);for(;_<160;_+=2){var A=e[_-30],C=e[_-15*2+1],R=lTe(A,C),B=cTe(C,A);A=e[_-2*2],C=e[_-2*2+1];var S=uTe(A,C),U=dTe(C,A),G=e[_-7*2],ae=e[_-7*2+1],K=e[_-16*2],N=e[_-16*2+1],k=B+ae|0,b=R+G+Ni(k,B)|0;k=k+U|0,b=b+S+Ni(k,U)|0,k=k+N|0,b=b+K+Ni(k,N)|0,e[_]=b,e[_+1]=k}for(var x=0;x<160;x+=2){b=e[x],k=e[x+1];var P=hF(r,n,i),D=hF(u,f,h),O=pF(r,u),j=pF(u,r),T=gF(a,m),L=gF(m,a),M=dF[x],X=dF[x+1],le=fF(a,o,l),H=fF(m,w,E),ee=v+L|0,Z=c+T+Ni(ee,v)|0;ee=ee+H|0,Z=Z+le+Ni(ee,H)|0,ee=ee+X|0,Z=Z+M+Ni(ee,X)|0,ee=ee+k|0,Z=Z+b+Ni(ee,k)|0;var te=j+D|0,re=O+P+Ni(te,j)|0;c=l,v=E,l=o,E=w,o=a,w=m,m=g+ee|0,a=s+Z+Ni(m,g)|0,s=i,g=h,i=n,h=f,n=r,f=u,u=ee+te|0,r=Z+re+Ni(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+E|0,this._hl=this._hl+v|0,this._ah=this._ah+r+Ni(this._al,u)|0,this._bh=this._bh+n+Ni(this._bl,f)|0,this._ch=this._ch+i+Ni(this._cl,h)|0,this._dh=this._dh+s+Ni(this._dl,g)|0,this._eh=this._eh+a+Ni(this._el,m)|0,this._fh=this._fh+o+Ni(this._fl,w)|0,this._gh=this._gh+l+Ni(this._gl,E)|0,this._hh=this._hh+c+Ni(this._hl,v)|0};iw.prototype._hash=function(){var t=aTe.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 nX=iw,fTe=ia,hTe=nX,pTe=Zg,gTe=rh.Buffer,mTe=new Array(160);function o_(){this.init(),this._w=mTe,pTe.call(this,128,112)}fTe(o_,hTe);o_.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};o_.prototype._hash=function(){var t=gTe.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 yTe=o_,Q0=ZQ.exports=function(e){e=e.toLowerCase();var r=Q0[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};Q0.sha=RIe;Q0.sha1=WIe;Q0.sha224=iTe;Q0.sha256=tX;Q0.sha384=yTe;Q0.sha512=nX;var vTe=ZQ.exports;Object.defineProperty(i_,"__esModule",{value:!0});i_.WalletLinkSession=void 0;const wTe=vTe,mF=Yt,yF="session:id",vF="session:secret",wF="session:linked";class Gk{constructor(e,r,n,i){this._storage=e,this._id=r||(0,mF.randomBytesHex)(16),this._secret=n||(0,mF.randomBytesHex)(32),this._key=new wTe.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(yF),n=e.getItem(wF),i=e.getItem(vF);return r&&i?new Gk(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(yF,this._id),this._storage.setItem(vF,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(wF,this._linked?"1":"0")}}i_.WalletLinkSession=Gk;var uo={};Object.defineProperty(uo,"__esModule",{value:!0});uo.isDarkMode=uo.isMobileWeb=uo.getLocation=uo.createQrUrl=void 0;function bTe(t,e,r,n,i,s){const a=n?"parent-id":"id",o=new URLSearchParams({[a]:t,secret:e,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${o}`}uo.createQrUrl=bTe;function _Te(){try{return window.frameElement!==null}catch{return!1}}function xTe(){try{return _Te()&&window.top?window.top.location:window.location}catch{return window.location}}uo.getLocation=xTe;function ETe(){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)}uo.isMobileWeb=ETe;function CTe(){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}uo.isDarkMode=CTe;var l_={},sw={},Kk={};Object.defineProperty(Kk,"__esModule",{value:!0});Kk.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 ATe=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sw,"__esModule",{value:!0});sw.injectCssReset=void 0;const STe=ATe(Kk);function ITe(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(STe.default)),document.documentElement.appendChild(t)}sw.injectCssReset=ITe;var Yk={};function iX(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&&(a.children=arguments.length>3?aw.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)a[s]===void 0&&(a[s]=t.defaultProps[s]);return Yy(t,a,n,i,null)}function Yy(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++aX,__i:-1,__u:0};return i==null&&Cn.vnode!=null&&Cn.vnode(s),s}function kTe(){return{current:null}}function ow(t){return t.children}function Zy(t,e){this.props=t,this.context=e}function dg(t,e){if(e==null)return t.__?dg(t.__,t.__i+1):null;for(var r;ee&&Bh.sort(nI));W4.__r=0}function hX(t,e,r,n,i,s,a,o,l,c,u){var f,h,g,m,w,E,v=n&&n.__k||dX,_=e.length;for(l=NTe(r,e,v,l,_),f=0;f<_;f++)(g=r.__k[f])!=null&&(h=g.__i===-1?iv:v[g.__i]||iv,g.__i=f,E=Qk(t,g,h,i,s,a,o,l,c,u),m=g.__e,g.ref&&h.ref!=g.ref&&(h.ref&&Xk(h.ref,null,g),u.push(g.ref,g.__c||m,g)),w==null&&m!=null&&(w=m),4&g.__u||h.__k===g.__k?l=pX(g,l,t):typeof g.type=="function"&&E!==void 0?l=E:m&&(l=m.nextSibling),g.__u&=-7);return r.__e=w,l}function NTe(t,e,r,n,i){var s,a,o,l,c,u=r.length,f=u,h=0;for(t.__k=new Array(i),s=0;s0?Yy(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=t,a.__b=t.__b+1,o=null,(c=a.__i=PTe(a,r,l,f))!==-1&&(f--,(o=r[c])&&(o.__u|=2)),o==null||o.__v===null?(c==-1&&h--,typeof a.type!="function"&&(a.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,a.__u|=4))):t.__k[s]=null;if(f)for(s=0;s(l!=null&&!(2&l.__u)?1:0))for(i=r-1,s=r+1;i>=0||s=0){if((l=e[i])&&!(2&l.__u)&&a==l.key&&o===l.type)return i;i--}if(s2&&(o.children=arguments.length>3?aw.call(arguments,2):r),Yy(t.type,o,n||t.key,i||t.ref,null)}function jTe(t,e){var r={__c:e="__cC"+uX++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=new Set,(s={})[e]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&i.forEach(function(o){o.__e=!0,oI(o)})},this.sub=function(a){i.add(a);var o=a.componentWillUnmount;a.componentWillUnmount=function(){i&&i.delete(a),o&&o.call(a)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}aw=dX.slice,Cn={__e:function(t,e,r,n){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),a=i.__d),a)return i.__E=i}catch(o){t=o}throw t}},aX=0,oX=function(t){return t!=null&&t.constructor==null},Zy.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),oI(this))},Zy.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),oI(this))},Zy.prototype.render=ow,Bh=[],lX=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,nI=function(t,e){return t.__v.__b-e.__v.__b},W4.__r=0,cX=/(PointerCapture)$|Capture$/i,Zk=0,iI=EF(!1),sI=EF(!0),uX=0;const LTe=Object.freeze(Object.defineProperty({__proto__:null,Component:Zy,Fragment:ow,cloneElement:OTe,createContext:jTe,createElement:aI,createRef:kTe,h:aI,hydrate:wX,get isValidElement(){return oX},get options(){return Cn},render:vX,toChildArray:gX},Symbol.toStringTag,{value:"Module"})),bX=Kf(LTe);var Cd,yn,$E,CF,fg=0,_X=[],Hn=Cn,AF=Hn.__b,SF=Hn.__r,IF=Hn.diffed,TF=Hn.__c,$F=Hn.unmount,kF=Hn.__;function X0(t,e){Hn.__h&&Hn.__h(yn,t,fg||e),fg=0;var r=yn.__H||(yn.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function xX(t){return fg=1,EX(AX,t)}function EX(t,e,r){var n=X0(Cd++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):AX(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=yn,!yn.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!s||s.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)}}),s&&s.call(this,o,l,c)||f};yn.u=!0;var s=yn.shouldComponentUpdate,a=yn.componentWillUpdate;yn.componentWillUpdate=function(o,l,c){if(this.__e){var u=s;s=void 0,i(o,l,c),s=u}a&&a.call(this,o,l,c)},yn.shouldComponentUpdate=i}return n.__N||n.__}function DTe(t,e){var r=X0(Cd++,3);!Hn.__s&&tN(r.__H,e)&&(r.__=t,r.i=e,yn.__H.__h.push(r))}function CX(t,e){var r=X0(Cd++,4);!Hn.__s&&tN(r.__H,e)&&(r.__=t,r.i=e,yn.__h.push(r))}function FTe(t){return fg=5,eN(function(){return{current:t}},[])}function UTe(t,e,r){fg=6,CX(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 eN(t,e){var r=X0(Cd++,7);return tN(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function BTe(t,e){return fg=8,eN(function(){return t},e)}function WTe(t){var e=yn.context[t.__c],r=X0(Cd++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(yn)),e.props.value):t.__}function zTe(t,e){Hn.useDebugValue&&Hn.useDebugValue(e?e(t):t)}function HTe(t){var e=X0(Cd++,10),r=xX();return e.__=t,yn.componentDidCatch||(yn.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function qTe(){var t=X0(Cd++,11);if(!t.__){for(var e=yn.__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 VTe(){for(var t;t=_X.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(S5),t.__H.__h.forEach(lI),t.__H.__h=[]}catch(e){t.__H.__h=[],Hn.__e(e,t.__v)}}Hn.__b=function(t){yn=null,AF&&AF(t)},Hn.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),kF&&kF(t,e)},Hn.__r=function(t){SF&&SF(t),Cd=0;var e=(yn=t.__c).__H;e&&($E===yn?(e.__h=[],yn.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(S5),e.__h.forEach(lI),e.__h=[],Cd=0)),$E=yn},Hn.diffed=function(t){IF&&IF(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(_X.push(e)!==1&&CF===Hn.requestAnimationFrame||((CF=Hn.requestAnimationFrame)||GTe)(VTe)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),$E=yn=null},Hn.__c=function(t,e){e.some(function(r){try{r.__h.forEach(S5),r.__h=r.__h.filter(function(n){return!n.__||lI(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Hn.__e(n,r.__v)}}),TF&&TF(t,e)},Hn.unmount=function(t){$F&&$F(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{S5(n)}catch(i){e=i}}),r.__H=void 0,e&&Hn.__e(e,r.__v))};var NF=typeof requestAnimationFrame=="function";function GTe(t){var e,r=function(){clearTimeout(n),NF&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);NF&&(e=requestAnimationFrame(r))}function S5(t){var e=yn,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),yn=e}function lI(t){var e=yn;t.__c=t.__(),yn=e}function tN(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function AX(t,e){return typeof e=="function"?e(t):e}const KTe=Object.freeze(Object.defineProperty({__proto__:null,useCallback:BTe,useContext:WTe,useDebugValue:zTe,useEffect:DTe,useErrorBoundary:HTe,useId:qTe,useImperativeHandle:UTe,useLayoutEffect:CX,useMemo:eN,useReducer:EX,useRef:FTe,useState:xX},Symbol.toStringTag,{value:"Module"})),YTe=Kf(KTe);var rN={};Object.defineProperty(rN,"__esModule",{value:!0});rN.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(sX),n=bX,i=YTe,s=uo,a=e(rN),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,s.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,a.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},h.children));t.SnackbarContainer=u;const f=({autoExpand:h,message:g,menuItems:m})=>{const[w,E]=(0,i.useState)(!0),[v,_]=(0,i.useState)(h??!1);(0,i.useEffect)(()=>{const C=[window.setTimeout(()=>{E(!1)},1),window.setTimeout(()=>{_(!0)},1e4)];return()=>{C.forEach(window.clearTimeout)}});const A=()=>{_(!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((C,R)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:C.onClick,key:R},(0,n.h)("svg",{width:C.svgWidth,height:C.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":C.defaultFillRule,"clip-rule":C.defaultClipRule,d:C.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",C.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},C.info)))))};t.SnackbarInstance=f})(Yk);Object.defineProperty(l_,"__esModule",{value:!0});l_.WalletLinkRelayUI=void 0;const ZTe=sw,JTe=Yk;class QTe{constructor(){this.attached=!1,this.snackbar=new JTe.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,ZTe.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)}}l_.WalletLinkRelayUI=QTe;var u_={},d_={},nN={};Object.defineProperty(nN,"__esModule",{value:!0});nN.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 SX=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(d_,"__esModule",{value:!0});d_.RedirectDialog=void 0;const XTe=SX(sX),kc=bX,e$e=sw,t$e=Yk,r$e=uo,n$e=SX(nN);class i$e{constructor(){this.root=null,this.darkMode=(0,r$e.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,e$e.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,kc.render)(null,this.root),e&&(0,kc.render)((0,kc.h)(s$e,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}d_.RedirectDialog=i$e;const s$e=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,kc.h)(t$e.SnackbarContainer,{darkMode:r},(0,kc.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,kc.h)("style",null,n$e.default),(0,kc.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,kc.h)("div",{class:(0,XTe.default)("-cbwsdk-redirect-dialog-box",s)},(0,kc.h)("p",null,t),(0,kc.h)("button",{onClick:n},e))))};var Kc={};Object.defineProperty(Kc,"__esModule",{value:!0});Kc.CBW_MOBILE_DEEPLINK_URL=Kc.WALLETLINK_URL=Kc.CB_KEYS_URL=void 0;Kc.CB_KEYS_URL="https://keys.coinbase.com/connect";Kc.WALLETLINK_URL="https://www.walletlink.org";Kc.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(u_,"__esModule",{value:!0});u_.WLMobileRelayUI=void 0;const a$e=d_,o$e=uo,l$e=Kc;class c$e{constructor(){this.attached=!1,this.redirectDialog=new a$e.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(l$e.CBW_MOBILE_DEEPLINK_URL);r.searchParams.append("redirect_url",(0,o$e.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()}}}u_.WLMobileRelayUI=c$e;Object.defineProperty(e_,"__esModule",{value:!0});e_.WalletLinkRelay=void 0;const u$e=t_,d$e=Gc,f$e=ew,kE=i_,Bp=Kg,h$e=uo,p$e=l_,PF=u_,g$e=fu,ai=Yt,m$e=hu;class Zu{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,h$e.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=s=>{this.isLinked=s;const a=this.storage.getItem(d$e.LOCAL_STORAGE_ADDRESSES_KEY);if(s&&(this._session.linked=s),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),l=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!s&&this._session.linked&&!l&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(s,a)=>{this.storage.setItem(s,a)},this.chainUpdated=(s,a)=>{this.chainCallbackParams.chainId===s&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:s,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(s,a))},this.accountUpdated=s=>{this.accountsCallback&&this.accountsCallback([s]),Zu.accountRequestCallbackIds.size>0&&(Array.from(Zu.accountRequestCallbackIds.values()).forEach(a=>{const o={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[s]}};this.invokeCallback(Object.assign(Object.assign({},o),{id:a}))}),Zu.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 f$e.RelayEventManager,this.ui=n}subscribe(){const e=kE.WalletLinkSession.load(this.storage)||new kE.WalletLinkSession(this.storage).save(),{linkAPIUrl:r}=this,n=new u$e.WalletLinkConnection({session:e,linkAPIUrl:r,listener:this}),i=this.isMobileWeb?new PF.WLMobileRelayUI:new p$e.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=kE.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&m$e.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,ai.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,ai.hexStringFromBuffer)(e,!0),signature:(0,ai.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,ai.bigIntStringFromBigInt)(e.weiValue),data:(0,ai.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ai.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,ai.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,ai.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,ai.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,ai.bigIntStringFromBigInt)(e.weiValue),data:(0,ai.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ai.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,ai.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,ai.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,ai.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,ai.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,ai.randomBytesHex)(8),i=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s),r==null||r()};return new Promise((s,a)=>{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 a(new Error(o.errorMessage));s(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 PF.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"){Zu.accountRequestCallbackIds.forEach(n=>this.invokeCallback(Object.assign(Object.assign({},e),{id:n}))),Zu.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n){var i;const s=(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:s}})}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,ai.randomBytesHex)(8);return new Promise((n,i)=>{this.relayEventManager.callbacks.set(r,s=>{if((0,Bp.isErrorResponse)(s))return i(new Error(s.errorMessage));n(s)}),Zu.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,e)})}watchAsset(e,r,n,i,s,a){const o={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let l=null;const c=(0,ai.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,s,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let l=null;const c=(0,ai.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,ai.randomBytesHex)(8);return new Promise((s,a)=>{this.relayEventManager.callbacks.set(i,o=>{if((0,Bp.isErrorResponse)(o)&&o.errorCode)return a(g$e.standardErrors.provider.custom({code:o.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,Bp.isErrorResponse)(o))return a(new Error(o.errorMessage));s(o)}),this.publishWeb3RequestEvent(i,n)})}}e_.WalletLinkRelay=Zu;Zu.accountRequestCallbackIds=new Set;var y$e=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K8,"__esModule",{value:!0});K8.WalletLinkSigner=void 0;const NE=y$e(gIe),RF=Gc,v$e=ew,Pu=Kg,w$e=e_,MF=Kc,Pi=fu,Wr=Yt,b$e=hu,PE="DefaultChainId",OF="DefaultJsonRpcUrl";class _$e{constructor(e){var r,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:i,appLogoUrl:s}=e.metadata;this._appName=i,this._appLogoUrl=s,this._storage=new b$e.ScopedLocalStorage("walletlink",MF.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new v$e.RelayEventManager,this._jsonRpcUrlFromOpts="";const a=this._storage.getItem(RF.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const l=a.split(" ");l[0]!==""&&(this._addresses=l.map(c=>(0,Wr.ensureAddressString)(c)),(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(PE)&&((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(OF))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(OF,e)}updateProviderInfo(e,r){var n;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(PE,r.toString(10)),((0,Wr.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,s,a){const l=await this.initializeRelay().watchAsset(e,r,n,i,s,a==null?void 0:a.toString());return(0,Pu.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(e,r,n,i,s,a){var o,l;if((0,Wr.ensureIntNumber)(e)===this.getChainId())return!1;const c=this.initializeRelay();this._isAuthorized()||await c.requestEthereumAccounts();const u=await c.addEthereumChain(e.toString(),r,s,n,i,a);return(0,Pu.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,Pu.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===Pi.standardErrorCodes.provider.unsupportedChain?Pi.standardErrors.provider.unsupportedChain():Pi.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 Pi.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 Pi.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 Pi.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}_setAddresses(e,r){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(s=>(0,Wr.ensureAddressString)(s));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(RF.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,Wr.ensureAddressString)(e);return this._addresses.map(i=>(0,Wr.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,Wr.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,Wr.ensureAddressString)(e.to):null,i=e.value!=null?(0,Wr.ensureBigInt)(e.value):BigInt(0),s=e.data?(0,Wr.ensureBuffer)(e.data):Buffer.alloc(0),a=e.nonce!=null?(0,Wr.ensureIntNumber)(e.nonce):null,o=e.gasPrice!=null?(0,Wr.ensureBigInt)(e.gasPrice):null,l=e.maxFeePerGas!=null?(0,Wr.ensureBigInt)(e.maxFeePerGas):null,c=e.maxPriorityFeePerGas!=null?(0,Wr.ensureBigInt)(e.maxPriorityFeePerGas):null,u=e.gas!=null?(0,Wr.ensureBigInt)(e.gas):null,f=e.chainId?(0,Wr.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:a,gasPriceInWei:o,maxFeePerGas:l,maxPriorityFeePerGas:c,gasLimit:u,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Pi.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Pi.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const a=await this.initializeRelay().signEthereumMessage(e,r,n,i);if((0,Pu.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?Pi.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){const s=await this.initializeRelay().ethereumAddressFromSignedMessage(e,r,n);if((0,Pu.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,Wr.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(PE);if(!e)return(0,Wr.ensureIntNumber)(1);const r=parseInt(e,10);return(0,Wr.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,Pu.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Pi.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,Wr.ensureAddressString)(e[0]),n=(0,Wr.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,Wr.ensureBuffer)(e[0]),n=(0,Wr.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,Wr.ensureBuffer)(e[0]),n=(0,Wr.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,Wr.ensureBuffer)(e[0]),n=(0,Wr.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,Pu.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)?Pi.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,Wr.ensureBuffer)(e[0]),i=await this.initializeRelay().submitEthereumTransaction(r,this.getChainId());if((0,Pu.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,Pu.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)?Pi.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,Wr.ensureParsedJSONObject)(e[0]),n=(0,Wr.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=NE.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,Wr.ensureAddressString)(e[0]),n=(0,Wr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=NE.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,Wr.ensureAddressString)(e[0]),n=(0,Wr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=NE.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _wallet_addEthereumChain(e){var r,n,i,s;const a=e[0];if(((r=a.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(!a.chainName||a.chainName.trim()==="")throw Pi.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw Pi.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(a.chainId,16);return await this.addEthereumChain(o,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(s=a.iconUrls)!==null&&s!==void 0?s:[],a.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 Pi.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw Pi.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw Pi.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw Pi.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:a,decimals:o}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,o,a,n)}}initializeRelay(){if(!this._relay){const e=new w$e.WalletLinkRelay({linkAPIUrl:MF.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}}K8.WalletLinkSigner=_$e;var Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.checkErrorForInvalidRequestArgs=Yo.getCoinbaseInjectedProvider=Yo.getCoinbaseInjectedSigner=Yo.fetchRPCRequest=void 0;const x$e=Y0,I5=fu;async function E$e(t,e){if(!e.rpcUrl)throw I5.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":x$e.LIB_VERSION}})).json()).result}Yo.fetchRPCRequest=E$e;function IX(){return globalThis.coinbaseWalletSigner}Yo.getCoinbaseInjectedSigner=IX;function C$e({metadata:t,preference:e}){var r,n,i;const s=globalThis;if(e.options!=="smartWalletOnly"){if(IX())return;const l=s.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 a=(n=s.ethereum)!==null&&n!==void 0?n:(i=s.top)===null||i===void 0?void 0:i.ethereum;if(a!=null&&a.isCoinbaseBrowser)return a}Yo.getCoinbaseInjectedProvider=C$e;function A$e(t){if(!t||typeof t!="object"||Array.isArray(t))return I5.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 I5.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 I5.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t})}Yo.checkErrorForInvalidRequestArgs=A$e;Object.defineProperty(Uc,"__esModule",{value:!0});Uc.createSigner=Uc.fetchSignerType=Uc.storeSignerType=Uc.loadSignerType=void 0;const S$e=q8,TX=K8,I$e=fu,T$e=Yo,$$e=hu,$X="SignerType",kX=new $$e.ScopedLocalStorage("CBWSDK","SignerConfigurator");function k$e(){return kX.getItem($X)}Uc.loadSignerType=k$e;function N$e(t){kX.setItem($X,t)}Uc.storeSignerType=N$e;async function P$e(t){const{communicator:e,metadata:r}=t;M$e(e,r).catch(()=>{});const n={id:crypto.randomUUID(),event:"selectSignerType",data:t.preference},{data:i}=await e.postRequestAndWaitForResponse(n);return i}Uc.fetchSignerType=P$e;function R$e(t){const{signerType:e,metadata:r,communicator:n,updateListener:i}=t;switch(e){case"scw":return new S$e.SCWSigner({metadata:r,updateListener:i,communicator:n});case"walletlink":return new TX.WalletLinkSigner({metadata:r,updateListener:i});case"extension":{const s=(0,T$e.getCoinbaseInjectedSigner)();if(!s)throw I$e.standardErrors.rpc.internal("injected signer not found");return s}}}Uc.createSigner=R$e;async function M$e(t,e){await t.onMessage(({event:n})=>n==="WalletLinkSessionRequest");const r=new TX.WalletLinkSigner({metadata:e});t.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var f_={},hg={};Object.defineProperty(hg,"__esModule",{value:!0});hg.closePopup=hg.openPopup=void 0;const O$e=fu,jF=420,LF=540;function j$e(t){const e=(window.innerWidth-jF)/2+window.screenX,r=(window.innerHeight-LF)/2+window.screenY,n=window.open(t,"Smart Wallet",`width=${jF}, height=${LF}, left=${e}, top=${r}`);if(n==null||n.focus(),!n)throw O$e.standardErrors.rpc.internal("Pop up window failed to open");return n}hg.openPopup=j$e;function L$e(t){t&&!t.closed&&t.close()}hg.closePopup=L$e;Object.defineProperty(f_,"__esModule",{value:!0});f_.Communicator=void 0;const D$e=Y0,DF=hg,F$e=Kc,FF=fu;class U$e{constructor(e=F$e.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 s=a=>{if(a.origin!==this.url.origin)return;const o=a.data;r(o)&&(n(o),window.removeEventListener("message",s),this.listeners.delete(s))};window.addEventListener("message",s),this.listeners.set(s,{reject:i})}),this.disconnect=()=>{(0,DF.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:r},n)=>{r(FF.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,DF.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:D$e.LIB_VERSION}})}).then(()=>{if(!this.popup)throw FF.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}f_.Communicator=U$e;var h_={};Object.defineProperty(h_,"__esModule",{value:!0});h_.determineMethodCategory=void 0;const UF={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 B$e(t){for(const e in UF){const r=e;if(UF[r].includes(t))return r}}h_.determineMethodCategory=B$e;var W$e=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,Xm.hexStringFromIntNumber)((0,kb.IntNumber)(this.chain.id))}),this.accounts;const u=await this.requestSignerSelection(),f=this.initSigner(u),h=await f.handshake();return this.signer=f,(0,Nb.storeSignerType)(u),this.emit("connect",{chainId:(0,Xm.hexStringFromIntNumber)((0,kb.IntNumber)(this.chain.id))}),h}catch(u){throw this.handleUnauthorizedError(u),u}},sign:async c=>{if(!this.connected||!this.signer)throw Wp.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,BF.fetchRPCRequest)(c,this.chain),state:c=>{const u=()=>{if(this.connected)return this.accounts;throw Wp.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(c.method){case"eth_chainId":return(0,Xm.hexStringFromIntNumber)((0,kb.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 Wp.standardErrors.rpc.methodNotSupported(`Method ${c} is deprecated.`)},unsupported:({method:c})=>{throw Wp.standardErrors.rpc.methodNotSupported(`Method ${c} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:c,source:u})=>{(0,Xm.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,Xm.hexStringFromIntNumber)((0,kb.IntNumber)(c.id))))}},this.metadata=i,this.preference=o,this.communicator=new V$e.Communicator(a),this.chain={id:(n=(r=i.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1};const l=(0,Nb.loadSignerType)();this.signer=l?this.initSigner(l):null}get connected(){return this.accounts.length>0}async request(e){var r;try{const n=(0,BF.checkErrorForInvalidRequestArgs)(e);if(n)throw n;const i=(r=(0,G$e.determineMethodCategory)(e.method))!==null&&r!==void 0?r:"fetch";return this.handlers[i](e)}catch(n){return Promise.reject((0,q$e.serializeError)(n,e.method))}}handleUnauthorizedError(e){e.code===Wp.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},K$e.ScopedLocalStorage.clearAll(),this.emit("disconnect",Wp.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,Nb.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,Nb.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}B8.CoinbaseWalletProvider=Y$e;Object.defineProperty(rv,"__esModule",{value:!0});rv.CoinbaseWalletSDK=void 0;const Z$e=U8,J$e=B8,Q$e=hu,X$e=Y0,eke=Yt,tke=Yo;class rke{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,eke.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var r;const n={metadata:this.metadata,preference:e};return(r=(0,tke.getCoinbaseInjectedProvider)(n))!==null&&r!==void 0?r:new J$e.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(e,r=240){return(0,Z$e.walletLogo)(e,r)}storeLatestVersion(){new Q$e.ScopedLocalStorage("CBWSDK").setItem("VERSION",X$e.LIB_VERSION)}}rv.CoinbaseWalletSDK=rke;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;const e=rv;t.default=e.CoinbaseWalletSDK;var r=rv;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}})})(tQ);const cI=({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"})]}),nke="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",nh={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"}}},NX={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},iN={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"}}},PX={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},Nd={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"}}},RX={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},ike={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},sN={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},ske={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},ake={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"}}},oke={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"}}},lke={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"}}},cke={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"}}},MX={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},uke={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},dke={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"}}},pu={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"}}},ep={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"}}},OX={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},Pd={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"}}},jX={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},fke={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/"}}},LX={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},DX={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"}}},hke={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},pke={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},z4=[nh,NX,LX,pu,ep,OX,Pd,jX,sN,ske,ake,oke,Nd,RX,ike,dke,MX,uke,iN,PX,DX,pke,hke,cke,fke,lke],FX=new Set(z4.map(t=>t.id));let UX=class extends Pn{constructor(){super("Wallet timeout"),this.type="wallet_error"}},BX=class extends Pn{constructor(){super("User rejected connection"),this.type="wallet_error"}};const tp=t=>{if(t instanceof Pn)return t;if(t!=null&&t.code&&(t!=null&&t.reason)){let e=new Vl(t);return t.code===xs.ACTION_REJECTED&&(e.details=qi.E4001_USER_REJECTED_REQUEST),e}return t!=null&&t.code?new Vl(t):new Pn("Unknown connector error",t)};let a0=class extends La{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}},Vl=class extends a0{constructor(e){var n,i,s;super(e.message,e.code,e.data);let r=Object.values(qi).find(a=>a.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:(s=e.message)!=null&&s.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=qi.E32002_WALLET_LOCKED))}};const ff={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 Ju(t){return t.type==="ethereum"}function uI(t,e){if(t.length!==e.length)return!1;for(let r=0;rt.rpcTimeouts&&t.rpcTimeouts[e]||D8;let Vs=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 tp(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 UX,i=this.rpcTimeoutDuration)=>new Promise((s,a)=>setTimeout(()=>{a(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 s;(s=this.walletProvider)==null||s.on(i.eventName,i.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=r||D8,this._subscriptions=[]}},H4=class extends Vs{constructor(e){super(e,e.rpcTimeoutDuration)}},dI=class extends Vs{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 ey(t){return t.chainType==="ethereum"}let Jg=class extends WX{buildConnectedWallet(e,r,n,i){let s=async()=>!!this.wallets.find(a=>Ir(a.address)===Ir(e));return{type:"ethereum",address:Ir(e),chainId:r,meta:n,imported:i,switchChain:async a=>{var h,g,m,w;let o,l;if(!s)throw new Pn("Wallet is not currently connected.");let c=(h=this.wallets.find(E=>Ir(E.address)===Ir(e)))==null?void 0:h.chainId;if(!c)throw new Pn("Unable to determine current chainId.");if(typeof a=="number"?(o=`0x${a.toString(16)}`,l=a):(o=a,l=Number(a)),c===w5(o))return;let u=this.chains.find(E=>E.id===l);if(!u)throw new Pn(`Unsupported chainId: ${a}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]})};try{return await f()}catch(E){if(((v,_)=>{var A;return _==="coinbase_wallet"?v.message.includes("addEthereumChain"):v.code===4902||((A=v.message)==null?void 0:A.includes("4902"))})(E,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=E.message)!=null&&w.includes("wallet_switchEthereumChain"))?new Pn(`Rainbow does not support the chainId ${r}`):E}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:s,getEthereumProvider:async()=>{if(!await s())throw new Pn("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await s())throw new Pn("Wallet is not currently connected.");return new _4(new H4(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await s())throw new Pn("Wallet is not currently connected.");return new dI(this.proxyProvider)},sign:async a=>{if(!await s())throw new Pn("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let r,n=e;try{if(n===void 0){let l=await qS(()=>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],s=Ir(i),a=[];if(this.walletClientType==="privy"){let l=Lt.get(pE(s));this.chains.find(c=>c.id===Number(l))||(Lt.del(pE(s)),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 qS(()=>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 ${LD}`,l),r=LD}let o=w5(r);if(!a.find(l=>Ir(l.address)===s)){let l={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet(Ir(i),o,l,this.connectorType==="embedded_imported"))}uI(a,this.wallets)||(this.wallets=a,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 _4(new H4(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=s=>{s.length===0?this.onDisconnect():this.syncAccounts(s)},this.onChainChanged=s=>{this.wallets.forEach(a=>{a.chainId=w5(s),this.walletClientType==="privy"&&Lt.put(pE(a.address),s)}),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=aN(i,e),this.connected=!1,this.initialized=!1}},Pb,gke=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],WF=(t,e)=>t.makeWeb3Provider({options:e}),mke=class extends Jg{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:nke,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 tp(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType=e==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(WF(Pb,this.connectionOptions))}constructor(e,r,n,i,s,a){if(super("coinbase_wallet",e,r,n),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new Vs(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"),!Pb){let o=[r.id].concat(e.map(c=>c.id)),l=this.connectionOptions!=="eoaOnly"?o.filter(c=>!gke.includes(c)):[];l.length>0&&!l.every(c=>FX.has(c))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${l.join(", ")}`),Pb=new tQ.CoinbaseWalletSDK({appName:s,appLogoUrl:a,appChainIds:o})}this.proxyProvider.setWalletProvider(WF(Pb,this.connectionOptions))}};const zX=({...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 zF=class extends Jg{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:[R4((e==null?void 0:e.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:zX,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:r,defaultChain:n,rpcConfig:i,imported:s,walletIndex:a}){super("privy",r,n,i),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=a,s&&(this.connectorType="embedded_imported"),this.subscribeListeners()}};const yke=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"],vke=t=>yke.includes(t),wke=({as:t="div",...e},r)=>d.jsx(t,{...e,ref:r}),bke=I.forwardRef(wke),_ke="https://challenges.cloudflare.com/turnstile/v0/api.js",q4="cf-turnstile-script",xke="cf-turnstile",HX="onloadTurnstileCallback",V4=t=>!!document.getElementById(t),Eke=({render:t="explicit",onLoadCallbackName:e=HX,scriptOptions:{nonce:r="",defer:n=!0,async:i=!0,id:s="",appendTo:a,onError:o,crossOrigin:l=""}={}})=>{const c=s||q4;if(V4(c))return;const u=document.createElement("script");if(u.id=c,u.src=`${_ke}?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),(a==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(u)},wc={normal:{width:300,height:65},compact:{width:130,height:120},invisible:{width:0,height:0,overflow:"hidden"},interactionOnly:{width:"fit-content",height:"auto"}};function Cke(t){let e;return t!=="invisible"&&(e=t),e}function Ake(t=q4){const[e,r]=I.useState(!1);return I.useEffect(()=>{const n=()=>{V4(t)&&r(!0)},i=new MutationObserver(n);return i.observe(document,{childList:!0,subtree:!0}),n(),()=>{i.disconnect()}},[t]),e}const qX=I.forwardRef((t,e)=>{const{scriptOptions:r,options:n={},siteKey:i,onWidgetLoad:s,onSuccess:a,onExpire:o,onError:l,onBeforeInteractive:c,onAfterInteractive:u,onUnsupported:f,onLoadScript:h,id:g,style:m,as:w="div",injectScript:E=!0,...v}=t,_=n.size??"normal",[A,C]=I.useState(n.execution==="execute"?wc.invisible:n.appearance==="interaction-only"?wc.interactionOnly:wc[_]),R=I.useRef(null),B=I.useRef(!1),[S,U]=I.useState(),[G,ae]=I.useState(!1),K=g??xke,N=E?(r==null?void 0:r.id)||`${q4}__${K}`:(r==null?void 0:r.id)||q4,k=Ake(N),b=r!=null&&r.onLoadCallbackName?`${r.onLoadCallbackName}__${K}`:`${HX}__${K}`,x=I.useMemo(()=>({sitekey:i,action:n.action,cData:n.cData,callback:a,"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:Cke(_),retry:n.retry??"auto","retry-interval":n.retryInterval??8e3,"refresh-expired":n.refreshExpired??"auto",execution:n.execution??"render",appearance:n.appearance??"always"}),[i,n,a,l,o,_,c,u,f]),P=I.useMemo(()=>JSON.stringify(x),[x]);return I.useImperativeHandle(e,()=>{if(typeof window>"u"||!k)return;const{turnstile:D}=window;return{getResponse(){if(!(D!=null&&D.getResponse)||!S){console.warn("Turnstile has not been loaded");return}return D.getResponse(S)},reset(){if(!(D!=null&&D.reset)||!S){console.warn("Turnstile has not been loaded");return}n.execution==="execute"&&C(wc.invisible);try{D.reset(S)}catch(O){console.warn(`Failed to reset Turnstile widget ${S}`,O)}},remove(){if(!(D!=null&&D.remove)||!S){console.warn("Turnstile has not been loaded");return}U(""),C(wc.invisible),D.remove(S)},render(){if(!(D!=null&&D.render)||!R.current||S){console.warn("Turnstile has not been loaded or widget already rendered");return}const O=D.render(R.current,x);return U(O),n.execution!=="execute"&&C(wc[_]),O},execute(){if(n.execution==="execute"){if(!(D!=null&&D.execute)||!R.current||!S){console.warn("Turnstile has not been loaded or widget has not been rendered");return}D.execute(R.current,x),C(wc[_])}},isExpired(){if(!(D!=null&&D.isExpired)||!S){console.warn("Turnstile has not been loaded");return}return D.isExpired(S)}}},[k,S,n.execution,_,x,R]),I.useEffect(()=>(window[b]=()=>ae(!0),()=>{delete window[b]}),[b]),I.useEffect(()=>{E&&!G&&Eke({onLoadCallbackName:b,scriptOptions:{...r,id:N}})},[E,G,b,r,N]),I.useEffect(()=>{k&&!G&&window.turnstile&&ae(!0)},[G,k]),I.useEffect(()=>{if(!i){console.warn("sitekey was not provided");return}if(!k||!R.current||!G||B.current)return;const D=window.turnstile.render(R.current,x);U(D),B.current=!0},[k,i,x,B,G]),I.useEffect(()=>{if(window.turnstile&&R.current&&S){V4(S)&&window.turnstile.remove(S);const D=window.turnstile.render(R.current,x);U(D),B.current=!0}},[P,i]),I.useEffect(()=>{if(window.turnstile&&S&&V4(S))return s==null||s(S),()=>{window.turnstile.remove(S)}},[S,s]),I.useEffect(()=>{C(n.execution==="execute"?wc.invisible:x.appearance==="interaction-only"?wc.interactionOnly:wc[_])},[n.execution,_,x.appearance]),I.useEffect(()=>{!k||typeof h!="function"||h()},[k,h]),d.jsx(bke,{ref:R,as:w,id:K,style:{...A,...m},...v})});qX.displayName="Turnstile";const Ske=t=>{let{enabled:e,siteKey:r,appId:n,setError:i,setToken:s,setExecuting:a,ref:o}=Co(),[,l]=I.useMemo(()=>(r==null?void 0:r.split("t:"))||[],[r]);if(I.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(qX,{...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"),a(!1)},onSuccess:c=>{var u;(u=t.onSuccess)==null||u.call(t,c),s(c),a(!1)},onExpire:()=>{var c,u;(c=t.onExpire)==null||c.call(t);try{(u=o.current)==null||u.reset(),i(void 0),s(void 0)}catch{i("expired_and_failed_reset")}}})})};var Ns=function(){return Ns=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0?Wi(Qg,--rl):0,mg--,gi===10&&(mg=1,g_--),gi}function Gl(){return gi=rl2||hI(gi)>3?"":" "}function jke(t,e){for(;--e&&Gl()&&!(gi<48||gi>102||gi>57&&gi<65||gi>70&&gi<97););return y_(t,$5()+(e<6&&o0()==32&&Gl()==32))}function pI(t){for(;Gl();)switch(gi){case t:return rl;case 34:case 39:t!==34&&t!==39&&pI(gi);break;case 40:t===41&&pI(t);break;case 92:Gl();break}return rl}function Lke(t,e){for(;Gl()&&t+gi!==57;)if(t+gi===84&&o0()===47)break;return"/*"+y_(e,rl-1)+"*"+lN(t===47?t:Gl())}function Dke(t){for(;!hI(o0());)Gl();return y_(t,rl)}function Fke(t){return Mke(k5("",null,null,null,[""],t=Rke(t),0,[0],t))}function k5(t,e,r,n,i,s,a,o,l){for(var c=0,u=0,f=a,h=0,g=0,m=0,w=1,E=1,v=1,_=0,A="",C=i,R=s,B=n,S=A;E;)switch(m=_,_=Gl()){case 40:if(m!=108&&Wi(S,f-1)==58){T5(S+=xr(RE(_),"&","&\f"),"&\f",KX(c?o[c-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:S+=RE(_);break;case 9:case 10:case 13:case 32:S+=Oke(m);break;case 92:S+=jke($5()-1,7);continue;case 47:switch(o0()){case 42:case 47:Ay(Uke(Lke(Gl(),$5()),e,r,l),l);break;default:S+="/"}break;case 123*w:o[c++]=Nc(S)*v;case 125*w:case 59:case 0:switch(_){case 0:case 125:E=0;case 59+u:v==-1&&(S=xr(S,/\f/g,"")),g>0&&Nc(S)-f&&Ay(g>32?VF(S+";",n,r,f-1,l):VF(xr(S," ","")+";",n,r,f-2,l),l);break;case 59:S+=";";default:if(Ay(B=qF(S,e,r,c,u,i,o,A,C=[],R=[],f,s),s),_===123)if(u===0)k5(S,e,B,B,C,s,f,o,R);else switch(h===99&&Wi(S,3)===110?100:h){case 100:case 108:case 109:case 115:k5(t,B,B,n&&Ay(qF(t,B,B,0,0,i,o,A,i,C=[],f,R),R),i,R,f,o,n?C:R);break;default:k5(S,B,B,B,[""],R,0,o,R)}}c=u=g=0,w=v=1,A=S="",f=a;break;case 58:f=1+Nc(S),g=m;default:if(w<1){if(_==123)--w;else if(_==125&&w++==0&&Pke()==125)continue}switch(S+=lN(_),_*w){case 38:v=u>0?1:(S+="\f",-1);break;case 44:o[c++]=(Nc(S)-1)*v,v=1;break;case 64:o0()===45&&(S+=RE(Gl())),h=o0(),u=f=Nc(A=S+=Dke($5())),_++;break;case 45:m===45&&Nc(S)==2&&(w=0)}}return s}function qF(t,e,r,n,i,s,a,o,l,c,u,f){for(var h=i-1,g=i===0?s:[""],m=ZX(g),w=0,E=0,v=0;w0?g[_]+" "+A:xr(A,/&\f/g,g[_])))&&(l[v++]=C);return m_(t,e,r,i===0?p_:o,l,c,u,f)}function Uke(t,e,r,n){return m_(t,e,r,VX,lN(Nke()),gg(t,2,-2),0,n)}function VF(t,e,r,n,i){return m_(t,e,r,oN,gg(t,0,n),gg(t,n+1,-1),n,i)}function QX(t,e,r){switch($ke(t,e)){case 5103:return en+"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 en+t+t;case 4789:return Jy+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return en+t+Jy+t+Nn+t+t;case 5936:switch(Wi(t,e+11)){case 114:return en+t+Nn+xr(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return en+t+Nn+xr(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return en+t+Nn+xr(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return en+t+Nn+t+t;case 6165:return en+t+Nn+"flex-"+t+t;case 5187:return en+t+xr(t,/(\w+).+(:[^]+)/,en+"box-$1$2"+Nn+"flex-$1$2")+t;case 5443:return en+t+Nn+"flex-item-"+xr(t,/flex-|-self/g,"")+(Wu(t,/flex-|baseline/)?"":Nn+"grid-row-"+xr(t,/flex-|-self/g,""))+t;case 4675:return en+t+Nn+"flex-line-pack"+xr(t,/align-content|flex-|-self/g,"")+t;case 5548:return en+t+Nn+xr(t,"shrink","negative")+t;case 5292:return en+t+Nn+xr(t,"basis","preferred-size")+t;case 6060:return en+"box-"+xr(t,"-grow","")+en+t+Nn+xr(t,"grow","positive")+t;case 4554:return en+xr(t,/([^-])(transform)/g,"$1"+en+"$2")+t;case 6187:return xr(xr(xr(t,/(zoom-|grab)/,en+"$1"),/(image-set)/,en+"$1"),t,"")+t;case 5495:case 3959:return xr(t,/(image-set\([^]*)/,en+"$1$`$1");case 4968:return xr(xr(t,/(.+:)(flex-)?(.*)/,en+"box-pack:$3"+Nn+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+en+t+t;case 4200:if(!Wu(t,/flex-|baseline/))return Nn+"grid-column-align"+gg(t,e)+t;break;case 2592:case 3360:return Nn+xr(t,"template-","")+t;case 4384:case 3616:return r&&r.some(function(n,i){return e=i,Wu(n.props,/grid-\w+-end/)})?~T5(t+(r=r[e].value),"span",0)?t:Nn+xr(t,"-start","")+t+Nn+"grid-row-span:"+(~T5(r,"span",0)?Wu(r,/\d+/):+Wu(r,/\d+/)-+Wu(t,/\d+/))+";":Nn+xr(t,"-start","")+t;case 4896:case 4128:return r&&r.some(function(n){return Wu(n.props,/grid-\w+-start/)})?t:Nn+xr(xr(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return xr(t,/(.+)-inline(.+)/,en+"$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(Nc(t)-1-e>6)switch(Wi(t,e+1)){case 109:if(Wi(t,e+4)!==45)break;case 102:return xr(t,/(.+:)(.+)-([^]+)/,"$1"+en+"$2-$3$1"+Jy+(Wi(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~T5(t,"stretch",0)?QX(xr(t,"stretch","fill-available"),e,r)+t:t}break;case 5152:case 5920:return xr(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,i,s,a,o,l,c){return Nn+i+":"+s+c+(a?Nn+i+"-span:"+(o?l:+l-+s)+c:"")+t});case 4949:if(Wi(t,e+6)===121)return xr(t,":",":"+en)+t;break;case 6444:switch(Wi(t,Wi(t,14)===45?18:11)){case 120:return xr(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+en+(Wi(t,14)===45?"inline-":"")+"box$3$1"+en+"$2$3$1"+Nn+"$2box$3")+t;case 100:return xr(t,":",":"+Nn)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return xr(t,"scroll-","scroll-snap-")+t}return t}function G4(t,e){for(var r="",n=0;n-1&&!t.return)switch(t.type){case oN:t.return=QX(t.value,t.length,r);return;case GX:return G4([ef(t,{value:xr(t.value,"@","@"+en)})],n);case p_:if(t.length)return kke(r=t.props,function(i){switch(Wu(i,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":zp(ef(t,{props:[xr(i,/:(read-\w+)/,":"+Jy+"$1")]})),zp(ef(t,{props:[i]})),fI(t,{props:HF(r,n)});break;case"::placeholder":zp(ef(t,{props:[xr(i,/:(plac\w+)/,":"+en+"input-$1")]})),zp(ef(t,{props:[xr(i,/:(plac\w+)/,":"+Jy+"$1")]})),zp(ef(t,{props:[xr(i,/:(plac\w+)/,Nn+"input-$1")]})),zp(ef(t,{props:[i]})),fI(t,{props:HF(r,n)});break}return""})}}var qke={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},to={},yg=typeof process<"u"&&to!==void 0&&(to.REACT_APP_SC_ATTR||to.SC_ATTR)||"data-styled",XX="active",eee="data-styled-version",v_="6.1.13",cN=`/*!sc*/ +`,K4=typeof window<"u"&&"HTMLElement"in window,Vke=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&to!==void 0&&to.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&to.REACT_APP_SC_DISABLE_SPEEDY!==""?to.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&to.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&to!==void 0&&to.SC_DISABLE_SPEEDY!==void 0&&to.SC_DISABLE_SPEEDY!==""&&to.SC_DISABLE_SPEEDY!=="false"&&to.SC_DISABLE_SPEEDY),Gke={},w_=Object.freeze([]),vg=Object.freeze({});function tee(t,e,r){return r===void 0&&(r=vg),t.theme!==r.theme&&t.theme||e||r.theme}var ree=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"]),Kke=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Yke=/(^-|-$)/g;function GF(t){return t.replace(Kke,"-").replace(Yke,"")}var Zke=/(a)(d)/gi,Rb=52,KF=function(t){return String.fromCharCode(t+(t>25?39:97))};function gI(t){var e,r="";for(e=Math.abs(t);e>Rb;e=e/Rb|0)r=KF(e%Rb)+r;return(KF(e%Rb)+r).replace(Zke,"$1-$2")}var ME,nee=5381,C1=function(t,e){for(var r=e.length;r;)t=33*t^e.charCodeAt(--r);return t},iee=function(t){return C1(nee,t)};function uN(t){return gI(iee(t)>>>0)}function Jke(t){return t.displayName||t.name||"Component"}function OE(t){return typeof t=="string"&&!0}var see=typeof Symbol=="function"&&Symbol.for,aee=see?Symbol.for("react.memo"):60115,Qke=see?Symbol.for("react.forward_ref"):60112,Xke={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},eNe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},oee={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},tNe=((ME={})[Qke]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ME[aee]=oee,ME);function YF(t){return("type"in(e=t)&&e.type.$$typeof)===aee?oee:"$$typeof"in t?tNe[t.$$typeof]:Xke;var e}var rNe=Object.defineProperty,nNe=Object.getOwnPropertyNames,ZF=Object.getOwnPropertySymbols,iNe=Object.getOwnPropertyDescriptor,sNe=Object.getPrototypeOf,JF=Object.prototype;function lee(t,e,r){if(typeof e!="string"){if(JF){var n=sNe(e);n&&n!==JF&&lee(t,n,r)}var i=nNe(e);ZF&&(i=i.concat(ZF(e)));for(var s=YF(t),a=YF(e),o=0;o0?" Args: ".concat(e.join(", ")):""))}var aNe=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,s=i;e>=s;)if((s<<=1)<0)throw lw(16,"".concat(e));this.groupSizes=new Uint32Array(s),this.groupSizes.set(n),this.length=s;for(var a=i;a=this.length||this.groupSizes[e]===0)return r;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),s=i+n,a=i;a=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&&(E+="".concat(v,","))}),l+="".concat(m).concat(w,'{content:"').concat(E,'"}').concat(cN)},u=0;u0?".".concat(e):h},u=l.slice();u.push(function(h){h.type===p_&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(yNe,r).replace(n,c))}),a.prefix&&u.push(Hke),u.push(Bke);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 E=h.replace(vNe,""),v=Fke(m||g?"".concat(m," ").concat(g," { ").concat(E," }"):E);a.namespace&&(v=uee(v,a.namespace));var _=[];return G4(v,Wke(u.concat(zke(function(A){return _.push(A)})))),_};return f.hash=l.length?l.reduce(function(h,g){return g.name||lw(15),C1(h,g.name)},nee).toString():"",f}var bNe=new J4,yI=wNe(),dee=It.createContext({shouldForwardProp:void 0,styleSheet:bNe,stylis:yI});dee.Consumer;It.createContext(void 0);function vI(){return I.useContext(dee)}var fee=function(){function t(e,r){var n=this;this.inject=function(i,s){s===void 0&&(s=yI);var a=n.name+s.hash;i.hasNameForId(n.id,a)||i.insertRules(n.id,a,s(n.rules,a,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=r,fN(this,function(){throw lw(12,String(n.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=yI),this.name+e.hash},t}(),_Ne=function(t){return t>="A"&&t<="Z"};function eU(t){for(var e="",r=0;r>>0);if(!r.hasNameForId(this.componentId,a)){var o=n(s,".".concat(a),void 0,this.componentId);r.insertRules(this.componentId,a,o)}i=Zh(i,a),this.staticRulesId=a}else{for(var l=C1(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=Zh(i,g)}}return i},t}(),hN=It.createContext(void 0);hN.Consumer;var jE={};function CNe(t,e,r){var n=dN(t),i=t,s=!OE(t),a=e.attrs,o=a===void 0?w_:a,l=e.componentId,c=l===void 0?function(C,R){var B=typeof C!="string"?"sc":GF(C);jE[B]=(jE[B]||0)+1;var S="".concat(B,"-").concat(uN(v_+B+jE[B]));return R?"".concat(R,"-").concat(S):S}(e.displayName,e.parentComponentId):l,u=e.displayName,f=u===void 0?function(C){return OE(C)?"styled.".concat(C):"Styled(".concat(Jke(C),")")}(t):u,h=e.displayName&&e.componentId?"".concat(GF(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=e.shouldForwardProp;m=function(C,R){return w(C,R)&&E(C,R)}}else m=w}var v=new ENe(r,h,n?i.componentStyle:void 0);function _(C,R){return function(B,S,U){var G=B.attrs,ae=B.componentStyle,K=B.defaultProps,N=B.foldedComponentIds,k=B.styledComponentId,b=B.target,x=It.useContext(hN),P=vI(),D=B.shouldForwardProp||P.shouldForwardProp,O=tee(S,x,K)||vg,j=function(H,ee,Z){for(var te,re=Ns(Ns({},ee),{className:void 0,theme:Z}),W=0;W2&&J4.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,r,n,i)},t}();function SNe(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 TNe=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"]),nU=t=>TNe.has(t),iU=(t,e,r)=>r.indexOf(t)===e;const $Ne=({input:t,overrides:e})=>e?e.primary.concat(e.overflow??[]).filter(nU).filter(iU):t?t.filter(nU).filter(iU):Za.appearance.walletList;function pN(t){let e=t.filter(r=>!FX.has(r.id));return z4.concat(e)}function kNe(t,e){return{...t,rpcUrls:{...t.rpcUrls,privy:{http:[e]}}}}const NNe="https://api.mainnet-beta.solana.com",PNe="https://api.testnet.solana.com",RNe="https://api.devnet.solana.com",bI=792703809,_I="11111111111111111111111111111111",MNe="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function gN(t){return t.includes("testnet")?"testnet":t.includes("devnet")?"devnet":"mainnet-beta"}function ONe(t,e){return`https://explorer.solana.com/tx/${t}?cluster=${e}`}function jNe(t,e){return`https://explorer.solana.com/account/${t}?cluster=${e}`}function LNe({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 Q4(t){"@babel/helpers - typeof";return Q4=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},Q4(t)}var DNe=/^\s+/,FNe=/\s+$/;function Mt(t,e){if(t=t||"",e=e||{},t instanceof Mt)return t;if(!(this instanceof Mt))return new Mt(t,e);var r=UNe(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}Mt.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,s,a,o;return r=e.r/255,n=e.g/255,i=e.b/255,r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*a+.0722*o},setAlpha:function(e){return this._a=vee(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=aU(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=aU(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=sU(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=sU(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 oU(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return HNe(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(jn(this._r,255)*100)+"%",g:Math.round(jn(this._g,255)*100)+"%",b:Math.round(jn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(jn(this._r,255)*100)+"%, "+Math.round(jn(this._g,255)*100)+"%, "+Math.round(jn(this._b,255)*100)+"%)":"rgba("+Math.round(jn(this._r,255)*100)+"%, "+Math.round(jn(this._g,255)*100)+"%, "+Math.round(jn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:rPe[oU(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+lU(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(e){var s=Mt(e);n="#"+lU(s._r,s._g,s._b,s._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,s=!r&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return s?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 Mt(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(KNe,arguments)},brighten:function(){return this._applyModification(YNe,arguments)},darken:function(){return this._applyModification(ZNe,arguments)},desaturate:function(){return this._applyModification(qNe,arguments)},saturate:function(){return this._applyModification(VNe,arguments)},greyscale:function(){return this._applyModification(GNe,arguments)},spin:function(){return this._applyModification(JNe,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(ePe,arguments)},complement:function(){return this._applyCombination(QNe,arguments)},monochromatic:function(){return this._applyCombination(tPe,arguments)},splitcomplement:function(){return this._applyCombination(XNe,arguments)},triad:function(){return this._applyCombination(cU,[3])},tetrad:function(){return this._applyCombination(cU,[4])}};Mt.fromRatio=function(t,e){if(Q4(t)=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=Sy(t[n]));t=r}return Mt(t,e)};function UNe(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,s=null,a=!1,o=!1;return typeof t=="string"&&(t=aPe(t)),Q4(t)=="object"&&(Ru(t.r)&&Ru(t.g)&&Ru(t.b)?(e=BNe(t.r,t.g,t.b),a=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ru(t.h)&&Ru(t.s)&&Ru(t.v)?(n=Sy(t.s),i=Sy(t.v),e=zNe(t.h,n,i),a=!0,o="hsv"):Ru(t.h)&&Ru(t.s)&&Ru(t.l)&&(n=Sy(t.s),s=Sy(t.l),e=WNe(t.h,n,s),a=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=vee(r),{ok:a,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 BNe(t,e,r){return{r:jn(t,255)*255,g:jn(e,255)*255,b:jn(r,255)*255}}function sU(t,e,r){t=jn(t,255),e=jn(e,255),r=jn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),s,a,o=(n+i)/2;if(n==i)s=a=0;else{var l=n-i;switch(a=o>.5?l/(2-n-i):l/(n+i),n){case t:s=(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=s=r;else{var o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;n=a(l,o,t+1/3),i=a(l,o,t),s=a(l,o,t-1/3)}return{r:n*255,g:i*255,b:s*255}}function aU(t,e,r){t=jn(t,255),e=jn(e,255),r=jn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),s,a,o=n,l=n-i;if(a=n===0?0:l/n,n==i)s=0;else{switch(n){case t:s=(e-r)/l+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,s.push(Mt(n));return s}function tPe(t,e){e=e||6;for(var r=Mt(t).toHsv(),n=r.h,i=r.s,s=r.v,a=[],o=1/e;e--;)a.push(Mt({h:n,s:i,v:s})),s=(s+o)%1;return a}Mt.mix=function(t,e,r){r=r===0?0:r||50;var n=Mt(t).toRgb(),i=Mt(e).toRgb(),s=r/100,a={r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a};return Mt(a)};Mt.readability=function(t,e){var r=Mt(t),n=Mt(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};Mt.isReadable=function(t,e,r){var n=Mt.readability(t,e),i,s;switch(s=!1,i=oPe(r),i.level+i.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s};Mt.mostReadable=function(t,e,r){var n=null,i=0,s,a,o,l;r=r||{},a=r.includeFallbackColors,o=r.level,l=r.size;for(var c=0;ci&&(i=s,n=Mt(e[c]));return Mt.isReadable(t,n,{level:o,size:l})||!a?n:(r.includeFallbackColors=!1,Mt.mostReadable(t,["#fff","#000"],r))};var xI=Mt.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"},rPe=Mt.hexNames=nPe(xI);function nPe(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function vee(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function jn(t,e){iPe(t)&&(t="100%");var r=sPe(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 b_(t){return Math.min(1,Math.max(0,t))}function Ja(t){return parseInt(t,16)}function iPe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function sPe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Fl(t){return t.length==1?"0"+t:""+t}function Sy(t){return t<=1&&(t=t*100+"%"),t}function wee(t){return Math.round(parseFloat(t)*255).toString(16)}function uU(t){return Ja(t)/255}var Tl=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 Ru(t){return!!Tl.CSS_UNIT.exec(t)}function aPe(t){t=t.replace(DNe,"").replace(FNe,"").toLowerCase();var e=!1;if(xI[t])t=xI[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Tl.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Tl.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Tl.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Tl.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Tl.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Tl.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Tl.hex8.exec(t))?{r:Ja(r[1]),g:Ja(r[2]),b:Ja(r[3]),a:uU(r[4]),format:e?"name":"hex8"}:(r=Tl.hex6.exec(t))?{r:Ja(r[1]),g:Ja(r[2]),b:Ja(r[3]),format:e?"name":"hex"}:(r=Tl.hex4.exec(t))?{r:Ja(r[1]+""+r[1]),g:Ja(r[2]+""+r[2]),b:Ja(r[3]+""+r[3]),a:uU(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=Tl.hex3.exec(t))?{r:Ja(r[1]+""+r[1]),g:Ja(r[2]+""+r[2]),b:Ja(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function oPe(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 dU="#FFFFFF";function lPe(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 ya(t,e){let r=Math.max(0,Math.min(1,t.toHsl().l+e));return Mt({...t.toHsl(),l:r})}function cPe({backgroundTheme:t,accentHex:e}){let r;switch(t){case"light":r=dU;break;case"dark":r="#1E1E1D";break;default:r=t}let n=Mt(r),i=Mt(e),s=Mt("#51BA81"),a=Mt("#FFB74D"),o=Mt("#EC6351"),l=lPe(n.getLuminance()),c=ya(n,l==="light"?-.04:.11),u=ya(n,l==="light"?-.08:.16),f=ya(n,l==="light"?-.88:.87),h=ya(n,l==="light"?-.7:.75),g=ya(n,l==="light"?-.43:.45).desaturate(l==="light"?60:20),m=ya(n,l==="light"?-.08:.25).desaturate(l==="light"?60:20),w=ya(i,.15),E=ya(i,.25),v=ya(i,-.06),_=ya(i,-.6),A=ya(o,.3),C=ya(a,.3),R=Mt(i.getLuminance()>.5?"#040217":dU),B=ya(s,-.16),S=ya(s,.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:E.toHslString(),accentDark:v.toHslString(),accentDarkest:_.toHslString(),foregroundAccent:R.toHslString(),success:s.toHslString(),successDark:B.toHslString(),successLight:S.toHslString(),error:o.toHslString(),errorLight:A.toHslString(),warn:a.toHslString(),warnLight:C.toHslString()}}function bee(t,e,r){var T,L,M,X,le,H,ee,Z,te,re,W,q,J,me,be,Ce,Fe,Ue,Ye,lt,xe,He,Ve,Ie,Ne,Oe,Me,Y,F,z,ie,pe,ve,he,Le,Ze,et,it,ut,pt,tr;let n,i,s,a,o,l,c,u,f,h,g,m,w,E,v,_,A=r?console.warn:()=>{};e!=null&&e.loginMethods?(n=e.loginMethods.includes("email"),i=e.loginMethods.includes("sms"),a=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=e.loginMethods.includes("farcaster"),v=e.loginMethods.includes("telegram")):(n=t.emailAuth,i=t.smsAuth,a=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,E=t.farcasterAuth,v=t.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?s=!1:t.passkeyAuth&&(s=!0);let C=[n,i].filter(Boolean),R=[o,l,c,m,f,h,u,g,w,E,v].filter(Boolean),B=[a].filter(Boolean);if(C.length+R.length+B.length===0)throw Error("You must enable at least one login method");let S=((T=e==null?void 0:e.appearance)==null?void 0:T.showWalletLoginFirst)!==void 0?(L=e==null?void 0:e.appearance)==null?void 0:L.showWalletLoginFirst:t.showWalletLoginFirst;S&&B.length===0?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):S||R.length+C.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0);let U=((X=(M=e==null?void 0:e.externalWallets)==null?void 0:M.walletConnect)==null?void 0:X.enabled)??!0;e!=null&&e.loginMethods&&e.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=$Ne({input:(le=e==null?void 0:e.appearance)==null?void 0:le.walletList,overrides:e==null?void 0:e.loginMethodsAndOrder}),ae=INe({input:e==null?void 0:e.loginMethodsAndOrder}),K=((H=e==null?void 0:e.intl)==null?void 0:H.defaultCountry)??"US",{chains:N,defaultChain:k}=dPe({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}),b=!!(e!=null&&e.defaultChain),x=((Z=e==null?void 0:e.customAuth)==null?void 0:Z.getCustomAccessToken)&&((te=e==null?void 0:e.customAuth)==null?void 0:te.enabled)!==!1,P=!(t.enforceWalletUis??1);if(_=t.legacyWalletUiConfig??1?x?((re=e==null?void 0:e.embeddedWallets)==null?void 0:re.noPromptOnSignature)??!0:((W=e==null?void 0:e.embeddedWallets)==null?void 0:W.noPromptOnSignature)??P:P,((q=e==null?void 0:e.embeddedWallets)==null?void 0:q.waitForTransactionConfirmation)===!1&&_!==!0)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:D,...O}=(e==null?void 0:e.embeddedWallets)??{},j=(e==null?void 0:e.solanaClusters)??[];return t.solanaWalletAuth&&!((me=(J=e==null?void 0:e.externalWallets)==null?void 0:J.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)??Za.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):(Ye=e==null?void 0:e.appearance)==null?void 0:Ye.loginMessage,palette:cPe({backgroundTheme:((lt=e==null?void 0:e.appearance)==null?void 0:lt.theme)??Za.appearance.theme,accentHex:((xe=e==null?void 0:e.appearance)==null?void 0:xe.accentColor)??t.accentColor??Za.appearance.accentColor}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!((He=e==null?void 0:e.appearance)!=null&&He.hideDirectWeb2Inputs),walletList:G,walletChainType:((Ve=e==null?void 0:e.appearance)==null?void 0:Ve.walletChainType)??(({evmWalletAuth:Wt,solanaWalletAuth:At})=>Wt&&At?"ethereum-and-solana":Wt?"ethereum-only":At?"solana-only":"ethereum-only")({evmWalletAuth:t.walletAuth??!1,solanaWalletAuth:t.solanaWalletAuth??!1})},loginMethods:{wallet:a,email:n,sms:i,passkey:s,google:o,twitter:l,discord:c,github:m,spotify:f,instagram:h,tiktok:u,linkedin:g,apple:w,farcaster:E,telegram:v},disablePlusEmails:t.disablePlusEmails,loginMethodsAndOrder:ae,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??Za.walletConnectCloudProjectId,rpcConfig:{rpcUrls:((Oe=e==null?void 0:e.rpcConfig)==null?void 0:Oe.rpcUrls)??Za.rpcConfig.rpcUrls,rpcTimeouts:((Me=e==null?void 0:e.rpcConfig)==null?void 0:Me.rpcTimeouts)??Za.rpcConfig.rpcTimeouts},chains:N,solanaClusters:{"mainnet-beta":((Y=j.find(Wt=>Wt.name==="mainnet-beta"))==null?void 0:Y.rpcUrl)||NNe,testnet:((F=j.find(Wt=>Wt.name==="testnet"))==null?void 0:F.rpcUrl)||PNe,devnet:((z=j.find(Wt=>Wt.name==="devnet"))==null?void 0:z.rpcUrl)||RNe},defaultChain:k,intl:{defaultCountry:K},shouldEnforceDefaultChainOnConnect:b,captchaEnabled:t.captchaEnabled??Za.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)??Za.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U},solana:{connectors:(he=(ve=e==null?void 0:e.externalWallets)==null?void 0:ve.solana)==null?void 0:he.connectors}},embeddedWallets:{...t.embeddedWalletConfig,...typeof D=="boolean"?{requireUserOwnedRecoveryOnCreate:D}:{},...x?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...O,noPromptOnSignature:_,showWalletUIs:(Le=e==null?void 0:e.embeddedWallets)==null?void 0:Le.showWalletUIs,extendedCalldataDecoding:(Ze=e==null?void 0:e.embeddedWallets)==null?void 0:Ze.extendedCalldataDecoding},mfa:{methods:t.mfaMethods??[],noPromptOnMfaRequired:((et=e==null?void 0:e.mfa)==null?void 0:et.noPromptOnMfaRequired)??!1},customAuth:x?{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)??Za._render.standalone},fundingConfig:t.fundingConfig,fundingMethodConfig:{...(e==null?void 0:e.fundingMethodConfig)??Za.fundingMethodConfig,moonpay:{...((ut=e==null?void 0:e.fundingMethodConfig)==null?void 0:ut.moonpay)??Za.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)??Za.fundingMethodConfig.moonpay.useSandbox}}}}function uPe(t,e){var l,c;if(!t)return{legacyCreateEmbeddedWalletFlag:e};let{appearance:r,additionalChains:n,supportedChains:i,defaultChain:s,externalWallets:a,...o}=t;return{...o,...n?{additionalChains:n.map(u=>u.id)}:void 0,...i?{supportedChains:i.map(u=>u.id)}:void 0,...s?{defaultChain:s.id}:void 0,...a?{walletConnect:a.walletConnect,coinbaseWallet:a.coinbaseWallet,solana:{connectors:(c=(l=a.solana)==null?void 0:l.connectors)==null?void 0:c.get().map(u=>u.walletClientType)}}:void 0,legacyCreateEmbeddedWalletFlag:e}}function dPe({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=z4.find(f=>f.id===o.id),c=(u=l==null?void 0:l.rpcUrls.privy)==null?void 0:u.http[0];return c?kNe(o,c):o})}else i=z4.concat(t??[]);let s=e?i[0]:pu,a=r??s;if(!i.find(o=>o.id===a.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:a}}const fPe=function(t,e=0){let r=3735928559^e,n=1103547991^e;for(let i,s=0;s>>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 _ee={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 xee=bee(_ee,void 0,!1);let mN=I.createContext({appConfig:xee,isServerConfigLoaded:!1});const hPe=({children:t,legacyCreateEmbeddedWalletFlag:e,client:r,clientConfig:n})=>{let[i,s]=I.useState(null),a=I.useMemo(()=>bee(i??_ee,n,!!i),[i,n]);return I.useEffect(()=>{if(!i)return;let o=uPe(n,e),l=fPe(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]),I.useEffect(()=>{i||(async()=>{try{let o=await r.getServerConfig();o.customApiUrl&&r.updateApiUrl(o.customApiUrl),s(o)}catch(o){console.warn("Error generating app config: ",o)}})()},[]),d.jsx(mN.Provider,{value:{appConfig:a,isServerConfigLoaded:!!i},children:t})},wi=()=>{let{appConfig:t}=I.useContext(mN);return t},pPe=()=>{let{isServerConfigLoaded:t}=I.useContext(mN);return t},Eee=I.createContext({setAuthenticated:je,setUser:je,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:je,initializeWalletProxy:je,getAuthMeta:je,getAuthFlow:je,closePrivyModal:je,openPrivyModal:je,connectWallet:je,initLoginWithWallet:je,loginWithWallet:je,initLoginWithFarcaster:je,loginWithFarcaster:je,loginWithCode:je,initLoginWithEmail:je,initLoginWithSms:je,initUpdateEmail:je,initUpdatePhone:je,resendEmailCode:je,resendSmsCode:je,initLoginWithHeadlessOAuth:je,loginWithHeadlessOAuth:je,crossAppAuthFlow:je,initLoginWithOAuth:je,recoveryOAuthFlow:je,loginWithOAuth:je,passkeyAuthState:{status:"initial"},setPasskeyAuthState:je,initLoginWithPasskey:je,loginWithPasskey:je,initLinkWithPasskey:je,linkWithPasskey:je,refreshUser:je,loginWithGuestAccountFlow:je,walletProxy:null,createAnalyticsEvent:je,acceptTerms:je,getUsdTokenPrice:je,getUsdPriceForSol:je,recoverPrimaryWallet:je,updateWallets:je,fundWallet:je,openModal:je,setReadyToTrue:je,requestFarcasterSignerStatus:je,initLoginWithTelegram:je,loginWithTelegram:je,generateSiweMessage:je,generateSiweMessageForSmartWallet:je,linkWithSiwe:je,linkSmartWallet:je,delegateWallet:je,revokeDelegatedWallets:je,createEmbeddedSolanaWallet:je,exportSolanaWallet:je,solanaSignMessage:je,connectCoinbaseSmartWallet:je,initiateAccountTransfer:je,emailOtpState:{status:"initial"},setEmailOtpState:je,smsOtpState:{status:"initial"},setSmsOtpState:je,siweState:{status:"initial"},setSiweState:je,oAuthState:{status:"initial"},setOAuthState:je,isHeadlessOAuthLoading:!1}),xt=()=>I.useContext(Eee);function gPe({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 Cee=I.createContext({ready:!1,app:xee,currentScreen:null,lastScreen:null,navigate:je,navigateBack:je,resetNavigation:je,setModalData:je,onUserCloseViaDialogOrKeybindRef:void 0});let mPe=[ye.LANDING,ye.CONNECT_ONLY_LANDING_SCREEN,null];const yPe=t=>{var o;let e=wi(),r=t.authenticated,[n,i]=I.useState(t.initialScreen);I.useEffect(()=>{r||mPe.includes(t.initialScreen)||t.setInitialScreen(null)},[r]);let s=I.useRef(null);I.useEffect(()=>{t.open||(s.current=null)},[t.open]),I.useEffect(()=>{s.current=null},[t.initialScreen]);let a={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:s};return d.jsxs(Cee.Provider,{value:a,children:[(typeof e.appearance.logo=="string"||((o=e.appearance.logo)==null?void 0:o.type)==="img")&&d.jsx(gPe,{src:typeof e.appearance.logo=="string"?e.appearance.logo:e.appearance.logo.props.src}),t.children]})},vt=()=>I.useContext(Cee),Xg=I.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:je,login:je,connectOrCreateWallet:je,linkEmail:je,linkPhone:je,linkFarcaster:je,linkWallet:je,startCrossAppAuthFlow:je,linkGoogle:je,linkTwitter:je,linkDiscord:je,linkGithub:je,linkSpotify:je,linkInstagram:je,linkTelegram:je,linkTiktok:je,linkLinkedIn:je,linkApple:je,linkPasskey:je,updateEmail:je,updatePhone:je,logout:je,getAccessToken:je,getEthereumProvider:je,getEthersProvider:je,getWeb3jsProvider:je,unlinkEmail:je,unlinkPhone:je,unlinkWallet:je,unlinkGoogle:je,unlinkTwitter:je,unlinkDiscord:je,unlinkGithub:je,unlinkSpotify:je,unlinkInstagram:je,unlinkTiktok:je,unlinkLinkedIn:je,unlinkApple:je,unlinkCrossAppAccount:je,unlinkFarcaster:je,unlinkTelegram:je,unlinkPasskey:je,setActiveWallet:je,forkSession:je,createWallet:je,signMessage:je,signTypedData:je,enrollInMfa:je,initEnrollmentWithSms:je,initEnrollmentWithTotp:je,initEnrollmentWithPasskey:je,promptMfa:je,init:je,submitEnrollmentWithSms:je,submitEnrollmentWithTotp:je,submitEnrollmentWithPasskey:je,unenroll:je,submit:je,cancel:je,sendTransaction:je,sendSolanaTransaction:je,exportWallet:je,setWalletPassword:je,setWalletRecovery:je,requestFarcasterSignerFromWarpcast:je,getFarcasterSignerPublicKey:je,signFarcasterMessage:je,createGuestAccount:je,signMessageWithCrossAppWallet:je,signTypedDataWithCrossAppWallet:je,sendTransactionWithCrossAppWallet:je,isModalOpen:!1,mfaMethods:[]}),Pr=()=>I.useContext(Xg),vPe=t=>{let[e,r]=I.useState("auto");return I.useEffect(()=>{let n=new ResizeObserver(i=>{var s;r(((s=i[0])==null?void 0:s.contentRect.height)??"auto")});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),e},wPe={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:[]}},Aee=I.createContext(void 0);let See=()=>I.useContext(Aee);function yN(t,e){if(!e)return;let r=See().current[t];return I.useEffect(()=>{var n;for(let[i,s]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(s);return()=>{var i;for(let[s,a]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,s)||console.warn(`Invalid event type "${s}" for action "${t}"`),r[s]=(i=r[s])==null?void 0:i.filter(o=>o!==a)}},[e])}function We(t,e,r,...n){for(let i of t.current[e][r])i(...n)}function vN(){let t=See();return(e,r,...n)=>We(t,e,r,...n)}function bPe(t){yN("configureMfa",t)}function _Pe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 l0=I.forwardRef(_Pe),ec=({success:t,fail:e})=>d.jsxs(d.Fragment,{children:[d.jsx(nl,{className:t?"success":e?"fail":""}),d.jsx(wN,{className:t?"success":e?"fail":""})]}),nl=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)"),wN=fe(nl).withConfig({displayName:"LoaderFaint",componentId:"sc-ce7792e2-1"})(["&&{border-bottom-color:",";animation:none;opacity:0.5;}"],t=>t.color??"var(--privy-color-accent)"),ih=t=>d.jsx(xPe,{color:t.color||"var(--privy-color-foreground-3)"});let xPe=fe(nl).withConfig({displayName:"StyledButtonLoader",componentId:"sc-ce7792e2-2"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const __=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;}"]),Dt=({children:t,loading:e,disabled:r,success:n,loadingText:i="Loading...",...s})=>d.jsx(Iee,{disabled:e||r,success:n,...s,children:e?d.jsxs("span",{children:[d.jsx(ih,{}),i?d.jsx("span",{children:i}):null]}):t}),av=({children:t,loading:e,disabled:r,...n})=>d.jsx(EPe,{disabled:r,...n,children:e?d.jsx(ih,{color:"var(--privy-color-foreground-accent)"}):t});let EPe=fe(__).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 CPe=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(Iee,{as:"a",disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(ih,{}),n?d.jsx("span",{children:n}):null]}):t});let Iee=fe(__).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?es(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;pointer-events:none;}"]):"");const Ad=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(APe,{disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(ih,{}),n?d.jsx("span",{children:n}):null]}):t});let APe=fe(__).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 bN=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&&es(["pointer-events:none;"])),_N=({children:t,onClick:e,disabled:r,isSubmitting:n,...i})=>d.jsxs(SPe,{$isSubmitting:n,onClick:e,disabled:r,...i,children:[d.jsx("span",{children:t}),d.jsx("span",{children:d.jsx(ih,{})})]});let SPe=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 Tee=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 IPe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const TPe=I.forwardRef(IPe);function $Pe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const kPe=I.forwardRef($Pe);function NPe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const PPe=I.forwardRef(NPe),$ee=({backFn:t})=>d.jsx("div",{children:d.jsx(x_,{onClick:t,children:d.jsx(TPe,{height:"16px",width:"16px",strokeWidth:2})})}),RPe=({nextFn:t})=>d.jsx("div",{children:d.jsx(x_,{onClick:t,children:d.jsx(kPe,{height:"16px",width:"16px",strokeWidth:2})})}),MPe=({infoFn:t})=>d.jsx("div",{children:d.jsx(jPe,{"aria-label":"info",onClick:t,children:d.jsx(l0,{height:"22px",width:"22px",strokeWidth:2})})}),OPe=t=>d.jsx("div",{children:d.jsx(x_,{"aria-label":"close modal",onClick:t.onClose,children:d.jsx(PPe,{height:"16px",width:"16px",strokeWidth:2})})}),ft=({backFn:t,infoFn:e,onClose:r,title:n,closeable:i=!0})=>{let{closePrivyModal:s}=xt(),a=wi();return d.jsxs(LPe,{children:[d.jsxs(DPe,{children:[t&&d.jsx($ee,{backFn:t}),e&&d.jsx(MPe,{infoFn:e})]}),n&&d.jsx(UPe,{id:"privy-dialog-title",children:n}),d.jsx(FPe,{children:!a.render.standalone&&i&&d.jsx(OPe,{onClose:r||(()=>s())})})]})};let x_=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;}}"]),jPe=fe(x_).withConfig({displayName:"TransparentStyledButton",componentId:"sc-f295093d-1"})(["&&{background-color:transparent;}"]),LPe=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);}"]),DPe=fe.div.withConfig({displayName:"LeftActionContainer",componentId:"sc-f295093d-3"})(["flex:1;align-items:center;display:flex;gap:8px;"]),FPe=fe.div.withConfig({displayName:"RightActionContainer",componentId:"sc-f295093d-4"})(["flex:1;display:flex;justify-content:flex-end;"]),UPe=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);"]),Da=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 Wf=fe.div.withConfig({displayName:"Grow",componentId:"sc-b51c7c74-0"})(["text-align:left;flex-grow:1;"]),kee=fe.div.withConfig({displayName:"AlignBottom",componentId:"sc-b51c7c74-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),zf=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;}"]),BPe=fe(zf).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 Nee=es(["&&{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 Pee=fe.div.withConfig({displayName:"Subtitle",componentId:"sc-b51c7c74-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Vn=fe.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-b51c7c74-5"})(["",""],Nee),fU=fe.a.withConfig({displayName:"LoginMethodButtonLink",componentId:"sc-b51c7c74-6"})(["",""],Nee),k0=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;":""),WPe=fe.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-b51c7c74-8"})(["width:100%;height:100%;padding:",";"],t=>t.$withPadding?"64px 0px":"0px"),zPe=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;}"]),HPe=()=>{let{navigate:t,app:e}=vt();return d.jsxs(d.Fragment,{children:[d.jsx(ft,{}),d.jsxs(qPe,{children:[d.jsx(Da,{children:d.jsxs("div",{children:[d.jsx(Tee,{color:"var(--privy-color-warn-light)"}),d.jsx(l0,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),d.jsxs(VPe,{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(Wf,{}),d.jsx(Dt,{onClick:()=>t(ye.LANDING),children:"Try logging in again"})]})]})};let qPe=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;"]),VPe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-408d3d00-1"})(["display:flex;flex-direction:column;gap:8px;"]);function GPe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 Rd=I.forwardRef(GPe);function KPe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 cw=I.forwardRef(KPe),xN=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 YPe(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 hU=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 EN(t){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:r,requireUsersAcceptTerms:n}}=t.app;if(n&&!t.alwaysShowImplicitConsent||!r&&!e)return d.jsx(hU,{});let i=!(!e||!r);return d.jsxs(hU,{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 Jt=()=>d.jsx($r,{children:d.jsx("a",{href:"https://www.privy.io/",target:"_blank",children:d.jsx(YPe,{height:13,width:150})})}),$r=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 ZPe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const JPe=I.forwardRef(ZPe);function QPe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 Ree=I.forwardRef(QPe),lo=({address:t,showCopyIcon:e,url:r,className:n})=>{let[i,s]=I.useState(!1);return I.useEffect(()=>{if(i){let a=setTimeout(()=>s(!1),2e3);return()=>clearTimeout(a)}},[i]),r?d.jsx("a",{title:t,className:n,href:`${r}/address/${t}`,target:"_blank",children:Ys(t)}):d.jsxs("button",{title:t,className:n,onClick:a=>(a.stopPropagation(),navigator.clipboard.writeText(t).then(()=>s(!0)).catch(console.error)),children:[Ys(t),e&&d.jsx(i?eRe:XPe,{})]})};let XPe=fe(Ree).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);"]),eRe=fe(JPe).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 Mee(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Oee=({onTransfer:t,isTransferring:e,transferSuccess:r})=>d.jsx(Dt,{...r?{success:!0,children:"Success!"}:{warn:!0,loading:e,onClick:t,children:"Transfer and delete account"}});function tRe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 E_=I.forwardRef(tRe),jee=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;"]),EI=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-aa2e65ff-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),Lee=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;"]),Dee=fe(E_).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`),rRe=fe(Ree).withConfig({displayName:"StyledCopyIcon",componentId:"sc-aa2e65ff-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),nRe=fe.ol.withConfig({displayName:"ListContainer",componentId:"sc-aa2e65ff-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),pU=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;}"]),iRe=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 sRe=()=>d.jsx(iRe,{children:d.jsx(Dee,{iconSize:60})});const aRe=({address:t,onClose:e,onRetry:r,onTransfer:n,isTransferring:i,transferSuccess:s})=>{var l;let{defaultChain:a}=wi(),o=((l=a.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(jee,{children:[d.jsx(sRe,{}),d.jsxs(EI,{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(nRe,{children:[d.jsx("p",{children:" To check your balance, you can:"}),d.jsx(pU,{children:"Log out and log back into the other account, or "}),d.jsxs(pU,{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(Lee,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[d.jsx(cw,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(lo,{address:t,showCopyIcon:!1}),d.jsx(rRe,{})]}),d.jsx(Oee,{onTransfer:n,isTransferring:i,transferSuccess:s})]})]}),d.jsx(Jt,{})]})},oRe=()=>{let{initiateAccountTransfer:t,closePrivyModal:e}=xt(),{data:r,navigate:n,lastScreen:i,setModalData:s}=vt(),[a,o]=I.useState(void 0),[l,c]=I.useState(!1),[u,f]=I.useState(!1),h=async()=>{var g,m,w,E,v,_,A,C,R;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:(E=r==null?void 0:r.accountTransfer)==null?void 0:E.account,accountType:(v=r==null?void 0:r.accountTransfer)==null?void 0:v.linkMethod,externalWalletMetadata:(_=r==null?void 0:r.accountTransfer)==null?void 0:_.externalWalletMetadata,telegramAuthResult:(A=r==null?void 0:r.accountTransfer)==null?void 0:A.telegramAuthResult,farcasterEmbeddedAddress:(C=r==null?void 0:r.accountTransfer)==null?void 0:C.farcasterEmbeddedAddress,oAuthUserInfo:(R=r==null?void 0:r.accountTransfer)==null?void 0:R.oAuthUserInfo}),c(!0),f(!1),setTimeout(e,1e3)}catch(B){s({errorModalData:{error:B,previousScreen:i||ye.LINK_CONFLICT_SCREEN}}),n(ye.ERROR_SCREEN,!0)}};return a?d.jsx(aRe,{address:a,onClose:e,onRetry:()=>o(void 0),onTransfer:h,isTransferring:u,transferSuccess:l}):d.jsx(lRe,{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})},lRe=({onClose:t,onContinue:e,onInfo:r,onTransfer:n,transferSuccess:i,isTransferring:s,data:a})=>{var l,c,u,f,h,g,m;if(!((l=a==null?void 0:a.accountTransfer)!=null&&l.linkMethod)||!((c=a==null?void 0:a.accountTransfer)!=null&&c.displayName))return;let o={method:(u=a==null?void 0:a.accountTransfer)==null?void 0:u.linkMethod,handle:(f=a==null?void 0:a.accountTransfer)==null?void 0:f.displayName,disclosedAccount:(h=a==null?void 0:a.accountTransfer)!=null&&h.embeddedWalletAddress?{type:"wallet",handle:(g=a==null?void 0:a.accountTransfer)==null?void 0:g.embeddedWalletAddress}:void 0};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!0}),d.jsxs(jee,{children:[d.jsx(Da,{children:d.jsxs("div",{children:[d.jsx(xN,{color:"var(--privy-color-error)"}),d.jsx(Rd,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),d.jsxs(EI,{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`${Mee(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(cRe,{onClick:r,disclosedAccount:o.disclosedAccount})]}),d.jsxs(EI,{style:{gap:12,marginTop:12},children:[(m=a==null?void 0:a.accountTransfer)!=null&&m.embeddedWalletAddress?d.jsx(Dt,{onClick:e,children:"Continue"}):d.jsx(Oee,{onTransfer:n,transferSuccess:i,isTransferring:s}),d.jsx(Ad,{onClick:t,children:"No thanks"})]})]}),d.jsx(Jt,{})]})};function cRe({disclosedAccount:t,onClick:e}){return t?d.jsxs(Lee,{onClick:e,children:[d.jsx(cw,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(lo,{address:t.handle,showCopyIcon:!1}),d.jsx(Dee,{iconSize:15})]}):null}function uRe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 CI=I.forwardRef(uRe);function dRe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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"}),I.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 fRe=I.forwardRef(dRe),C_=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;}"]),un=fe.div.withConfig({displayName:"Title",componentId:"sc-a63b1990-1"})(["font-size:18px;line-height:30px;text-align:center;font-weight:600;margin-bottom:10px;"]),dn=fe.div.withConfig({displayName:"SubTitle",componentId:"sc-a63b1990-2"})(["font-size:0.875rem;text-align:center;"]),N0=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;}"]),A_=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%;"]),Yc=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);}"]),Zc=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;"]),jl=fe.div.withConfig({displayName:"BottomSection",componentId:"sc-a63b1990-7"})(["display:flex;flex-direction:column;gap:10px;padding-top:20px;"]),Fee=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%;"]),LE=fe.div.withConfig({displayName:"MethodListItem",componentId:"sc-a63b1990-9"})(["display:flex;gap:5px;width:100%;position:relative;"]),DE=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);}"]),FE=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;}"]),UE=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)"),BE=fe.div.withConfig({displayName:"SmsInsecureText",componentId:"sc-a63b1990-13"})(["width:100%;display:flex;justify-content:space-between;"]),hRe=fe.p.withConfig({displayName:"TermsText",componentId:"sc-a63b1990-14"})(["text-align:left;width:100%;color:var(--privy-color-foreground-3) !important;"]),AI=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)"),$s=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;}"]),Uee=fe.div.withConfig({displayName:"ErrorMessage",componentId:"sc-a63b1990-17"})(["color:var(--privy-color-error);"]),pRe=()=>{let{user:t,logout:e}=Pr(),{app:r,onUserCloseViaDialogOrKeybindRef:n,setModalData:i,navigate:s}=vt(),{acceptTerms:a,closePrivyModal:o,createAnalyticsEvent:l}=xt(),c=u=>{u==null||u.preventDefault(),o({shouldCallAuthOnSuccess:!1}),e()};return n.current=c,d.jsx(gRe,{termsAndConditionsUrl:r==null?void 0:r.legal.termsAndConditionsUrl,privacyPolicyUrl:r==null?void 0:r.legal.privacyPolicyUrl,onAccept:async u=>{var f;u.preventDefault(),await a(),t&&_d(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}}),s(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)):o()},onDecline:c})},gRe=({termsAndConditionsUrl:t,privacyPolicyUrl:e,onAccept:r,onDecline:n})=>d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(fRe,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),d.jsx(un,{style:{marginTop:24},children:"One last step"}),d.jsx(dn,{children:"By signing up, you agree to our terms and privacy policy."}),d.jsxs(zf,{style:{marginTop:24},children:[t&&d.jsxs(fU,{target:"_blank",href:t,children:["View Terms ",d.jsx(CI,{style:{marginLeft:"auto"}})]}),e&&d.jsxs(fU,{target:"_blank",href:e,children:["View Privacy Policy ",d.jsx(CI,{style:{marginLeft:"auto"}})]})]}),d.jsxs(mRe,{style:{marginTop:24},children:[d.jsx(Ad,{onClick:n,children:"No thanks"}),d.jsx(Dt,{onClick:r,children:"Accept"})]}),d.jsx(Jt,{})]});let mRe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-4aff18c8-0"})(["display:flex;gap:10px;"]);const Bee=({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"})}),yRe=()=>{let{navigate:t,app:e}=vt(),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(vRe,{children:[d.jsx(Da,{children:d.jsxs("div",{children:[d.jsx(xN,{}),d.jsx(Bee,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),d.jsxs(wRe,{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(Dt,{as:"a",href:e.allowlistConfig.errorCtaLink,children:i}):d.jsx(Dt,{onClick:()=>{t(ye.LANDING)},children:i})]})]})};let vRe=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;"]),wRe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-ed4ecf-1"})(["display:flex;flex-direction:column;gap:8px;"]);function bRe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 _Re=I.forwardRef(bRe);function xRe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 rp=I.forwardRef(xRe);function ERe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 tc=I.forwardRef(ERe),np=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;"]),rc=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%;"]),CN=fe.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),AN=fe(rc).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),Md=fe(rc).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),S_=fe.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),yo=fe.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),CRe=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;}"]),Qr=fe.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),tn=fe.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"})(["height:12px;"]),ARe=fe.div.withConfig({displayName:"RelativeContainer",componentId:"sc-cb963810-11"})(["position:relative;"]),SN=fe.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],t=>t.height??"12"),SRe=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;"]),I_=({title:t,description:e,children:r,...n})=>d.jsx(Wee,{...n,children:d.jsxs(d.Fragment,{children:[d.jsx("h3",{children:t}),typeof e=="string"?d.jsx("p",{children:e}):e,r]})}),uw=fe(I_).withConfig({displayName:"PaddedScreenHeader",componentId:"sc-523a75d6-0"})(["margin-bottom:24px;"]),Fn=({title:t,description:e,icon:r,children:n,...i})=>d.jsxs(IRe,{...i,children:[r||null,d.jsx("h3",{children:t}),e&&typeof e=="string"?d.jsx("p",{children:e}):e,n]});let Wee=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;}"]),IRe=fe(Wee).withConfig({displayName:"CenteredStyledSection",componentId:"sc-523a75d6-2"})(["align-items:center;text-align:center;gap:16px;h3{margin-bottom:24px;}"]),gU=Array(6).fill("");var ty,ry,TRe=((ty=TRe||{})[ty.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",ty[ty.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",ty),$Re=((ry=$Re||{})[ry.EMAIL=0]="EMAIL",ry[ry.SMS=1]="SMS",ry);const kRe=()=>{var x,P,D;let{app:t,navigate:e,lastScreen:r,navigateBack:n,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=vt(),{closePrivyModal:a,resendEmailCode:o,resendSmsCode:l,getAuthMeta:c,loginWithCode:u,updateWallets:f,createAnalyticsEvent:h}=xt(),{authenticated:g,logout:m,user:w}=Pr(),[E,v]=I.useState(gU),[_,A]=I.useState(!1),[C,R]=I.useState(null),[B,S]=I.useState(null),[U,G]=I.useState(0);s.current=()=>null;let ae=(x=c())!=null&&x.email?0:1,K=Mn-500;I.useEffect(()=>{if(U){let O=setTimeout(()=>{G(U-1)},1e3);return()=>clearTimeout(O)}},[U]),I.useEffect(()=>{var O;if(g&&_&&w){if(t!=null&&t.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms){let j=setTimeout(()=>{e(ye.AFFIRMATIVE_CONSENT_SCREEN)},K);return()=>clearTimeout(j)}if(_d(w,(O=t==null?void 0:t.embeddedWallets)==null?void 0:O.createOnLogin)){let j=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:T=>{console.error(T),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:T,screen:"AwaitingPasswordlessCodeScreen"}}),m()},callAuthOnSuccessOnClose:!0}}),e(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},K);return()=>clearTimeout(j)}{f();let j=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Mn);return()=>clearTimeout(j)}}},[g,_,w]),I.useEffect(()=>{if(C&&B===0){let O=setTimeout(()=>{v(gU),R(null);let j=document.querySelector("input[name=code-0]");j==null||j.focus()},1400);return()=>clearTimeout(O)}},[C]);let N=O=>{var le;O.preventDefault();let j=O.currentTarget.value.replace(" ","");if(j==="")return;if(isNaN(Number(j)))return R("Code should be numeric"),void S(1);R(null),S(null);let T=Number((le=O.currentTarget.name)==null?void 0:le.charAt(5)),L=[...j||[""]].slice(0,6-T),M=[...E.slice(0,T),...L,...E.slice(T+L.length)];v(M);let X=Math.min(Math.max(T+L.length,0),5);if(!isNaN(Number(O.currentTarget.value))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.focus()}if(M.every(H=>H&&!isNaN(+H))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.blur(),u(M.join("")).then(()=>A(!0)).catch(ee=>{var Z,te,re,W,q,J,me,be,Ce,Fe,Ue,Ye;if(ee instanceof Ho&&ee.privyErrorCode===Se.INVALID_CREDENTIALS)R("Invalid or expired verification code");else if(ee instanceof Ho&&ee.privyErrorCode===Se.CANNOT_LINK_MORE_OF_TYPE)R(ee.message);else{if(ee instanceof Ho&&ee.privyErrorCode===Se.USER_LIMIT_REACHED)return console.error(new Yv(ee).toString()),void e(ye.USER_LIMIT_REACHED_SCREEN);if(ee instanceof Ho&&ee.privyErrorCode===Se.USER_DOES_NOT_EXIST)return void e(ye.ACCOUNT_NOT_FOUND_SCREEN);if(ee instanceof Ho&&ee.privyErrorCode===Se.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:ee,previousScreen:r??ye.AWAITING_PASSWORDLESS_CODE}}),void e(ye.ERROR_SCREEN,!1);if(ee instanceof Ho&&ee.privyErrorCode===Se.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:ee}}),void e(ye.CONNECT_OR_CREATE,!1);if(ee instanceof Ho&&ee.privyErrorCode===Se.ACCOUNT_TRANSFER_REQUIRED&&((te=(Z=ee.data)==null?void 0:Z.data)!=null&&te.nonce))return i({accountTransfer:{nonce:(W=(re=ee.data)==null?void 0:re.data)==null?void 0:W.nonce,account:ae===0?(q=c())==null?void 0:q.email:(J=c())==null?void 0:J.phoneNumber,displayName:(Ce=(be=(me=ee.data)==null?void 0:me.data)==null?void 0:be.account)==null?void 0:Ce.displayName,linkMethod:ae===0?"email":"sms",embeddedWalletAddress:(Ye=(Ue=(Fe=ee.data)==null?void 0:Fe.data)==null?void 0:Ue.otherUser)==null?void 0:Ye.embeddedWalletAddress}}),void e(ye.LINK_CONFLICT_SCREEN);R("Issue verifying code")}S(0)})}},k=ae==0?d.jsx(rp,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):d.jsx(tc,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),b=d.jsxs("p",ae==0?{children:["Please check ",d.jsx(mU,{children:(P=c())==null?void 0:P.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",d.jsx(mU,{children:(D=c())==null?void 0:D.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(NRe,{children:[d.jsx(Fn,{title:"Enter confirmation code",description:b,icon:k}),d.jsxs(CN,{children:[d.jsxs(PRe,{children:[d.jsx(RRe,{$fail:!!C,$success:_,children:d.jsx("span",{children:C||(_?"Success!":"")})}),d.jsx("div",{children:E.map((O,j)=>d.jsx("input",{name:`code-${j}`,type:"text",value:E[j],onChange:N,onKeyUp:T=>{T.key==="Backspace"&&(L=>{if(B===1&&(R(null),S(null)),v([...E.slice(0,L),"",...E.slice(L+1)]),L>0){let M=document.querySelector(`input[name=code-${L-1}]`);M==null||M.focus()}})(j)},inputMode:"numeric",autoFocus:j===0,pattern:"[0-9]",className:`${_?"success":""} ${C?"fail":""}`,autoComplete:cs?"one-time-code":"off"},j))})]}),d.jsxs(MRe,{children:[d.jsxs("span",{children:["Didn't get ",ae==0?"an email":"a message","?"]}),U?d.jsxs(jRe,{children:[d.jsx(_Re,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),d.jsx("span",{children:"Code sent"})]}):d.jsx(ORe,{children:d.jsx("button",{onClick:async()=>{G(30),ae==0?await o():await l()},children:"Resend code"})})]})]})]}),d.jsx(Jt,{})]})};let NRe=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;"]),PRe=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);}}"]),RRe=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)"),MRe=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;"]),ORe=fe.div.withConfig({displayName:"ResendButtonContainer",componentId:"sc-463c12b2-4"})(["color:var(--privy-color-accent);padding:2px 0;> button{text-decoration:underline;}"]),jRe=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);"]),mU=fe.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-463c12b2-6"})(["font-weight:500;word-break:break-all;"]);function LRe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 P0=I.forwardRef(LRe);function DRe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 T_=I.forwardRef(DRe),FRe=({icon:t})=>d.jsx(d.Fragment,{children:d.jsx(URe,{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 URe=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 BRe=()=>{let{lastScreen:t,currentScreen:e,data:r,navigateBack:n,navigate:i,setModalData:s}=vt(),{status:a,token:o,waitForResult:l,reset:c,execute:u}=Co(),f=I.useRef([]),h=N=>{f.current=[N,...f.current]},[g,m]=I.useState(!0);I.useEffect(()=>(h(setTimeout(m,1e3,!1)),()=>{f.current.forEach(N=>clearTimeout(N)),f.current=[]}),[]);let[w,E]=I.useState(""),[v,_]=I.useState("Checking that you are a human..."),[A,C]=I.useState(d.jsx(Dt,{onClick:()=>{},disabled:!0,children:"Continue"})),[R,B]=I.useState(!1),[S,U]=I.useState(3),G=r==null?void 0:r.captchaModalData,ae=async N=>{try{await(G==null?void 0:G.callback(N)),G!=null&&G.onSuccessNavigateTo&&i(G==null?void 0:G.onSuccessNavigateTo,!1)}catch(k){if(k instanceof F8)return;s({errorModalData:{error:k,previousScreen:t||ye.LANDING}}),i((G==null?void 0:G.onErrorNavigateTo)||ye.ERROR_SCREEN,!1)}};I.useEffect(()=>{a==="success"?h(setTimeout(async()=>{let N=await l();!N||G!=null&&G.userIntentRequired||ae(N)},1e3)):a==="ready"&&h(setTimeout(()=>{a==="ready"&&u()},500))},[a]),I.useEffect(()=>{if(!g)switch(a){case"success":E("Success!"),_("CAPTCHA passed successfully."),C(d.jsx(Dt,{onClick:()=>{B(!0),ae(o)},disabled:!(G!=null&&G.userIntentRequired),loading:R,children:G!=null&&G.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":E(""),_("Checking that you are a human..."),C(d.jsx(Dt,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":E("Something went wrong"),S<=0?(_("If you use an adblocker or VPN, try disabling and re-attempting."),C(null)):(_("You did not pass CAPTCHA. Please try again."),C(d.jsx(Dt,{onClick:K,children:"Retry"})))}},[a,g,R]);let K=async()=>{if(S<=0)return;U(k=>k-1),c(),u();let N=await l();!N||G!=null&&G.userIntentRequired||ae(N)};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:t&&e!==t?n:void 0}),d.jsxs(WRe,{children:[a==="success"?d.jsx(P0,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?d.jsx(T_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(FRe,{}),d.jsxs(yo,{children:[w?d.jsx("h3",{children:w}):null,d.jsx("p",{children:v})]}),A]}),d.jsx($r,{})]})};let WRe=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 R5=({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(WPe,{$withPadding:e,children:d.jsxs(zPe,{children:[d.jsx(l0,{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")},zee=({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(cw,{}):t?d.jsx(t,{}):null;let zRe=yee(["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 Hee=es(["",""],t=>t.$isLoading?es(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],zRe):""),nc=({children:t,color:e,isLoading:r,isPulsing:n,...i})=>d.jsx(HRe,{$color:e,$isLoading:r,$isPulsing:n,...i,children:t});let HRe=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=yee(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],r,r);return es(["color:",";background-color:",";",";"],e,r,t.$isPulsing&&es(["animation:"," 3s linear infinite;"],n))},Hee);const qRe=({...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"})]}),VRe=({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"})]})})]}),GRe=({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"})]})]})]}),qee=({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"})]}),KRe="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=",$_=({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"})]}),Vee="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyB2aWV3Qm94PScwIDAgMTA4IDEwOCcgZmlsbD0nbm9uZScgc3R5bGU9J2hlaWdodDoyOHB4O3dpZHRoOjI4cHgnPjxyZWN0IHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyByeD0nMjMnIGZpbGw9JyNBQjlGRjInPjwvcmVjdD48cGF0aCBmaWxsLXJ1bGU9J2V2ZW5vZGQnIGNsaXAtcnVsZT0nZXZlbm9kZCcgZD0nTTQ2LjUyNjcgNjkuOTIyOUM0Mi4wMDU0IDc2Ljg1MDkgMzQuNDI5MiA4NS42MTgyIDI0LjM0OCA4NS42MTgyQzE5LjU4MjQgODUuNjE4MiAxNSA4My42NTYzIDE1IDc1LjEzNDJDMTUgNTMuNDMwNSA0NC42MzI2IDE5LjgzMjcgNzIuMTI2OCAxOS44MzI3Qzg3Ljc2OCAxOS44MzI3IDk0IDMwLjY4NDYgOTQgNDMuMDA3OUM5NCA1OC44MjU4IDgzLjczNTUgNzYuOTEyMiA3My41MzIxIDc2LjkxMjJDNzAuMjkzOSA3Ni45MTIyIDY4LjcwNTMgNzUuMTM0MiA2OC43MDUzIDcyLjMxNEM2OC43MDUzIDcxLjU3ODMgNjguODI3NSA3MC43ODEyIDY5LjA3MTkgNjkuOTIyOUM2NS41ODkzIDc1Ljg2OTkgNTguODY4NSA4MS4zODc4IDUyLjU3NTQgODEuMzg3OEM0Ny45OTMgODEuMzg3OCA0NS42NzEzIDc4LjUwNjMgNDUuNjcxMyA3NC40NTk4QzQ1LjY3MTMgNzIuOTg4NCA0NS45NzY4IDcxLjQ1NTYgNDYuNTI2NyA2OS45MjI5Wk04My42NzYxIDQyLjU3OTRDODMuNjc2MSA0Ni4xNzA0IDgxLjU1NzUgNDcuOTY1OCA3OS4xODc1IDQ3Ljk2NThDNzYuNzgxNiA0Ny45NjU4IDc0LjY5ODkgNDYuMTcwNCA3NC42OTg5IDQyLjU3OTRDNzQuNjk4OSAzOC45ODg1IDc2Ljc4MTYgMzcuMTkzMSA3OS4xODc1IDM3LjE5MzFDODEuNTU3NSAzNy4xOTMxIDgzLjY3NjEgMzguOTg4NSA4My42NzYxIDQyLjU3OTRaTTcwLjIxMDMgNDIuNTc5NUM3MC4yMTAzIDQ2LjE3MDQgNjguMDkxNiA0Ny45NjU4IDY1LjcyMTYgNDcuOTY1OEM2My4zMTU3IDQ3Ljk2NTggNjEuMjMzIDQ2LjE3MDQgNjEuMjMzIDQyLjU3OTVDNjEuMjMzIDM4Ljk4ODUgNjMuMzE1NyAzNy4xOTMxIDY1LjcyMTYgMzcuMTkzMUM2OC4wOTE2IDM3LjE5MzEgNzAuMjEwMyAzOC45ODg1IDcwLjIxMDMgNDIuNTc5NVonIGZpbGw9JyNGRkZERjgnPjwvcGF0aD48L3N2Zz4=",YRe=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"})]})]})]}),ZRe=({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"})})]})]}),JRe=({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"})]}),QRe=({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"})]})]}),XRe=({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"})]})]})]}),Gee=({style:t,...e})=>{let{app:r}=vt();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)"})})})]})},eMe="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",tMe=({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"})})})]}),Jc={coinbase_wallet:{logo:cI,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:cI,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:qee,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:$_,displayName:"Phantom"},rainbow:{logo:ZRe,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Gee,displayName:"WalletConnect"},zerion:{logo:tMe,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:qRe,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:GRe,displayName:"Crypto.com Onchain",rdns:"com.crypto.wallet"},uniswap:{logo:QRe,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:YRe,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:JRe},universal_profile:{displayName:"Universal Profile",logo:XRe},bybit_wallet:{displayName:"Bybit Wallet",logo:VRe}},em=(t,e,r)=>{var n;return(n=Jc[t])!=null&&n.displayName?t==="coinbase_wallet"?Jc[r].displayName:Jc[t].displayName:e==="wallet_connect_v2"&&t==="wallet_connect"?"Wallet Connect":void 0},Kee=(t,e,r)=>{var n;return(n=Jc[t])!=null&&n.logo?t==="coinbase_wallet"?Jc[r].logo:Jc[t].logo:e==="wallet_connect_v2"&&t==="wallet_connect"?Gee:void 0};function SI(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 Yee=I.createContext({});const rMe=({children:t})=>{let e=wi(),[r,n]=I.useState({});return yN("login",{onComplete:(i,s,a,o,l)=>{l&&l.type!=="passkey"&&l.type!=="cross_app"&&(l.type!=="wallet"||l.walletClientType!=="privy")&&(Lt.put(yU(e.id),l.type),l.type==="wallet"?(Lt.put(WE(e.id),l.walletClientType),Lt.put(zE(e.id),l.chainType),n({accountType:l.type,walletClientType:l.walletClientType,chainType:l.chainType})):(Lt.del(WE(e.id)),Lt.del(zE(e.id)),n({accountType:l.type})))}}),I.useEffect(()=>{if(!e.id)return;let i=Lt.get(yU(e.id)),s=Lt.get(WE(e.id)),a=Lt.get(zE(e.id));i&&n(i==="wallet"?{accountType:i,walletClientType:s,chainType:a}:{accountType:i})},[e.id]),d.jsx(Yee.Provider,{value:r,children:t})};let yU=t=>`privy:${t}:recent-login-method`,WE=t=>`privy:${t}:recent-login-wallet-client`,zE=t=>`privy:${t}:recent-login-chain-type`;const sh=()=>I.useContext(Yee),Mu=({provider:t,displayName:e,logo:r,connectOnly:n,connector:i})=>{let{navigate:s}=vt(),{connectWallet:a}=xt(),o=sh(),l=i.connectorType==="wallet_connect_v2"?t:i.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches;return d.jsxs(nMe,{onClick:i.connectorType==="phantom"||i.connectorType==="solana_adapter"&&i.walletClientType==="phantom"?()=>{j8()||i.chainType==="solana"&&"isInstalled"in i&&i.isInstalled?(a(i,l),s(n?ye.AWAITING_CONNECT_ONLY_CONNECTION:ye.AWAITING_CONNECTION)):s(cs?ye.PHANTOM_INTERSTITIAL_SCREEN:ye.INSTALL_PHANTOM_SCREEN)}:i.connectorType!=="coinbase_wallet"||i.connectionOptions!=="eoaOnly"||!cs||c||FJ()?()=>{(!SI(window.navigator.userAgent)||event!=null&&event.isTrusted)&&(a(i,l),s(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(zee,{icon:Kee(t,i.connectorType,i.walletClientType)??r,name:i.walletClientType}),d.jsx("span",{children:em(t,i.connectorType,i.walletClientType)||e||i.walletClientType}),d.jsxs(iMe,{id:"chip-container",children:[(o==null?void 0:o.walletClientType)===l&&(o==null?void 0:o.chainType)===i.chainType?d.jsx(vU,{color:"gray",children:"Recent"}):d.jsx("span",{id:"connect-text",children:"Connect"}),i.connectorType==="solana_adapter"&&d.jsx(vU,{color:"gray",children:"Solana"})]})]})};let nMe=fe(Vn).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;}}"]),vU=fe(nc).withConfig({displayName:"StyledChip",componentId:"sc-b6343d12-1"})(["margin-left:auto;"]),iMe=fe.div.withConfig({displayName:"ChipContainer",componentId:"sc-b6343d12-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const sMe=["coinbase_wallet"];let aMe=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom"];const oMe=["safe"],lMe=["phantom","universal_profile"],IN=({wallets:t})=>{let{app:e}=vt();return t.length===0?d.jsx(R5,{chainType:e.appearance.walletChainType,withPadding:!0}):d.jsx(d.Fragment,{children:t})},R0=({walletList:t,walletChainType:e,connectors:r,connectOnly:n,ignore:i,walletConnectEnabled:s,forceWallet:a})=>{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(a?[a.wallet]:t).entries()){if(w==="detected_ethereum_wallets"||w==="detected_wallets")for(let[E,v]of u.filter(({chainType:_,connectorType:A,walletClientType:C})=>_!=="solana"&&(C==="uniswap_wallet_extension"||C==="uniswap_extension"?!i.includes("uniswap"):C==="crypto.com_wallet_extension"||C==="crypto.com_onchain"?!i.includes("cryptocom"):A==="injected"&&!i.includes(C))).entries()){let{walletClientType:_,walletBranding:A,chainType:C}=v;(_==="unknown"?l:o).push(d.jsx(Mu,{connectOnly:n,provider:_,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${_}-${C}-${E}`))}if(w==="detected_solana_wallets"||w==="detected_wallets")for(let[E,v]of u.filter(({chainType:_,walletClientType:A})=>{if(_==="solana")return e!=="ethereum-only"&&!i.includes(A)}).entries()){let{walletClientType:_,walletBranding:A,chainType:C}=v;(_==="unknown"?l:o).push(d.jsx(Mu,{connectOnly:n,provider:_,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${_}-${C}-${E}`))}if(lMe.includes(w)){let E=u.find(v=>v.connectorType==="injected"&&v.walletClientType===w||v.connectorType===w);if(E&&o.push(d.jsx(Mu,{connectOnly:n,provider:w,connector:E},`${m}-${w}`)),e==="solana-only"||e==="ethereum-and-solana"){let v=u.find(({chainType:_,connectorType:A,walletClientType:C})=>_==="solana"&&A==="solana_adapter"&&C===w);v&&o.push(d.jsx(Mu,{connectOnly:n,provider:w,connector:v},`${w}-solana`))}}else if(aMe.includes(w)){let E=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);s&&!E&&(E=f),E&&o.push(d.jsx(Mu,{connectOnly:n,provider:w,connector:E,logo:E.connectorType==="injected"?E.walletBranding.icon:void 0,displayName:E.connectorType==="injected"?E.walletBranding.name:void 0},`${m}-${w}`))}else if(sMe.includes(w)){let E=u.find(({connectorType:v})=>v===w);E&&o.push(d.jsx(Mu,{connectOnly:n,provider:w,connector:E},`${m}-${w}`))}else if(oMe.includes(w))f&&c.push(d.jsx(Mu,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w==="wallet_connect")f&&c.push(d.jsx(Mu,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w===(a==null?void 0:a.wallet)){let E=a.chainType==="ethereum"&&t.includes("detected_ethereum_wallets"),v=a.chainType==="solana"&&t.includes("detected_solana_wallets");if(t.includes("detected_wallets")||E||v){let _=u.find(({walletClientType:A})=>A===w);_&&o.push(d.jsx(Mu,{connectOnly:n,provider:w,displayName:(h=_.walletBranding)==null?void 0:h.name,logo:(g=_.walletBranding)==null?void 0:g.icon,connector:_},`${m}-${w}`))}}}return[...l,...o,...c]},cMe=()=>{var a,o;let{app:t,data:e}=vt(),r=(a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.suggestedAddress,n=r?`Connect the wallet with address ${Ys(r)} ${t!=null&&t.name?`to ${t.name}.`:"."}`:`Connect a wallet to ${t==null?void 0:t.name}`,{connectors:i}=xt(),s=R0({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"),s.length>0&&d.jsx(uw,{title:"Connect your wallet",description:n}),d.jsx(zf,{children:d.jsx(IN,{wallets:s})}),d.jsx(Jt,{})]})},uMe=()=>{var a,o;let{app:t,data:e}=vt(),r=(a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.suggestedAddress,n=r?d.jsxs("span",{children:["Connect the wallet with address ",d.jsx(lo,{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}=xt(),s=R0({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"),s.length>0&&d.jsx(I_,{title:"Connect your wallet",description:n}),d.jsx(zf,{children:d.jsx(IN,{wallets:s})}),t&&d.jsx(EN,{app:t,alwaysShowImplicitConsent:!0}),d.jsx(Jt,{})]})},TN=({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"})}),wU=t=>{var r;let e=(r=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses"))==null?void 0:r.split(" ").filter(n=>Zl(n,{strict:!0})).map(n=>rk(n));return!!(e!=null&&e.length)&&!!(t!=null&&t.linkedAccounts.filter(n=>n.type=="wallet"&&e.includes(n.address)).length)};var bU=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new gMe:typeof navigator<"u"?_Me(navigator.userAgent):EMe()}function bMe(t){return t!==""&&vMe.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function _Me(t){var e=bMe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new pMe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<_U&&(i=bU(bU([],i,!0),CMe(_U-i.length),!0)):i=[];var s=i.join("."),a=xMe(t),o=yMe.exec(t);return o&&o[1]?new hMe(r,s,a,o[1]):new dMe(r,s,a)}function xMe(t){for(var e=0,r=xU.length;e=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function $Re(t,e){return function(r,n){e(r,n,t)}}function kRe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function NRe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})}function PRe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(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&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=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(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[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 Aee(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function ORe(){for(var t=[],e=0;e1||a(h,g)})})}function a(h,g){try{l(n[h](g))}catch(m){f(s[0][3],m)}}function l(h){h.value instanceof iv?Promise.resolve(h.value.v).then(c,u):f(s[0][2],h)}function c(h){a("next",h)}function u(h){a("throw",h)}function f(h,g){h(g),s.shift(),s.length&&a(s[0][0],s[0][1])}}function LRe(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,s){e[i]=t[i]?function(o){return(r=!r)?{value:iv(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function FRe(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 xI=="function"?xI(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}}function URe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function BRe(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 WRe(t){return t&&t.__esModule?t:{default:t}}function zRe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function HRe(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 qRe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return _I},__asyncDelegator:LRe,__asyncGenerator:DRe,__asyncValues:FRe,__await:iv,__awaiter:NRe,__classPrivateFieldGet:zRe,__classPrivateFieldSet:HRe,__createBinding:RRe,__decorate:TRe,__exportStar:MRe,__extends:SRe,__generator:PRe,__importDefault:WRe,__importStar:BRe,__makeTemplateObject:URe,__metadata:kRe,__param:$Re,__read:Aee,__rest:IRe,__spread:ORe,__spreadArrays:jRe,__values:xI},Symbol.toStringTag,{value:"Module"})),C_=qf(qRe);var DE={},ty={},iU;function VRe(){if(iU)return ty;iU=1,Object.defineProperty(ty,"__esModule",{value:!0}),ty.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return ty.delay=t,ty}var Eh={},LE={},Ch={},sU;function GRe(){return sU||(sU=1,Object.defineProperty(Ch,"__esModule",{value:!0}),Ch.ONE_THOUSAND=Ch.ONE_HUNDRED=void 0,Ch.ONE_HUNDRED=100,Ch.ONE_THOUSAND=1e3),Ch}var FE={},oU;function KRe(){return oU||(oU=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}(FE)),FE}var aU;function See(){return aU||(aU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=C_;e.__exportStar(GRe(),t),e.__exportStar(KRe(),t)}(LE)),LE}var lU;function YRe(){if(lU)return Eh;lU=1,Object.defineProperty(Eh,"__esModule",{value:!0}),Eh.fromMiliseconds=Eh.toMiliseconds=void 0;const t=See();function e(n){return n*t.ONE_THOUSAND}Eh.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Eh.fromMiliseconds=r,Eh}var cU;function ZRe(){return cU||(cU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=C_;e.__exportStar(VRe(),t),e.__exportStar(YRe(),t)}(DE)),DE}var Wp={},uU;function JRe(){if(uU)return Wp;uU=1,Object.defineProperty(Wp,"__esModule",{value:!0}),Wp.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 Wp.Watch=t,Wp.default=t,Wp}var UE={},ry={},dU;function QRe(){if(dU)return ry;dU=1,Object.defineProperty(ry,"__esModule",{value:!0}),ry.IWatch=void 0;class t{}return ry.IWatch=t,ry}var fU;function XRe(){return fU||(fU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),C_.__exportStar(QRe(),t)}(UE)),UE}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=C_;e.__exportStar(ZRe(),t),e.__exportStar(JRe(),t),e.__exportStar(XRe(),t),e.__exportStar(See(),t)})(ct);var xn={};Object.defineProperty(xn,"__esModule",{value:!0});xn.getLocalStorage=xn.getLocalStorageOrThrow=xn.getCrypto=xn.getCryptoOrThrow=Iee=xn.getLocation=xn.getLocationOrThrow=vN=xn.getNavigator=xn.getNavigatorOrThrow=lw=xn.getDocument=xn.getDocumentOrThrow=xn.getFromWindowOrThrow=xn.getFromWindow=void 0;function tp(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}xn.getFromWindow=tp;function Xg(t){const e=tp(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}xn.getFromWindowOrThrow=Xg;function eMe(){return Xg("document")}xn.getDocumentOrThrow=eMe;function tMe(){return tp("document")}var lw=xn.getDocument=tMe;function rMe(){return Xg("navigator")}xn.getNavigatorOrThrow=rMe;function nMe(){return tp("navigator")}var vN=xn.getNavigator=nMe;function iMe(){return Xg("location")}xn.getLocationOrThrow=iMe;function sMe(){return tp("location")}var Iee=xn.getLocation=sMe;function oMe(){return Xg("crypto")}xn.getCryptoOrThrow=oMe;function aMe(){return tp("crypto")}xn.getCrypto=aMe;function lMe(){return Xg("localStorage")}xn.getLocalStorageOrThrow=lMe;function cMe(){return tp("localStorage")}xn.getLocalStorage=cMe;var wN={};Object.defineProperty(wN,"__esModule",{value:!0});var Tee=wN.getWindowMetadata=void 0;const hU=xn;function uMe(){let t,e;try{t=hU.getDocumentOrThrow(),e=hU.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),h=[];for(let g=0;g-1){const E=m.getAttribute("href");if(E)if(E.toLowerCase().indexOf("https:")===-1&&E.toLowerCase().indexOf("http:")===-1&&E.indexOf("//")!==0){let v=e.protocol+"//"+e.host;if(E.indexOf("/")===0)v+=E;else{const _=e.pathname.split("/");_.pop();const A=_.join("/");v+=A+"/"+E}h.push(v)}else if(E.indexOf("//")===0){const v=e.protocol+E;h.push(v)}else h.push(E)}}return h}function n(...f){const h=t.getElementsByTagName("meta");for(let g=0;gm.getAttribute(E)).filter(E=>E?f.includes(E):!1);if(w.length&&w){const E=m.getAttribute("content");if(E)return E}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),l=e.origin,c=r();return{description:a,url:l,icons:c,name:o}}Tee=wN.getWindowMetadata=uMe;var sv={},dMe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),$ee="%[a-f0-9]{2}",pU=new RegExp("("+$ee+")|([^%]+?)","gi"),gU=new RegExp("("+$ee+")+","gi");function EI(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([],EI(r),EI(n))}function fMe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(pU)||[],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)]},mMe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;s_==null,o=Symbol("encodeFragmentIdentifier");function a(_){switch(_.arrayFormat){case"index":return A=>(C,R)=>{const B=C.length;return R===void 0||_.skipNull&&R===null||_.skipEmptyString&&R===""?C:R===null?[...C,[u(A,_),"[",B,"]"].join("")]:[...C,[u(A,_),"[",u(B,_),"]=",u(R,_)].join("")]};case"bracket":return A=>(C,R)=>R===void 0||_.skipNull&&R===null||_.skipEmptyString&&R===""?C:R===null?[...C,[u(A,_),"[]"].join("")]:[...C,[u(A,_),"[]=",u(R,_)].join("")];case"colon-list-separator":return A=>(C,R)=>R===void 0||_.skipNull&&R===null||_.skipEmptyString&&R===""?C:R===null?[...C,[u(A,_),":list="].join("")]:[...C,[u(A,_),":list=",u(R,_)].join("")];case"comma":case"separator":case"bracket-separator":{const A=_.arrayFormat==="bracket-separator"?"[]=":"=";return C=>(R,B)=>B===void 0||_.skipNull&&B===null||_.skipEmptyString&&B===""?R:(B=B===null?"":B,R.length===0?[[u(C,_),A,u(B,_)].join("")]:[[R,u(B,_)].join(_.arrayFormatSeparator)])}default:return A=>(C,R)=>R===void 0||_.skipNull&&R===null||_.skipEmptyString&&R===""?C:R===null?[...C,u(A,_)]:[...C,[u(A,_),"=",u(R,_)].join("")]}}function l(_){let A;switch(_.arrayFormat){case"index":return(C,R,B)=>{if(A=/\[(\d*)\]$/.exec(C),C=C.replace(/\[\d*\]$/,""),!A){B[C]=R;return}B[C]===void 0&&(B[C]={}),B[C][A[1]]=R};case"bracket":return(C,R,B)=>{if(A=/(\[\])$/.exec(C),C=C.replace(/\[\]$/,""),!A){B[C]=R;return}if(B[C]===void 0){B[C]=[R];return}B[C]=[].concat(B[C],R)};case"colon-list-separator":return(C,R,B)=>{if(A=/(:list)$/.exec(C),C=C.replace(/:list$/,""),!A){B[C]=R;return}if(B[C]===void 0){B[C]=[R];return}B[C]=[].concat(B[C],R)};case"comma":case"separator":return(C,R,B)=>{const S=typeof R=="string"&&R.includes(_.arrayFormatSeparator),U=typeof R=="string"&&!S&&f(R,_).includes(_.arrayFormatSeparator);R=U?f(R,_):R;const G=S||U?R.split(_.arrayFormatSeparator).map(oe=>f(oe,_)):R===null?R:f(R,_);B[C]=G};case"bracket-separator":return(C,R,B)=>{const S=/(\[\])$/.test(C);if(C=C.replace(/\[\]$/,""),!S){B[C]=R&&f(R,_);return}const U=R===null?[]:R.split(_.arrayFormatSeparator).map(G=>f(G,_));if(B[C]===void 0){B[C]=U;return}B[C]=[].concat(B[C],U)};default:return(C,R,B)=>{if(B[C]===void 0){B[C]=R;return}B[C]=[].concat(B[C],R)}}}function c(_){if(typeof _!="string"||_.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(_,A){return A.encode?A.strict?e(_):encodeURIComponent(_):_}function f(_,A){return A.decode?r(_):_}function h(_){return Array.isArray(_)?_.sort():typeof _=="object"?h(Object.keys(_)).sort((A,C)=>Number(A)-Number(C)).map(A=>_[A]):_}function g(_){const A=_.indexOf("#");return A!==-1&&(_=_.slice(0,A)),_}function m(_){let A="";const C=_.indexOf("#");return C!==-1&&(A=_.slice(C)),A}function w(_){_=g(_);const A=_.indexOf("?");return A===-1?"":_.slice(A+1)}function E(_,A){return A.parseNumbers&&!Number.isNaN(Number(_))&&typeof _=="string"&&_.trim()!==""?_=Number(_):A.parseBooleans&&_!==null&&(_.toLowerCase()==="true"||_.toLowerCase()==="false")&&(_=_.toLowerCase()==="true"),_}function v(_,A){A=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},A),c(A.arrayFormatSeparator);const C=l(A),R=Object.create(null);if(typeof _!="string"||(_=_.trim().replace(/^[?#&]/,""),!_))return R;for(const B of _.split("&")){if(B==="")continue;let[S,U]=n(A.decode?B.replace(/\+/g," "):B,"=");U=U===void 0?null:["comma","separator","bracket-separator"].includes(A.arrayFormat)?U:f(U,A),C(f(S,A),U,R)}for(const B of Object.keys(R)){const S=R[B];if(typeof S=="object"&&S!==null)for(const U of Object.keys(S))S[U]=E(S[U],A);else R[B]=E(S,A)}return A.sort===!1?R:(A.sort===!0?Object.keys(R).sort():Object.keys(R).sort(A.sort)).reduce((B,S)=>{const U=R[S];return U&&typeof U=="object"&&!Array.isArray(U)?B[S]=h(U):B[S]=U,B},Object.create(null))}t.extract=w,t.parse=v,t.stringify=(_,A)=>{if(!_)return"";A=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},A),c(A.arrayFormatSeparator);const C=U=>A.skipNull&&s(_[U])||A.skipEmptyString&&_[U]==="",R=a(A),B={};for(const U of Object.keys(_))C(U)||(B[U]=_[U]);const S=Object.keys(B);return A.sort!==!1&&S.sort(A.sort),S.map(U=>{const G=_[U];return G===void 0?"":G===null?u(U,A):Array.isArray(G)?G.length===0&&A.arrayFormat==="bracket-separator"?u(U,A)+"[]":G.reduce(R(U),[]).join("&"):u(U,A)+"="+u(G,A)}).filter(U=>U.length>0).join("&")},t.parseUrl=(_,A)=>{A=Object.assign({decode:!0},A);const[C,R]=n(_,"#");return Object.assign({url:C.split("?")[0]||"",query:v(w(_),A)},A&&A.parseFragmentIdentifier&&R?{fragmentIdentifier:f(R,A)}:{})},t.stringifyUrl=(_,A)=>{A=Object.assign({encode:!0,strict:!0,[o]:!0},A);const C=g(_.url).split("?")[0]||"",R=t.extract(_.url),B=t.parse(R,{sort:!1}),S=Object.assign(B,_.query);let U=t.stringify(S,A);U&&(U=`?${U}`);let G=m(_.url);return _.fragmentIdentifier&&(G=`#${A[o]?u(_.fragmentIdentifier,A):_.fragmentIdentifier}`),`${C}${U}${G}`},t.pick=(_,A,C)=>{C=Object.assign({parseFragmentIdentifier:!0,[o]:!1},C);const{url:R,query:B,fragmentIdentifier:S}=t.parseUrl(_,C);return t.stringifyUrl({url:R,query:i(B,A),fragmentIdentifier:S},C)},t.exclude=(_,A,C)=>{const R=Array.isArray(A)?B=>!A.includes(B):(B,S)=>!A(B,S);return t.pick(_,R,C)}})(sv);var bN={},A_={},vr={},kee={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,l){var c=a>>>16&65535,u=a&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(a,l){return a+l|0}t.add=r;function n(a,l){return a-l|0}t.sub=n;function i(a,l){return a<>>32-l}t.rotl=i;function s(a,l){return a<<32-l|a>>>l}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(kee);Object.defineProperty(vr,"__esModule",{value:!0});var Nee=kee;function yMe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}vr.readInt16BE=yMe;function vMe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}vr.readUint16BE=vMe;function wMe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}vr.readInt16LE=wMe;function bMe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}vr.readUint16LE=bMe;function Pee(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}vr.writeUint16BE=Pee;vr.writeInt16BE=Pee;function Ree(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}vr.writeUint16LE=Ree;vr.writeInt16LE=Ree;function CI(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}vr.readInt32BE=CI;function AI(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}vr.readUint32BE=AI;function SI(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}vr.readInt32LE=SI;function II(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}vr.readUint32LE=II;function K6(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}vr.writeUint32BE=K6;vr.writeInt32BE=K6;function Y6(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}vr.writeUint32LE=Y6;vr.writeInt32LE=Y6;function _Me(t,e){e===void 0&&(e=0);var r=CI(t,e),n=CI(t,e+4);return r*4294967296+n-(n>>31)*4294967296}vr.readInt64BE=_Me;function xMe(t,e){e===void 0&&(e=0);var r=AI(t,e),n=AI(t,e+4);return r*4294967296+n}vr.readUint64BE=xMe;function EMe(t,e){e===void 0&&(e=0);var r=SI(t,e),n=SI(t,e+4);return n*4294967296+r-(r>>31)*4294967296}vr.readInt64LE=EMe;function CMe(t,e){e===void 0&&(e=0);var r=II(t,e),n=II(t,e+4);return n*4294967296+r}vr.readUint64LE=CMe;function Mee(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),K6(t/4294967296>>>0,e,r),K6(t>>>0,e,r+4),e}vr.writeUint64BE=Mee;vr.writeInt64BE=Mee;function Oee(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Y6(t>>>0,e,r),Y6(t/4294967296>>>0,e,r+4),e}vr.writeUint64LE=Oee;vr.writeInt64LE=Oee;function AMe(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,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}vr.readUintBE=AMe;function SMe(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,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}vr.writeUintBE=IMe;function TMe(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(!Nee.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>16|x<<16,K=K+x|0,S^=K,S=S>>>20|S<<12,C=C+U|0,P^=C,P=P>>>16|P<<16,N=N+P|0,U^=N,U=U>>>20|U<<12,R=R+G|0,L^=R,L=L>>>16|L<<16,k=k+L|0,G^=k,G=G>>>20|G<<12,B=B+oe|0,O^=B,O=O>>>16|O<<16,b=b+O|0,oe^=b,oe=oe>>>20|oe<<12,R=R+G|0,L^=R,L=L>>>24|L<<8,k=k+L|0,G^=k,G=G>>>25|G<<7,B=B+oe|0,O^=B,O=O>>>24|O<<8,b=b+O|0,oe^=b,oe=oe>>>25|oe<<7,C=C+U|0,P^=C,P=P>>>24|P<<8,N=N+P|0,U^=N,U=U>>>25|U<<7,A=A+S|0,x^=A,x=x>>>24|x<<8,K=K+x|0,S^=K,S=S>>>25|S<<7,A=A+U|0,O^=A,O=O>>>16|O<<16,k=k+O|0,U^=k,U=U>>>20|U<<12,C=C+G|0,x^=C,x=x>>>16|x<<16,b=b+x|0,G^=b,G=G>>>20|G<<12,R=R+oe|0,P^=R,P=P>>>16|P<<16,K=K+P|0,oe^=K,oe=oe>>>20|oe<<12,B=B+S|0,L^=B,L=L>>>16|L<<16,N=N+L|0,S^=N,S=S>>>20|S<<12,R=R+oe|0,P^=R,P=P>>>24|P<<8,K=K+P|0,oe^=K,oe=oe>>>25|oe<<7,B=B+S|0,L^=B,L=L>>>24|L<<8,N=N+L|0,S^=N,S=S>>>25|S<<7,C=C+G|0,x^=C,x=x>>>24|x<<8,b=b+x|0,G^=b,G=G>>>25|G<<7,A=A+U|0,O^=A,O=O>>>24|O<<8,k=k+O|0,U^=k,U=U>>>25|U<<7;bs.writeUint32LE(A+n|0,t,0),bs.writeUint32LE(C+i|0,t,4),bs.writeUint32LE(R+s|0,t,8),bs.writeUint32LE(B+o|0,t,12),bs.writeUint32LE(S+a|0,t,16),bs.writeUint32LE(U+l|0,t,20),bs.writeUint32LE(G+c|0,t,24),bs.writeUint32LE(oe+u|0,t,28),bs.writeUint32LE(K+f|0,t,32),bs.writeUint32LE(N+h|0,t,36),bs.writeUint32LE(k+g|0,t,40),bs.writeUint32LE(b+m|0,t,44),bs.writeUint32LE(x+w|0,t,48),bs.writeUint32LE(P+E|0,t,52),bs.writeUint32LE(L+v|0,t,56),bs.writeUint32LE(O+_|0,t,60)}function jee(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 Dee={},nh={};Object.defineProperty(nh,"__esModule",{value:!0});function WMe(t,e,r){return~(t-1)&e|t-1&r}nh.select=WMe;function zMe(t,e){return(t|0)-(e|0)-1>>>31&1}nh.lessOrEqual=zMe;function Lee(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}nh.compare=Lee;function HMe(t,e){return t.length===0||e.length===0?!1:Lee(t,e)!==0}nh.equal=HMe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=nh,r=Aa;t.DIGEST_LENGTH=16;var n=function(){function o(a){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=a[0]|a[1]<<8;this._r[0]=l&8191;var c=a[2]|a[3]<<8;this._r[1]=(l>>>13|c<<3)&8191;var u=a[4]|a[5]<<8;this._r[2]=(c>>>10|u<<6)&7939;var f=a[6]|a[7]<<8;this._r[3]=(u>>>7|f<<9)&8191;var h=a[8]|a[9]<<8;this._r[4]=(f>>>4|h<<12)&255,this._r[5]=h>>>1&8190;var g=a[10]|a[11]<<8;this._r[6]=(h>>>14|g<<2)&8191;var m=a[12]|a[13]<<8;this._r[7]=(g>>>11|m<<5)&8065;var w=a[14]|a[15]<<8;this._r[8]=(m>>>8|w<<8)&8191,this._r[9]=w>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,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],E=this._h[5],v=this._h[6],_=this._h[7],A=this._h[8],C=this._h[9],R=this._r[0],B=this._r[1],S=this._r[2],U=this._r[3],G=this._r[4],oe=this._r[5],K=this._r[6],N=this._r[7],k=this._r[8],b=this._r[9];c>=16;){var x=a[l+0]|a[l+1]<<8;f+=x&8191;var P=a[l+2]|a[l+3]<<8;h+=(x>>>13|P<<3)&8191;var L=a[l+4]|a[l+5]<<8;g+=(P>>>10|L<<6)&8191;var O=a[l+6]|a[l+7]<<8;m+=(L>>>7|O<<9)&8191;var j=a[l+8]|a[l+9]<<8;w+=(O>>>4|j<<12)&8191,E+=j>>>1&8191;var I=a[l+10]|a[l+11]<<8;v+=(j>>>14|I<<2)&8191;var D=a[l+12]|a[l+13]<<8;_+=(I>>>11|D<<5)&8191;var M=a[l+14]|a[l+15]<<8;A+=(D>>>8|M<<8)&8191,C+=M>>>5|u;var X=0,le=X;le+=f*R,le+=h*(5*b),le+=g*(5*k),le+=m*(5*N),le+=w*(5*K),X=le>>>13,le&=8191,le+=E*(5*oe),le+=v*(5*G),le+=_*(5*U),le+=A*(5*S),le+=C*(5*B),X+=le>>>13,le&=8191;var H=X;H+=f*B,H+=h*R,H+=g*(5*b),H+=m*(5*k),H+=w*(5*N),X=H>>>13,H&=8191,H+=E*(5*K),H+=v*(5*oe),H+=_*(5*G),H+=A*(5*U),H+=C*(5*S),X+=H>>>13,H&=8191;var ee=X;ee+=f*S,ee+=h*B,ee+=g*R,ee+=m*(5*b),ee+=w*(5*k),X=ee>>>13,ee&=8191,ee+=E*(5*N),ee+=v*(5*K),ee+=_*(5*oe),ee+=A*(5*G),ee+=C*(5*U),X+=ee>>>13,ee&=8191;var Z=X;Z+=f*U,Z+=h*S,Z+=g*B,Z+=m*R,Z+=w*(5*b),X=Z>>>13,Z&=8191,Z+=E*(5*k),Z+=v*(5*N),Z+=_*(5*K),Z+=A*(5*oe),Z+=C*(5*G),X+=Z>>>13,Z&=8191;var te=X;te+=f*G,te+=h*U,te+=g*S,te+=m*B,te+=w*R,X=te>>>13,te&=8191,te+=E*(5*b),te+=v*(5*k),te+=_*(5*N),te+=A*(5*K),te+=C*(5*oe),X+=te>>>13,te&=8191;var re=X;re+=f*oe,re+=h*G,re+=g*U,re+=m*S,re+=w*B,X=re>>>13,re&=8191,re+=E*R,re+=v*(5*b),re+=_*(5*k),re+=A*(5*N),re+=C*(5*K),X+=re>>>13,re&=8191;var W=X;W+=f*K,W+=h*oe,W+=g*G,W+=m*U,W+=w*S,X=W>>>13,W&=8191,W+=E*B,W+=v*R,W+=_*(5*b),W+=A*(5*k),W+=C*(5*N),X+=W>>>13,W&=8191;var q=X;q+=f*N,q+=h*K,q+=g*oe,q+=m*G,q+=w*U,X=q>>>13,q&=8191,q+=E*S,q+=v*B,q+=_*R,q+=A*(5*b),q+=C*(5*k),X+=q>>>13,q&=8191;var J=X;J+=f*k,J+=h*N,J+=g*K,J+=m*oe,J+=w*G,X=J>>>13,J&=8191,J+=E*U,J+=v*S,J+=_*B,J+=A*R,J+=C*(5*b),X+=J>>>13,J&=8191;var me=X;me+=f*b,me+=h*k,me+=g*N,me+=m*K,me+=w*oe,X=me>>>13,me&=8191,me+=E*G,me+=v*U,me+=_*S,me+=A*B,me+=C*R,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=Z,w=te,E=re,v=W,_=q,A=J,C=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]=E,this._h[6]=v,this._h[7]=_,this._h[8]=A,this._h[9]=C},o.prototype.finish=function(a,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 a[l+0]=this._h[0]>>>0,a[l+1]=this._h[0]>>>8,a[l+2]=this._h[1]>>>0,a[l+3]=this._h[1]>>>8,a[l+4]=this._h[2]>>>0,a[l+5]=this._h[2]>>>8,a[l+6]=this._h[3]>>>0,a[l+7]=this._h[3]>>>8,a[l+8]=this._h[4]>>>0,a[l+9]=this._h[4]>>>8,a[l+10]=this._h[5]>>>0,a[l+11]=this._h[5]>>>8,a[l+12]=this._h[6]>>>0,a[l+13]=this._h[6]>>>8,a[l+14]=this._h[7]>>>0,a[l+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var l=0,c=a.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(a,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,E;if(h){if(h.length!==w)throw new Error("ChaCha20Poly1305: incorrect destination length");E=h}else E=new Uint8Array(w);return e.streamXOR(this._key,g,u,E,4),this._authenticate(E.subarray(E.length-this.tagLength,E.length),m,E.subarray(0,E.length-this.tagLength),f),n.wipe(g),E},l.prototype.open=function(c,u,f,h){if(c.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&g.update(o.subarray(h.length%16))),g.update(f),f.length%16>0&&g.update(o.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(),E=0;Ethis.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 E=0;E0;E++){const v=w[E];v0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=s(this._temp,this._state,l,u,c),c%=this.blockSize);c>0;)this._buffer[this._bufferLength++]=l[u++],c--;return this},a.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}},a.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},a.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},a}();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 s(a,l,c,u,f){for(;f>=64;){for(var h=l[0],g=l[1],m=l[2],w=l[3],E=l[4],v=l[5],_=l[6],A=l[7],C=0;C<16;C++){var R=u+C*4;a[C]=e.readUint32BE(c,R)}for(var C=16;C<64;C++){var B=a[C-2],S=(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10;B=a[C-15];var U=(B>>>7|B<<25)^(B>>>18|B<<14)^B>>>3;a[C]=(S+a[C-7]|0)+(U+a[C-16]|0)}for(var C=0;C<64;C++){var S=(((E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7))+(E&v^~E&_)|0)+(A+(i[C]+a[C]|0)|0)|0,U=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&g^h&m^g&m)|0;A=_,_=v,v=E,E=w+S|0,w=m,m=g,g=h,h=S+U|0}l[0]+=h,l[1]+=g,l[2]+=m,l[3]+=w,l[4]+=E,l[5]+=v,l[6]+=_,l[7]+=A,u+=64,f-=64}return u}function o(a){var l=new n;l.update(a);var c=l.digest();return l.clean(),c}t.hash=o})(uw);var xN={};(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=ih,r=Aa;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(C){const R=new Float64Array(16);if(C)for(let B=0;B>16&1),B[oe-1]&=65535;B[15]=S[15]-32767-(B[14]>>16&1);const G=B[15]>>16&1;B[14]&=65535,a(S,B,1-G)}for(let U=0;U<16;U++)C[2*U]=S[U]&255,C[2*U+1]=S[U]>>8}function c(C,R){for(let B=0;B<16;B++)C[B]=R[2*B]+(R[2*B+1]<<8);C[15]&=32767}function u(C,R,B){for(let S=0;S<16;S++)C[S]=R[S]+B[S]}function f(C,R,B){for(let S=0;S<16;S++)C[S]=R[S]-B[S]}function h(C,R,B){let S,U,G=0,oe=0,K=0,N=0,k=0,b=0,x=0,P=0,L=0,O=0,j=0,I=0,D=0,M=0,X=0,le=0,H=0,ee=0,Z=0,te=0,re=0,W=0,q=0,J=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ye=0,lt=0,xe=B[0],He=B[1],Ve=B[2],Ie=B[3],Ne=B[4],Oe=B[5],Me=B[6],Y=B[7],F=B[8],z=B[9],ie=B[10],pe=B[11],ve=B[12],he=B[13],De=B[14],Ze=B[15];S=R[0],G+=S*xe,oe+=S*He,K+=S*Ve,N+=S*Ie,k+=S*Ne,b+=S*Oe,x+=S*Me,P+=S*Y,L+=S*F,O+=S*z,j+=S*ie,I+=S*pe,D+=S*ve,M+=S*he,X+=S*De,le+=S*Ze,S=R[1],oe+=S*xe,K+=S*He,N+=S*Ve,k+=S*Ie,b+=S*Ne,x+=S*Oe,P+=S*Me,L+=S*Y,O+=S*F,j+=S*z,I+=S*ie,D+=S*pe,M+=S*ve,X+=S*he,le+=S*De,H+=S*Ze,S=R[2],K+=S*xe,N+=S*He,k+=S*Ve,b+=S*Ie,x+=S*Ne,P+=S*Oe,L+=S*Me,O+=S*Y,j+=S*F,I+=S*z,D+=S*ie,M+=S*pe,X+=S*ve,le+=S*he,H+=S*De,ee+=S*Ze,S=R[3],N+=S*xe,k+=S*He,b+=S*Ve,x+=S*Ie,P+=S*Ne,L+=S*Oe,O+=S*Me,j+=S*Y,I+=S*F,D+=S*z,M+=S*ie,X+=S*pe,le+=S*ve,H+=S*he,ee+=S*De,Z+=S*Ze,S=R[4],k+=S*xe,b+=S*He,x+=S*Ve,P+=S*Ie,L+=S*Ne,O+=S*Oe,j+=S*Me,I+=S*Y,D+=S*F,M+=S*z,X+=S*ie,le+=S*pe,H+=S*ve,ee+=S*he,Z+=S*De,te+=S*Ze,S=R[5],b+=S*xe,x+=S*He,P+=S*Ve,L+=S*Ie,O+=S*Ne,j+=S*Oe,I+=S*Me,D+=S*Y,M+=S*F,X+=S*z,le+=S*ie,H+=S*pe,ee+=S*ve,Z+=S*he,te+=S*De,re+=S*Ze,S=R[6],x+=S*xe,P+=S*He,L+=S*Ve,O+=S*Ie,j+=S*Ne,I+=S*Oe,D+=S*Me,M+=S*Y,X+=S*F,le+=S*z,H+=S*ie,ee+=S*pe,Z+=S*ve,te+=S*he,re+=S*De,W+=S*Ze,S=R[7],P+=S*xe,L+=S*He,O+=S*Ve,j+=S*Ie,I+=S*Ne,D+=S*Oe,M+=S*Me,X+=S*Y,le+=S*F,H+=S*z,ee+=S*ie,Z+=S*pe,te+=S*ve,re+=S*he,W+=S*De,q+=S*Ze,S=R[8],L+=S*xe,O+=S*He,j+=S*Ve,I+=S*Ie,D+=S*Ne,M+=S*Oe,X+=S*Me,le+=S*Y,H+=S*F,ee+=S*z,Z+=S*ie,te+=S*pe,re+=S*ve,W+=S*he,q+=S*De,J+=S*Ze,S=R[9],O+=S*xe,j+=S*He,I+=S*Ve,D+=S*Ie,M+=S*Ne,X+=S*Oe,le+=S*Me,H+=S*Y,ee+=S*F,Z+=S*z,te+=S*ie,re+=S*pe,W+=S*ve,q+=S*he,J+=S*De,me+=S*Ze,S=R[10],j+=S*xe,I+=S*He,D+=S*Ve,M+=S*Ie,X+=S*Ne,le+=S*Oe,H+=S*Me,ee+=S*Y,Z+=S*F,te+=S*z,re+=S*ie,W+=S*pe,q+=S*ve,J+=S*he,me+=S*De,be+=S*Ze,S=R[11],I+=S*xe,D+=S*He,M+=S*Ve,X+=S*Ie,le+=S*Ne,H+=S*Oe,ee+=S*Me,Z+=S*Y,te+=S*F,re+=S*z,W+=S*ie,q+=S*pe,J+=S*ve,me+=S*he,be+=S*De,Ce+=S*Ze,S=R[12],D+=S*xe,M+=S*He,X+=S*Ve,le+=S*Ie,H+=S*Ne,ee+=S*Oe,Z+=S*Me,te+=S*Y,re+=S*F,W+=S*z,q+=S*ie,J+=S*pe,me+=S*ve,be+=S*he,Ce+=S*De,Fe+=S*Ze,S=R[13],M+=S*xe,X+=S*He,le+=S*Ve,H+=S*Ie,ee+=S*Ne,Z+=S*Oe,te+=S*Me,re+=S*Y,W+=S*F,q+=S*z,J+=S*ie,me+=S*pe,be+=S*ve,Ce+=S*he,Fe+=S*De,Ue+=S*Ze,S=R[14],X+=S*xe,le+=S*He,H+=S*Ve,ee+=S*Ie,Z+=S*Ne,te+=S*Oe,re+=S*Me,W+=S*Y,q+=S*F,J+=S*z,me+=S*ie,be+=S*pe,Ce+=S*ve,Fe+=S*he,Ue+=S*De,Ye+=S*Ze,S=R[15],le+=S*xe,H+=S*He,ee+=S*Ve,Z+=S*Ie,te+=S*Ne,re+=S*Oe,W+=S*Me,q+=S*Y,J+=S*F,me+=S*z,be+=S*ie,Ce+=S*pe,Fe+=S*ve,Ue+=S*he,Ye+=S*De,lt+=S*Ze,G+=38*H,oe+=38*ee,K+=38*Z,N+=38*te,k+=38*re,b+=38*W,x+=38*q,P+=38*J,L+=38*me,O+=38*be,j+=38*Ce,I+=38*Fe,D+=38*Ue,M+=38*Ye,X+=38*lt,U=1,S=G+U+65535,U=Math.floor(S/65536),G=S-U*65536,S=oe+U+65535,U=Math.floor(S/65536),oe=S-U*65536,S=K+U+65535,U=Math.floor(S/65536),K=S-U*65536,S=N+U+65535,U=Math.floor(S/65536),N=S-U*65536,S=k+U+65535,U=Math.floor(S/65536),k=S-U*65536,S=b+U+65535,U=Math.floor(S/65536),b=S-U*65536,S=x+U+65535,U=Math.floor(S/65536),x=S-U*65536,S=P+U+65535,U=Math.floor(S/65536),P=S-U*65536,S=L+U+65535,U=Math.floor(S/65536),L=S-U*65536,S=O+U+65535,U=Math.floor(S/65536),O=S-U*65536,S=j+U+65535,U=Math.floor(S/65536),j=S-U*65536,S=I+U+65535,U=Math.floor(S/65536),I=S-U*65536,S=D+U+65535,U=Math.floor(S/65536),D=S-U*65536,S=M+U+65535,U=Math.floor(S/65536),M=S-U*65536,S=X+U+65535,U=Math.floor(S/65536),X=S-U*65536,S=le+U+65535,U=Math.floor(S/65536),le=S-U*65536,G+=U-1+37*(U-1),U=1,S=G+U+65535,U=Math.floor(S/65536),G=S-U*65536,S=oe+U+65535,U=Math.floor(S/65536),oe=S-U*65536,S=K+U+65535,U=Math.floor(S/65536),K=S-U*65536,S=N+U+65535,U=Math.floor(S/65536),N=S-U*65536,S=k+U+65535,U=Math.floor(S/65536),k=S-U*65536,S=b+U+65535,U=Math.floor(S/65536),b=S-U*65536,S=x+U+65535,U=Math.floor(S/65536),x=S-U*65536,S=P+U+65535,U=Math.floor(S/65536),P=S-U*65536,S=L+U+65535,U=Math.floor(S/65536),L=S-U*65536,S=O+U+65535,U=Math.floor(S/65536),O=S-U*65536,S=j+U+65535,U=Math.floor(S/65536),j=S-U*65536,S=I+U+65535,U=Math.floor(S/65536),I=S-U*65536,S=D+U+65535,U=Math.floor(S/65536),D=S-U*65536,S=M+U+65535,U=Math.floor(S/65536),M=S-U*65536,S=X+U+65535,U=Math.floor(S/65536),X=S-U*65536,S=le+U+65535,U=Math.floor(S/65536),le=S-U*65536,G+=U-1+37*(U-1),C[0]=G,C[1]=oe,C[2]=K,C[3]=N,C[4]=k,C[5]=b,C[6]=x,C[7]=P,C[8]=L,C[9]=O,C[10]=j,C[11]=I,C[12]=D,C[13]=M,C[14]=X,C[15]=le}function g(C,R){h(C,R,R)}function m(C,R){const B=n();for(let S=0;S<16;S++)B[S]=R[S];for(let S=253;S>=0;S--)g(B,B),S!==2&&S!==4&&h(B,B,R);for(let S=0;S<16;S++)C[S]=B[S]}function w(C,R){const B=new Uint8Array(32),S=new Float64Array(80),U=n(),G=n(),oe=n(),K=n(),N=n(),k=n();for(let L=0;L<31;L++)B[L]=C[L];B[31]=C[31]&127|64,B[0]&=248,c(S,R);for(let L=0;L<16;L++)G[L]=S[L];U[0]=K[0]=1;for(let L=254;L>=0;--L){const O=B[L>>>3]>>>(L&7)&1;a(U,G,O),a(oe,K,O),u(N,U,oe),f(U,U,oe),u(oe,G,K),f(G,G,K),g(K,N),g(k,U),h(U,oe,U),h(oe,G,N),u(N,U,oe),f(U,U,oe),g(G,U),f(oe,K,k),h(U,oe,s),u(U,U,K),h(oe,oe,U),h(U,K,k),h(K,G,S),g(G,N),a(U,G,O),a(oe,K,O)}for(let L=0;L<16;L++)S[L+16]=U[L],S[L+32]=oe[L],S[L+48]=G[L],S[L+64]=K[L];const b=S.subarray(32),x=S.subarray(16);m(b,b),h(x,x,b);const P=new Uint8Array(32);return l(P,x),P}t.scalarMult=w;function E(C){return w(C,i)}t.scalarMultBase=E;function v(C){if(C.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const R=new Uint8Array(C);return{publicKey:E(R),secretKey:R}}t.generateKeyPairFromSeed=v;function _(C){const R=(0,e.randomBytes)(32,C),B=v(R);return(0,r.wipe)(R),B}t.generateKeyPair=_;function A(C,R,B=!1){if(C.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(R.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const S=w(C,R);if(B){let U=0;for(let G=0;Gi+s.length,0));const r=Bee(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function iOe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,C=new Uint8Array(A);v!==_;){for(var R=m[v],B=0,S=A-1;(R!==0||B>>0,C[S]=R%a>>>0,R=R/a>>>0;if(R!==0)throw new Error("Non-zero carry");E=B,v++}for(var U=A-E;U!==A&&C[U]===0;)U++;for(var G=l.repeat(w);U>>0,A=new Uint8Array(_);m[w];){var C=r[m.charCodeAt(w)];if(C===255)return;for(var R=0,B=_-1;(C!==0||R>>0,A[B]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");v=R,w++}if(m[w]!==" "){for(var S=_-v;S!==_&&A[S]===0;)S++;for(var U=new Uint8Array(E+(_-S)),G=E;S!==_;)U[G++]=A[S++];return U}}}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 sOe=iOe,oOe=sOe;const aOe=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")},lOe=t=>new TextEncoder().encode(t),cOe=t=>new TextDecoder().decode(t);class uOe{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 dOe{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 Wee(this,e)}}class fOe{constructor(e){this.decoders=e}or(e){return Wee(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 Wee=(t,e)=>new fOe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class hOe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new uOe(e,r,n),this.decoder=new dOe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const $_=({name:t,prefix:e,encode:r,decode:n})=>new hOe(t,e,r,n),dw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=oOe(r,e);return $_({prefix:t,name:e,encode:n,decode:s=>aOe(i(s))})},pOe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(a-=8,o[c++]=255&l>>a)}if(a>=r||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return o},gOe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<$_({prefix:e,name:t,encode(i){return gOe(i,n,r)},decode(i){return pOe(i,n,r,t)}}),mOe=$_({prefix:"\0",name:"identity",encode:t=>cOe(t),decode:t=>lOe(t)}),yOe=Object.freeze(Object.defineProperty({__proto__:null,identity:mOe},Symbol.toStringTag,{value:"Module"})),vOe=hs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),wOe=Object.freeze(Object.defineProperty({__proto__:null,base2:vOe},Symbol.toStringTag,{value:"Module"})),bOe=hs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),_Oe=Object.freeze(Object.defineProperty({__proto__:null,base8:bOe},Symbol.toStringTag,{value:"Module"})),xOe=dw({prefix:"9",name:"base10",alphabet:"0123456789"}),EOe=Object.freeze(Object.defineProperty({__proto__:null,base10:xOe},Symbol.toStringTag,{value:"Module"})),COe=hs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),AOe=hs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),SOe=Object.freeze(Object.defineProperty({__proto__:null,base16:COe,base16upper:AOe},Symbol.toStringTag,{value:"Module"})),IOe=hs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),TOe=hs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),$Oe=hs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),kOe=hs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),NOe=hs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),POe=hs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ROe=hs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),MOe=hs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),OOe=hs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),jOe=Object.freeze(Object.defineProperty({__proto__:null,base32:IOe,base32hex:NOe,base32hexpad:ROe,base32hexpadupper:MOe,base32hexupper:POe,base32pad:$Oe,base32padupper:kOe,base32upper:TOe,base32z:OOe},Symbol.toStringTag,{value:"Module"})),DOe=dw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),LOe=dw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),FOe=Object.freeze(Object.defineProperty({__proto__:null,base36:DOe,base36upper:LOe},Symbol.toStringTag,{value:"Module"})),UOe=dw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),BOe=dw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),WOe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:UOe,base58flickr:BOe},Symbol.toStringTag,{value:"Module"})),zOe=hs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),HOe=hs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),qOe=hs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),VOe=hs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),GOe=Object.freeze(Object.defineProperty({__proto__:null,base64:zOe,base64pad:HOe,base64url:qOe,base64urlpad:VOe},Symbol.toStringTag,{value:"Module"})),zee=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),KOe=zee.reduce((t,e,r)=>(t[r]=e,t),[]),YOe=zee.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function ZOe(t){return t.reduce((e,r)=>(e+=KOe[r],e),"")}function JOe(t){const e=[];for(const r of t){const n=YOe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const QOe=$_({prefix:"🚀",name:"base256emoji",encode:ZOe,decode:JOe}),XOe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:QOe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const wU={...yOe,...wOe,..._Oe,...EOe,...SOe,...jOe,...FOe,...WOe,...GOe,...XOe};function Hee(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const bU=Hee("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),BE=Hee("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=Bee(t.length);for(let r=0;r",cje="MIT",uje={url:"https://github.com/indutny/elliptic/issues"},dje="https://github.com/indutny/elliptic",fje={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"},hje={"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"},pje={name:eje,version:tje,description:rje,main:nje,files:ije,scripts:sje,repository:oje,keywords:aje,author:lje,license:cje,bugs:uje,homepage:dje,devDependencies:fje,dependencies:hje};var Sa={},EN={exports:{}};EN.exports;(function(t){(function(e,r){function n(K,N){if(!K)throw new Error(N||"Assertion failed")}function i(K,N){K.super_=N;var k=function(){};k.prototype=N.prototype,K.prototype=new k,K.prototype.constructor=K}function s(K,N,k){if(s.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((N==="le"||N==="be")&&(k=N,N=10),this._init(K||0,N||10,k||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ng.Buffer}catch{}s.isBN=function(N){return N instanceof s?!0:N!==null&&typeof N=="object"&&N.constructor.wordSize===s.wordSize&&Array.isArray(N.words)},s.max=function(N,k){return N.cmp(k)>0?N:k},s.min=function(N,k){return N.cmp(k)<0?N:k},s.prototype._init=function(N,k,b){if(typeof N=="number")return this._initNumber(N,k,b);if(typeof N=="object")return this._initArray(N,k,b);k==="hex"&&(k=16),n(k===(k|0)&&k>=2&&k<=36),N=N.toString().replace(/\s+/g,"");var x=0;N[0]==="-"&&(x++,this.negative=1),x=0;x-=3)L=N[x]|N[x-1]<<8|N[x-2]<<16,this.words[P]|=L<>>26-O&67108863,O+=24,O>=26&&(O-=26,P++);else if(b==="le")for(x=0,P=0;x>>26-O&67108863,O+=24,O>=26&&(O-=26,P++);return this.strip()};function a(K,N){var k=K.charCodeAt(N);return k>=65&&k<=70?k-55:k>=97&&k<=102?k-87:k-48&15}function l(K,N,k){var b=a(K,k);return k-1>=N&&(b|=a(K,k-1)<<4),b}s.prototype._parseHex=function(N,k,b){this.length=Math.ceil((N.length-k)/6),this.words=new Array(this.length);for(var x=0;x=k;x-=2)O=l(N,k,x)<=18?(P-=18,L+=1,this.words[L]|=O>>>26):P+=8;else{var j=N.length-k;for(x=j%2===0?k+1:k;x=18?(P-=18,L+=1,this.words[L]|=O>>>26):P+=8}this.strip()};function c(K,N,k,b){for(var x=0,P=Math.min(K.length,k),L=N;L=49?x+=O-49+10:O>=17?x+=O-17+10:x+=O}return x}s.prototype._parseBase=function(N,k,b){this.words=[0],this.length=1;for(var x=0,P=1;P<=67108863;P*=k)x++;x--,P=P/k|0;for(var L=N.length-b,O=L%x,j=Math.min(L,L-O)+b,I=0,D=b;D1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.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];s.prototype.toString=function(N,k){N=N||10,k=k|0||1;var b;if(N===16||N==="hex"){b="";for(var x=0,P=0,L=0;L>>24-x&16777215,x+=2,x>=26&&(x-=26,L--),P!==0||L!==this.length-1?b=u[6-j.length]+j+b:b=j+b}for(P!==0&&(b=P.toString(16)+b);b.length%k!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(N===(N|0)&&N>=2&&N<=36){var I=f[N],D=h[N];b="";var M=this.clone();for(M.negative=0;!M.isZero();){var X=M.modn(D).toString(N);M=M.idivn(D),M.isZero()?b=X+b:b=u[I-X.length]+X+b}for(this.isZero()&&(b="0"+b);b.length%k!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}n(!1,"Base should be between 2 and 36")},s.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},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(N,k){return n(typeof o<"u"),this.toArrayLike(o,N,k)},s.prototype.toArray=function(N,k){return this.toArrayLike(Array,N,k)},s.prototype.toArrayLike=function(N,k,b){var x=this.byteLength(),P=b||Math.max(1,x);n(x<=P,"byte array longer than desired length"),n(P>0,"Requested array length <= 0"),this.strip();var L=k==="le",O=new N(P),j,I,D=this.clone();if(L){for(I=0;!D.isZero();I++)j=D.andln(255),D.iushrn(8),O[I]=j;for(;I=4096&&(b+=13,k>>>=13),k>=64&&(b+=7,k>>>=7),k>=8&&(b+=4,k>>>=4),k>=2&&(b+=2,k>>>=2),b+k},s.prototype._zeroBits=function(N){if(N===0)return 26;var k=N,b=0;return k&8191||(b+=13,k>>>=13),k&127||(b+=7,k>>>=7),k&15||(b+=4,k>>>=4),k&3||(b+=2,k>>>=2),k&1||b++,b},s.prototype.bitLength=function(){var N=this.words[this.length-1],k=this._countBits(N);return(this.length-1)*26+k};function g(K){for(var N=new Array(K.bitLength()),k=0;k>>x}return N}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var N=0,k=0;kN.length?this.clone().ior(N):N.clone().ior(this)},s.prototype.uor=function(N){return this.length>N.length?this.clone().iuor(N):N.clone().iuor(this)},s.prototype.iuand=function(N){var k;this.length>N.length?k=N:k=this;for(var b=0;bN.length?this.clone().iand(N):N.clone().iand(this)},s.prototype.uand=function(N){return this.length>N.length?this.clone().iuand(N):N.clone().iuand(this)},s.prototype.iuxor=function(N){var k,b;this.length>N.length?(k=this,b=N):(k=N,b=this);for(var x=0;xN.length?this.clone().ixor(N):N.clone().ixor(this)},s.prototype.uxor=function(N){return this.length>N.length?this.clone().iuxor(N):N.clone().iuxor(this)},s.prototype.inotn=function(N){n(typeof N=="number"&&N>=0);var k=Math.ceil(N/26)|0,b=N%26;this._expand(k),b>0&&k--;for(var x=0;x0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},s.prototype.notn=function(N){return this.clone().inotn(N)},s.prototype.setn=function(N,k){n(typeof N=="number"&&N>=0);var b=N/26|0,x=N%26;return this._expand(b+1),k?this.words[b]=this.words[b]|1<N.length?(b=this,x=N):(b=N,x=this);for(var P=0,L=0;L>>26;for(;P!==0&&L>>26;if(this.length=b.length,P!==0)this.words[this.length]=P,this.length++;else if(b!==this)for(;LN.length?this.clone().iadd(N):N.clone().iadd(this)},s.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 b=this.cmp(N);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,P;b>0?(x=this,P=N):(x=N,P=this);for(var L=0,O=0;O>26,this.words[O]=k&67108863;for(;L!==0&&O>26,this.words[O]=k&67108863;if(L===0&&O>>26,M=j&67108863,X=Math.min(I,N.length-1),le=Math.max(0,I-K.length+1);le<=X;le++){var H=I-le|0;x=K.words[H]|0,P=N.words[le]|0,L=x*P+M,D+=L/67108864|0,M=L&67108863}k.words[I]=M|0,j=D|0}return j!==0?k.words[I]=j|0:k.length--,k.strip()}var w=function(N,k,b){var x=N.words,P=k.words,L=b.words,O=0,j,I,D,M=x[0]|0,X=M&8191,le=M>>>13,H=x[1]|0,ee=H&8191,Z=H>>>13,te=x[2]|0,re=te&8191,W=te>>>13,q=x[3]|0,J=q&8191,me=q>>>13,be=x[4]|0,Ce=be&8191,Fe=be>>>13,Ue=x[5]|0,Ye=Ue&8191,lt=Ue>>>13,xe=x[6]|0,He=xe&8191,Ve=xe>>>13,Ie=x[7]|0,Ne=Ie&8191,Oe=Ie>>>13,Me=x[8]|0,Y=Me&8191,F=Me>>>13,z=x[9]|0,ie=z&8191,pe=z>>>13,ve=P[0]|0,he=ve&8191,De=ve>>>13,Ze=P[1]|0,et=Ze&8191,it=Ze>>>13,ut=P[2]|0,pt=ut&8191,tr=ut>>>13,Wt=P[3]|0,At=Wt&8191,mt=Wt>>>13,Ct=P[4]|0,dt=Ct&8191,Nt=Ct>>>13,jt=P[5]|0,gt=jt&8191,Vt=jt>>>13,zt=P[6]|0,at=zt&8191,Gt=zt>>>13,Ft=P[7]|0,yt=Ft&8191,Qe=Ft>>>13,Ot=P[8]|0,_t=Ot&8191,Zt=Ot>>>13,Cr=P[9]|0,qt=Cr&8191,Ar=Cr>>>13;b.negative=N.negative^k.negative,b.length=19,j=Math.imul(X,he),I=Math.imul(X,De),I=I+Math.imul(le,he)|0,D=Math.imul(le,De);var cr=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(cr>>>26)|0,cr&=67108863,j=Math.imul(ee,he),I=Math.imul(ee,De),I=I+Math.imul(Z,he)|0,D=Math.imul(Z,De),j=j+Math.imul(X,et)|0,I=I+Math.imul(X,it)|0,I=I+Math.imul(le,et)|0,D=D+Math.imul(le,it)|0;var br=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(br>>>26)|0,br&=67108863,j=Math.imul(re,he),I=Math.imul(re,De),I=I+Math.imul(W,he)|0,D=Math.imul(W,De),j=j+Math.imul(ee,et)|0,I=I+Math.imul(ee,it)|0,I=I+Math.imul(Z,et)|0,D=D+Math.imul(Z,it)|0,j=j+Math.imul(X,pt)|0,I=I+Math.imul(X,tr)|0,I=I+Math.imul(le,pt)|0,D=D+Math.imul(le,tr)|0;var Q=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(Q>>>26)|0,Q&=67108863,j=Math.imul(J,he),I=Math.imul(J,De),I=I+Math.imul(me,he)|0,D=Math.imul(me,De),j=j+Math.imul(re,et)|0,I=I+Math.imul(re,it)|0,I=I+Math.imul(W,et)|0,D=D+Math.imul(W,it)|0,j=j+Math.imul(ee,pt)|0,I=I+Math.imul(ee,tr)|0,I=I+Math.imul(Z,pt)|0,D=D+Math.imul(Z,tr)|0,j=j+Math.imul(X,At)|0,I=I+Math.imul(X,mt)|0,I=I+Math.imul(le,At)|0,D=D+Math.imul(le,mt)|0;var se=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(se>>>26)|0,se&=67108863,j=Math.imul(Ce,he),I=Math.imul(Ce,De),I=I+Math.imul(Fe,he)|0,D=Math.imul(Fe,De),j=j+Math.imul(J,et)|0,I=I+Math.imul(J,it)|0,I=I+Math.imul(me,et)|0,D=D+Math.imul(me,it)|0,j=j+Math.imul(re,pt)|0,I=I+Math.imul(re,tr)|0,I=I+Math.imul(W,pt)|0,D=D+Math.imul(W,tr)|0,j=j+Math.imul(ee,At)|0,I=I+Math.imul(ee,mt)|0,I=I+Math.imul(Z,At)|0,D=D+Math.imul(Z,mt)|0,j=j+Math.imul(X,dt)|0,I=I+Math.imul(X,Nt)|0,I=I+Math.imul(le,dt)|0,D=D+Math.imul(le,Nt)|0;var de=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(de>>>26)|0,de&=67108863,j=Math.imul(Ye,he),I=Math.imul(Ye,De),I=I+Math.imul(lt,he)|0,D=Math.imul(lt,De),j=j+Math.imul(Ce,et)|0,I=I+Math.imul(Ce,it)|0,I=I+Math.imul(Fe,et)|0,D=D+Math.imul(Fe,it)|0,j=j+Math.imul(J,pt)|0,I=I+Math.imul(J,tr)|0,I=I+Math.imul(me,pt)|0,D=D+Math.imul(me,tr)|0,j=j+Math.imul(re,At)|0,I=I+Math.imul(re,mt)|0,I=I+Math.imul(W,At)|0,D=D+Math.imul(W,mt)|0,j=j+Math.imul(ee,dt)|0,I=I+Math.imul(ee,Nt)|0,I=I+Math.imul(Z,dt)|0,D=D+Math.imul(Z,Nt)|0,j=j+Math.imul(X,gt)|0,I=I+Math.imul(X,Vt)|0,I=I+Math.imul(le,gt)|0,D=D+Math.imul(le,Vt)|0;var ue=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(ue>>>26)|0,ue&=67108863,j=Math.imul(He,he),I=Math.imul(He,De),I=I+Math.imul(Ve,he)|0,D=Math.imul(Ve,De),j=j+Math.imul(Ye,et)|0,I=I+Math.imul(Ye,it)|0,I=I+Math.imul(lt,et)|0,D=D+Math.imul(lt,it)|0,j=j+Math.imul(Ce,pt)|0,I=I+Math.imul(Ce,tr)|0,I=I+Math.imul(Fe,pt)|0,D=D+Math.imul(Fe,tr)|0,j=j+Math.imul(J,At)|0,I=I+Math.imul(J,mt)|0,I=I+Math.imul(me,At)|0,D=D+Math.imul(me,mt)|0,j=j+Math.imul(re,dt)|0,I=I+Math.imul(re,Nt)|0,I=I+Math.imul(W,dt)|0,D=D+Math.imul(W,Nt)|0,j=j+Math.imul(ee,gt)|0,I=I+Math.imul(ee,Vt)|0,I=I+Math.imul(Z,gt)|0,D=D+Math.imul(Z,Vt)|0,j=j+Math.imul(X,at)|0,I=I+Math.imul(X,Gt)|0,I=I+Math.imul(le,at)|0,D=D+Math.imul(le,Gt)|0;var we=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(we>>>26)|0,we&=67108863,j=Math.imul(Ne,he),I=Math.imul(Ne,De),I=I+Math.imul(Oe,he)|0,D=Math.imul(Oe,De),j=j+Math.imul(He,et)|0,I=I+Math.imul(He,it)|0,I=I+Math.imul(Ve,et)|0,D=D+Math.imul(Ve,it)|0,j=j+Math.imul(Ye,pt)|0,I=I+Math.imul(Ye,tr)|0,I=I+Math.imul(lt,pt)|0,D=D+Math.imul(lt,tr)|0,j=j+Math.imul(Ce,At)|0,I=I+Math.imul(Ce,mt)|0,I=I+Math.imul(Fe,At)|0,D=D+Math.imul(Fe,mt)|0,j=j+Math.imul(J,dt)|0,I=I+Math.imul(J,Nt)|0,I=I+Math.imul(me,dt)|0,D=D+Math.imul(me,Nt)|0,j=j+Math.imul(re,gt)|0,I=I+Math.imul(re,Vt)|0,I=I+Math.imul(W,gt)|0,D=D+Math.imul(W,Vt)|0,j=j+Math.imul(ee,at)|0,I=I+Math.imul(ee,Gt)|0,I=I+Math.imul(Z,at)|0,D=D+Math.imul(Z,Gt)|0,j=j+Math.imul(X,yt)|0,I=I+Math.imul(X,Qe)|0,I=I+Math.imul(le,yt)|0,D=D+Math.imul(le,Qe)|0;var Re=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(Re>>>26)|0,Re&=67108863,j=Math.imul(Y,he),I=Math.imul(Y,De),I=I+Math.imul(F,he)|0,D=Math.imul(F,De),j=j+Math.imul(Ne,et)|0,I=I+Math.imul(Ne,it)|0,I=I+Math.imul(Oe,et)|0,D=D+Math.imul(Oe,it)|0,j=j+Math.imul(He,pt)|0,I=I+Math.imul(He,tr)|0,I=I+Math.imul(Ve,pt)|0,D=D+Math.imul(Ve,tr)|0,j=j+Math.imul(Ye,At)|0,I=I+Math.imul(Ye,mt)|0,I=I+Math.imul(lt,At)|0,D=D+Math.imul(lt,mt)|0,j=j+Math.imul(Ce,dt)|0,I=I+Math.imul(Ce,Nt)|0,I=I+Math.imul(Fe,dt)|0,D=D+Math.imul(Fe,Nt)|0,j=j+Math.imul(J,gt)|0,I=I+Math.imul(J,Vt)|0,I=I+Math.imul(me,gt)|0,D=D+Math.imul(me,Vt)|0,j=j+Math.imul(re,at)|0,I=I+Math.imul(re,Gt)|0,I=I+Math.imul(W,at)|0,D=D+Math.imul(W,Gt)|0,j=j+Math.imul(ee,yt)|0,I=I+Math.imul(ee,Qe)|0,I=I+Math.imul(Z,yt)|0,D=D+Math.imul(Z,Qe)|0,j=j+Math.imul(X,_t)|0,I=I+Math.imul(X,Zt)|0,I=I+Math.imul(le,_t)|0,D=D+Math.imul(le,Zt)|0;var qe=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(qe>>>26)|0,qe&=67108863,j=Math.imul(ie,he),I=Math.imul(ie,De),I=I+Math.imul(pe,he)|0,D=Math.imul(pe,De),j=j+Math.imul(Y,et)|0,I=I+Math.imul(Y,it)|0,I=I+Math.imul(F,et)|0,D=D+Math.imul(F,it)|0,j=j+Math.imul(Ne,pt)|0,I=I+Math.imul(Ne,tr)|0,I=I+Math.imul(Oe,pt)|0,D=D+Math.imul(Oe,tr)|0,j=j+Math.imul(He,At)|0,I=I+Math.imul(He,mt)|0,I=I+Math.imul(Ve,At)|0,D=D+Math.imul(Ve,mt)|0,j=j+Math.imul(Ye,dt)|0,I=I+Math.imul(Ye,Nt)|0,I=I+Math.imul(lt,dt)|0,D=D+Math.imul(lt,Nt)|0,j=j+Math.imul(Ce,gt)|0,I=I+Math.imul(Ce,Vt)|0,I=I+Math.imul(Fe,gt)|0,D=D+Math.imul(Fe,Vt)|0,j=j+Math.imul(J,at)|0,I=I+Math.imul(J,Gt)|0,I=I+Math.imul(me,at)|0,D=D+Math.imul(me,Gt)|0,j=j+Math.imul(re,yt)|0,I=I+Math.imul(re,Qe)|0,I=I+Math.imul(W,yt)|0,D=D+Math.imul(W,Qe)|0,j=j+Math.imul(ee,_t)|0,I=I+Math.imul(ee,Zt)|0,I=I+Math.imul(Z,_t)|0,D=D+Math.imul(Z,Zt)|0,j=j+Math.imul(X,qt)|0,I=I+Math.imul(X,Ar)|0,I=I+Math.imul(le,qt)|0,D=D+Math.imul(le,Ar)|0;var Be=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(Be>>>26)|0,Be&=67108863,j=Math.imul(ie,et),I=Math.imul(ie,it),I=I+Math.imul(pe,et)|0,D=Math.imul(pe,it),j=j+Math.imul(Y,pt)|0,I=I+Math.imul(Y,tr)|0,I=I+Math.imul(F,pt)|0,D=D+Math.imul(F,tr)|0,j=j+Math.imul(Ne,At)|0,I=I+Math.imul(Ne,mt)|0,I=I+Math.imul(Oe,At)|0,D=D+Math.imul(Oe,mt)|0,j=j+Math.imul(He,dt)|0,I=I+Math.imul(He,Nt)|0,I=I+Math.imul(Ve,dt)|0,D=D+Math.imul(Ve,Nt)|0,j=j+Math.imul(Ye,gt)|0,I=I+Math.imul(Ye,Vt)|0,I=I+Math.imul(lt,gt)|0,D=D+Math.imul(lt,Vt)|0,j=j+Math.imul(Ce,at)|0,I=I+Math.imul(Ce,Gt)|0,I=I+Math.imul(Fe,at)|0,D=D+Math.imul(Fe,Gt)|0,j=j+Math.imul(J,yt)|0,I=I+Math.imul(J,Qe)|0,I=I+Math.imul(me,yt)|0,D=D+Math.imul(me,Qe)|0,j=j+Math.imul(re,_t)|0,I=I+Math.imul(re,Zt)|0,I=I+Math.imul(W,_t)|0,D=D+Math.imul(W,Zt)|0,j=j+Math.imul(ee,qt)|0,I=I+Math.imul(ee,Ar)|0,I=I+Math.imul(Z,qt)|0,D=D+Math.imul(Z,Ar)|0;var tt=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(tt>>>26)|0,tt&=67108863,j=Math.imul(ie,pt),I=Math.imul(ie,tr),I=I+Math.imul(pe,pt)|0,D=Math.imul(pe,tr),j=j+Math.imul(Y,At)|0,I=I+Math.imul(Y,mt)|0,I=I+Math.imul(F,At)|0,D=D+Math.imul(F,mt)|0,j=j+Math.imul(Ne,dt)|0,I=I+Math.imul(Ne,Nt)|0,I=I+Math.imul(Oe,dt)|0,D=D+Math.imul(Oe,Nt)|0,j=j+Math.imul(He,gt)|0,I=I+Math.imul(He,Vt)|0,I=I+Math.imul(Ve,gt)|0,D=D+Math.imul(Ve,Vt)|0,j=j+Math.imul(Ye,at)|0,I=I+Math.imul(Ye,Gt)|0,I=I+Math.imul(lt,at)|0,D=D+Math.imul(lt,Gt)|0,j=j+Math.imul(Ce,yt)|0,I=I+Math.imul(Ce,Qe)|0,I=I+Math.imul(Fe,yt)|0,D=D+Math.imul(Fe,Qe)|0,j=j+Math.imul(J,_t)|0,I=I+Math.imul(J,Zt)|0,I=I+Math.imul(me,_t)|0,D=D+Math.imul(me,Zt)|0,j=j+Math.imul(re,qt)|0,I=I+Math.imul(re,Ar)|0,I=I+Math.imul(W,qt)|0,D=D+Math.imul(W,Ar)|0;var wt=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(wt>>>26)|0,wt&=67108863,j=Math.imul(ie,At),I=Math.imul(ie,mt),I=I+Math.imul(pe,At)|0,D=Math.imul(pe,mt),j=j+Math.imul(Y,dt)|0,I=I+Math.imul(Y,Nt)|0,I=I+Math.imul(F,dt)|0,D=D+Math.imul(F,Nt)|0,j=j+Math.imul(Ne,gt)|0,I=I+Math.imul(Ne,Vt)|0,I=I+Math.imul(Oe,gt)|0,D=D+Math.imul(Oe,Vt)|0,j=j+Math.imul(He,at)|0,I=I+Math.imul(He,Gt)|0,I=I+Math.imul(Ve,at)|0,D=D+Math.imul(Ve,Gt)|0,j=j+Math.imul(Ye,yt)|0,I=I+Math.imul(Ye,Qe)|0,I=I+Math.imul(lt,yt)|0,D=D+Math.imul(lt,Qe)|0,j=j+Math.imul(Ce,_t)|0,I=I+Math.imul(Ce,Zt)|0,I=I+Math.imul(Fe,_t)|0,D=D+Math.imul(Fe,Zt)|0,j=j+Math.imul(J,qt)|0,I=I+Math.imul(J,Ar)|0,I=I+Math.imul(me,qt)|0,D=D+Math.imul(me,Ar)|0;var Pt=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,j=Math.imul(ie,dt),I=Math.imul(ie,Nt),I=I+Math.imul(pe,dt)|0,D=Math.imul(pe,Nt),j=j+Math.imul(Y,gt)|0,I=I+Math.imul(Y,Vt)|0,I=I+Math.imul(F,gt)|0,D=D+Math.imul(F,Vt)|0,j=j+Math.imul(Ne,at)|0,I=I+Math.imul(Ne,Gt)|0,I=I+Math.imul(Oe,at)|0,D=D+Math.imul(Oe,Gt)|0,j=j+Math.imul(He,yt)|0,I=I+Math.imul(He,Qe)|0,I=I+Math.imul(Ve,yt)|0,D=D+Math.imul(Ve,Qe)|0,j=j+Math.imul(Ye,_t)|0,I=I+Math.imul(Ye,Zt)|0,I=I+Math.imul(lt,_t)|0,D=D+Math.imul(lt,Zt)|0,j=j+Math.imul(Ce,qt)|0,I=I+Math.imul(Ce,Ar)|0,I=I+Math.imul(Fe,qt)|0,D=D+Math.imul(Fe,Ar)|0;var Et=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(Et>>>26)|0,Et&=67108863,j=Math.imul(ie,gt),I=Math.imul(ie,Vt),I=I+Math.imul(pe,gt)|0,D=Math.imul(pe,Vt),j=j+Math.imul(Y,at)|0,I=I+Math.imul(Y,Gt)|0,I=I+Math.imul(F,at)|0,D=D+Math.imul(F,Gt)|0,j=j+Math.imul(Ne,yt)|0,I=I+Math.imul(Ne,Qe)|0,I=I+Math.imul(Oe,yt)|0,D=D+Math.imul(Oe,Qe)|0,j=j+Math.imul(He,_t)|0,I=I+Math.imul(He,Zt)|0,I=I+Math.imul(Ve,_t)|0,D=D+Math.imul(Ve,Zt)|0,j=j+Math.imul(Ye,qt)|0,I=I+Math.imul(Ye,Ar)|0,I=I+Math.imul(lt,qt)|0,D=D+Math.imul(lt,Ar)|0;var ir=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(ir>>>26)|0,ir&=67108863,j=Math.imul(ie,at),I=Math.imul(ie,Gt),I=I+Math.imul(pe,at)|0,D=Math.imul(pe,Gt),j=j+Math.imul(Y,yt)|0,I=I+Math.imul(Y,Qe)|0,I=I+Math.imul(F,yt)|0,D=D+Math.imul(F,Qe)|0,j=j+Math.imul(Ne,_t)|0,I=I+Math.imul(Ne,Zt)|0,I=I+Math.imul(Oe,_t)|0,D=D+Math.imul(Oe,Zt)|0,j=j+Math.imul(He,qt)|0,I=I+Math.imul(He,Ar)|0,I=I+Math.imul(Ve,qt)|0,D=D+Math.imul(Ve,Ar)|0;var Qt=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,j=Math.imul(ie,yt),I=Math.imul(ie,Qe),I=I+Math.imul(pe,yt)|0,D=Math.imul(pe,Qe),j=j+Math.imul(Y,_t)|0,I=I+Math.imul(Y,Zt)|0,I=I+Math.imul(F,_t)|0,D=D+Math.imul(F,Zt)|0,j=j+Math.imul(Ne,qt)|0,I=I+Math.imul(Ne,Ar)|0,I=I+Math.imul(Oe,qt)|0,D=D+Math.imul(Oe,Ar)|0;var rn=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(rn>>>26)|0,rn&=67108863,j=Math.imul(ie,_t),I=Math.imul(ie,Zt),I=I+Math.imul(pe,_t)|0,D=Math.imul(pe,Zt),j=j+Math.imul(Y,qt)|0,I=I+Math.imul(Y,Ar)|0,I=I+Math.imul(F,qt)|0,D=D+Math.imul(F,Ar)|0;var Mr=(O+j|0)+((I&8191)<<13)|0;O=(D+(I>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,j=Math.imul(ie,qt),I=Math.imul(ie,Ar),I=I+Math.imul(pe,qt)|0,D=Math.imul(pe,Ar);var ln=(O+j|0)+((I&8191)<<13)|0;return O=(D+(I>>>13)|0)+(ln>>>26)|0,ln&=67108863,L[0]=cr,L[1]=br,L[2]=Q,L[3]=se,L[4]=de,L[5]=ue,L[6]=we,L[7]=Re,L[8]=qe,L[9]=Be,L[10]=tt,L[11]=wt,L[12]=Pt,L[13]=Et,L[14]=ir,L[15]=Qt,L[16]=rn,L[17]=Mr,L[18]=ln,O!==0&&(L[19]=O,b.length++),b};Math.imul||(w=m);function E(K,N,k){k.negative=N.negative^K.negative,k.length=K.length+N.length;for(var b=0,x=0,P=0;P>>26)|0,x+=L>>>26,L&=67108863}k.words[P]=O,b=L,L=x}return b!==0?k.words[P]=b:k.length--,k.strip()}function v(K,N,k){var b=new _;return b.mulp(K,N,k)}s.prototype.mulTo=function(N,k){var b,x=this.length+N.length;return this.length===10&&N.length===10?b=w(this,N,k):x<63?b=m(this,N,k):x<1024?b=E(this,N,k):b=v(this,N,k),b};function _(K,N){this.x=K,this.y=N}_.prototype.makeRBT=function(N){for(var k=new Array(N),b=s.prototype._countBits(N)-1,x=0;x>=1;return x},_.prototype.permute=function(N,k,b,x,P,L){for(var O=0;O>>1)P++;return 1<>>13,b[2*L+1]=P&8191,P=P>>>13;for(L=2*k;L>=26,k+=x/67108864|0,k+=P>>>26,this.words[b]=P&67108863}return k!==0&&(this.words[b]=k,this.length++),this},s.prototype.muln=function(N){return this.clone().imuln(N)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(N){var k=g(N);if(k.length===0)return new s(1);for(var b=this,x=0;x=0);var k=N%26,b=(N-k)/26,x=67108863>>>26-k<<26-k,P;if(k!==0){var L=0;for(P=0;P>>26-k}L&&(this.words[P]=L,this.length++)}if(b!==0){for(P=this.length-1;P>=0;P--)this.words[P+b]=this.words[P];for(P=0;P=0);var x;k?x=(k-k%26)/26:x=0;var P=N%26,L=Math.min((N-P)/26,this.length),O=67108863^67108863>>>P<L)for(this.length-=L,I=0;I=0&&(D!==0||I>=x);I--){var M=this.words[I]|0;this.words[I]=D<<26-P|M>>>P,D=M&O}return j&&D!==0&&(j.words[j.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(N,k,b){return n(this.negative===0),this.iushrn(N,k,b)},s.prototype.shln=function(N){return this.clone().ishln(N)},s.prototype.ushln=function(N){return this.clone().iushln(N)},s.prototype.shrn=function(N){return this.clone().ishrn(N)},s.prototype.ushrn=function(N){return this.clone().iushrn(N)},s.prototype.testn=function(N){n(typeof N=="number"&&N>=0);var k=N%26,b=(N-k)/26,x=1<=0);var k=N%26,b=(N-k)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(k!==0&&b++,this.length=Math.min(b,this.length),k!==0){var x=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},s.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)-(j/67108864|0),this.words[P+b]=L&67108863}for(;P>26,this.words[P+b]=L&67108863;if(O===0)return this.strip();for(n(O===-1),O=0,P=0;P>26,this.words[P]=L&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(N,k){var b=this.length-N.length,x=this.clone(),P=N,L=P.words[P.length-1]|0,O=this._countBits(L);b=26-O,b!==0&&(P=P.ushln(b),x.iushln(b),L=P.words[P.length-1]|0);var j=x.length-P.length,I;if(k!=="mod"){I=new s(null),I.length=j+1,I.words=new Array(I.length);for(var D=0;D=0;X--){var le=(x.words[P.length+X]|0)*67108864+(x.words[P.length+X-1]|0);for(le=Math.min(le/L|0,67108863),x._ishlnsubmul(P,le,X);x.negative!==0;)le--,x.negative=0,x._ishlnsubmul(P,1,X),x.isZero()||(x.negative^=1);I&&(I.words[X]=le)}return I&&I.strip(),x.strip(),k!=="div"&&b!==0&&x.iushrn(b),{div:I||null,mod:x}},s.prototype.divmod=function(N,k,b){if(n(!N.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var x,P,L;return this.negative!==0&&N.negative===0?(L=this.neg().divmod(N,k),k!=="mod"&&(x=L.div.neg()),k!=="div"&&(P=L.mod.neg(),b&&P.negative!==0&&P.iadd(N)),{div:x,mod:P}):this.negative===0&&N.negative!==0?(L=this.divmod(N.neg(),k),k!=="mod"&&(x=L.div.neg()),{div:x,mod:L.mod}):this.negative&N.negative?(L=this.neg().divmod(N.neg(),k),k!=="div"&&(P=L.mod.neg(),b&&P.negative!==0&&P.isub(N)),{div:L.div,mod:P}):N.length>this.length||this.cmp(N)<0?{div:new s(0),mod:this}:N.length===1?k==="div"?{div:this.divn(N.words[0]),mod:null}:k==="mod"?{div:null,mod:new s(this.modn(N.words[0]))}:{div:this.divn(N.words[0]),mod:new s(this.modn(N.words[0]))}:this._wordDiv(N,k)},s.prototype.div=function(N){return this.divmod(N,"div",!1).div},s.prototype.mod=function(N){return this.divmod(N,"mod",!1).mod},s.prototype.umod=function(N){return this.divmod(N,"mod",!0).mod},s.prototype.divRound=function(N){var k=this.divmod(N);if(k.mod.isZero())return k.div;var b=k.div.negative!==0?k.mod.isub(N):k.mod,x=N.ushrn(1),P=N.andln(1),L=b.cmp(x);return L<0||P===1&&L===0?k.div:k.div.negative!==0?k.div.isubn(1):k.div.iaddn(1)},s.prototype.modn=function(N){n(N<=67108863);for(var k=(1<<26)%N,b=0,x=this.length-1;x>=0;x--)b=(k*b+(this.words[x]|0))%N;return b},s.prototype.idivn=function(N){n(N<=67108863);for(var k=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+k*67108864;this.words[b]=x/N|0,k=x%N}return this.strip()},s.prototype.divn=function(N){return this.clone().idivn(N)},s.prototype.egcd=function(N){n(N.negative===0),n(!N.isZero());var k=this,b=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var x=new s(1),P=new s(0),L=new s(0),O=new s(1),j=0;k.isEven()&&b.isEven();)k.iushrn(1),b.iushrn(1),++j;for(var I=b.clone(),D=k.clone();!k.isZero();){for(var M=0,X=1;!(k.words[0]&X)&&M<26;++M,X<<=1);if(M>0)for(k.iushrn(M);M-- >0;)(x.isOdd()||P.isOdd())&&(x.iadd(I),P.isub(D)),x.iushrn(1),P.iushrn(1);for(var le=0,H=1;!(b.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(b.iushrn(le);le-- >0;)(L.isOdd()||O.isOdd())&&(L.iadd(I),O.isub(D)),L.iushrn(1),O.iushrn(1);k.cmp(b)>=0?(k.isub(b),x.isub(L),P.isub(O)):(b.isub(k),L.isub(x),O.isub(P))}return{a:L,b:O,gcd:b.iushln(j)}},s.prototype._invmp=function(N){n(N.negative===0),n(!N.isZero());var k=this,b=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var x=new s(1),P=new s(0),L=b.clone();k.cmpn(1)>0&&b.cmpn(1)>0;){for(var O=0,j=1;!(k.words[0]&j)&&O<26;++O,j<<=1);if(O>0)for(k.iushrn(O);O-- >0;)x.isOdd()&&x.iadd(L),x.iushrn(1);for(var I=0,D=1;!(b.words[0]&D)&&I<26;++I,D<<=1);if(I>0)for(b.iushrn(I);I-- >0;)P.isOdd()&&P.iadd(L),P.iushrn(1);k.cmp(b)>=0?(k.isub(b),x.isub(P)):(b.isub(k),P.isub(x))}var M;return k.cmpn(1)===0?M=x:M=P,M.cmpn(0)<0&&M.iadd(N),M},s.prototype.gcd=function(N){if(this.isZero())return N.abs();if(N.isZero())return this.abs();var k=this.clone(),b=N.clone();k.negative=0,b.negative=0;for(var x=0;k.isEven()&&b.isEven();x++)k.iushrn(1),b.iushrn(1);do{for(;k.isEven();)k.iushrn(1);for(;b.isEven();)b.iushrn(1);var P=k.cmp(b);if(P<0){var L=k;k=b,b=L}else if(P===0||b.cmpn(1)===0)break;k.isub(b)}while(!0);return b.iushln(x)},s.prototype.invm=function(N){return this.egcd(N).a.umod(N)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(N){return this.words[0]&N},s.prototype.bincn=function(N){n(typeof N=="number");var k=N%26,b=(N-k)/26,x=1<>>26,O&=67108863,this.words[L]=O}return P!==0&&(this.words[L]=P,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.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 b;if(this.length>1)b=1;else{k&&(N=-N),n(N<=67108863,"Number is too big");var x=this.words[0]|0;b=x===N?0:xN.length)return 1;if(this.length=0;b--){var x=this.words[b]|0,P=N.words[b]|0;if(x!==P){xP&&(k=1);break}}return k},s.prototype.gtn=function(N){return this.cmpn(N)===1},s.prototype.gt=function(N){return this.cmp(N)===1},s.prototype.gten=function(N){return this.cmpn(N)>=0},s.prototype.gte=function(N){return this.cmp(N)>=0},s.prototype.ltn=function(N){return this.cmpn(N)===-1},s.prototype.lt=function(N){return this.cmp(N)===-1},s.prototype.lten=function(N){return this.cmpn(N)<=0},s.prototype.lte=function(N){return this.cmp(N)<=0},s.prototype.eqn=function(N){return this.cmpn(N)===0},s.prototype.eq=function(N){return this.cmp(N)===0},s.red=function(N){return new G(N)},s.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)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(N){return this.red=N,this},s.prototype.forceRed=function(N){return n(!this.red,"Already a number in reduction context"),this._forceRed(N)},s.prototype.redAdd=function(N){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,N)},s.prototype.redIAdd=function(N){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,N)},s.prototype.redSub=function(N){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,N)},s.prototype.redISub=function(N){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,N)},s.prototype.redShl=function(N){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,N)},s.prototype.redMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.mul(this,N)},s.prototype.redIMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.imul(this,N)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.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 C(K,N){this.name=K,this.p=new s(N,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}C.prototype._tmp=function(){var N=new s(null);return N.words=new Array(Math.ceil(this.n/13)),N},C.prototype.ireduce=function(N){var k=N,b;do this.split(k,this.tmp),k=this.imulK(k),k=k.iadd(this.tmp),b=k.bitLength();while(b>this.n);var x=b0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},C.prototype.split=function(N,k){N.iushrn(this.n,0,k)},C.prototype.imulK=function(N){return N.imul(this.k)};function R(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(R,C),R.prototype.split=function(N,k){for(var b=4194303,x=Math.min(N.length,9),P=0;P>>22,L=O}L>>>=22,N.words[P-10]=L,L===0&&N.length>10?N.length-=10:N.length-=9},R.prototype.imulK=function(N){N.words[N.length]=0,N.words[N.length+1]=0,N.length+=2;for(var k=0,b=0;b>>=26,N.words[b]=P,k=x}return k!==0&&(N.words[N.length++]=k),N},s._prime=function(N){if(A[N])return A[N];var k;if(N==="k256")k=new R;else if(N==="p224")k=new B;else if(N==="p192")k=new S;else if(N==="p25519")k=new U;else throw new Error("Unknown prime "+N);return A[N]=k,k};function G(K){if(typeof K=="string"){var N=s._prime(K);this.m=N.p,this.prime=N}else n(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}G.prototype._verify1=function(N){n(N.negative===0,"red works only with positives"),n(N.red,"red works only with red numbers")},G.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")},G.prototype.imod=function(N){return this.prime?this.prime.ireduce(N)._forceRed(this):N.umod(this.m)._forceRed(this)},G.prototype.neg=function(N){return N.isZero()?N.clone():this.m.sub(N)._forceRed(this)},G.prototype.add=function(N,k){this._verify2(N,k);var b=N.add(k);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},G.prototype.iadd=function(N,k){this._verify2(N,k);var b=N.iadd(k);return b.cmp(this.m)>=0&&b.isub(this.m),b},G.prototype.sub=function(N,k){this._verify2(N,k);var b=N.sub(k);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},G.prototype.isub=function(N,k){this._verify2(N,k);var b=N.isub(k);return b.cmpn(0)<0&&b.iadd(this.m),b},G.prototype.shl=function(N,k){return this._verify1(N),this.imod(N.ushln(k))},G.prototype.imul=function(N,k){return this._verify2(N,k),this.imod(N.imul(k))},G.prototype.mul=function(N,k){return this._verify2(N,k),this.imod(N.mul(k))},G.prototype.isqr=function(N){return this.imul(N,N.clone())},G.prototype.sqr=function(N){return this.mul(N,N)},G.prototype.sqrt=function(N){if(N.isZero())return N.clone();var k=this.m.andln(3);if(n(k%2===1),k===3){var b=this.m.add(new s(1)).iushrn(2);return this.pow(N,b)}for(var x=this.m.subn(1),P=0;!x.isZero()&&x.andln(1)===0;)P++,x.iushrn(1);n(!x.isZero());var L=new s(1).toRed(this),O=L.redNeg(),j=this.m.subn(1).iushrn(1),I=this.m.bitLength();for(I=new s(2*I*I).toRed(this);this.pow(I,j).cmp(O)!==0;)I.redIAdd(O);for(var D=this.pow(I,x),M=this.pow(N,x.addn(1).iushrn(1)),X=this.pow(N,x),le=P;X.cmp(L)!==0;){for(var H=X,ee=0;H.cmp(L)!==0;ee++)H=H.redSqr();n(ee=0;P--){for(var D=k.words[P],M=I-1;M>=0;M--){var X=D>>M&1;if(L!==x[0]&&(L=this.sqr(L)),X===0&&O===0){j=0;continue}O<<=1,O|=X,j++,!(j!==b&&(P!==0||M!==0))&&(L=this.mul(L,x[O]),j=0,O=0)}I=26}return L},G.prototype.convertTo=function(N){var k=N.umod(this.m);return k===N?k.clone():k},G.prototype.convertFrom=function(N){var k=N.clone();return k.red=null,k},s.mont=function(N){return new oe(N)};function oe(K){G.call(this,K),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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(oe,G),oe.prototype.convertTo=function(N){return this.imod(N.ushln(this.shift))},oe.prototype.convertFrom=function(N){var k=this.imod(N.mul(this.rinv));return k.red=null,k},oe.prototype.imul=function(N,k){if(N.isZero()||k.isZero())return N.words[0]=0,N.length=1,N;var b=N.imul(k),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=b.isub(x).iushrn(this.shift),L=P;return P.cmp(this.m)>=0?L=P.isub(this.m):P.cmpn(0)<0&&(L=P.iadd(this.m)),L._forceRed(this)},oe.prototype.mul=function(N,k){if(N.isZero()||k.isZero())return new s(0)._forceRed(this);var b=N.mul(k),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=b.isub(x).iushrn(this.shift),L=P;return P.cmp(this.m)>=0?L=P.isub(this.m):P.cmpn(0)<0&&(L=P.iadd(this.m)),L._forceRed(this)},oe.prototype.invm=function(N){var k=this.imod(N._invmp(this.m).mul(this.r2));return k._forceRed(this)}})(t,Xt)})(EN);var Rd=EN.exports,CN={};(function(t){var e=t;function r(s,o){if(Array.isArray(s))return s.slice();if(!s)return[];var a=[];if(typeof s!="string"){for(var l=0;l>8,f=c&255;u?a.push(u,f):a.push(f)}return a}e.toArray=r;function n(s){return s.length===1?"0"+s:s}e.zero2=n;function i(s){for(var o="",a=0;a(w>>1)-1?v=(w>>1)-_:v=_,E.isubn(v)):v=0,g[m]=v,E.iushrn(1)}return g}e.getNAF=s;function o(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 E=u.andln(3)+g&3,v=f.andln(3)+m&3;E===3&&(E=-1),v===3&&(v=-1);var _;E&1?(w=u.andln(7)+g&7,(w===3||w===5)&&v===2?_=-E:_=E):_=0,h[0].push(_);var A;v&1?(w=f.andln(7)+m&7,(w===3||w===5)&&E===2?A=-v:A=v):A=0,h[1].push(A),2*g===_+1&&(g=1-g),2*m===A+1&&(m=1-m),u.iushrn(1),f.iushrn(1)}return h}e.getJSF=o;function a(u,f,h){var g="_"+f;u.prototype[f]=function(){return this[g]!==void 0?this[g]:this[g]=h.call(this)}}e.cachedProperty=a;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})(Sa);var AN={exports:{}},WE;AN.exports=function(e){return WE||(WE=new gf(null)),WE.generate(e)};function gf(t){this.rand=t}AN.exports.Rand=gf;gf.prototype.generate=function(e){return this._rand(e)};gf.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 k_=sh;sh.prototype.point=function(){throw new Error("Not implemented")};sh.prototype.validate=function(){throw new Error("Not implemented")};sh.prototype._fixedNafMul=function(e,r){J6(e.precomputed);var n=e._getDoubles(),i=Z6(r,1,this._bitLength),s=(1<=a;c--)l=(l<<1)+i[c];o.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=s;h>0;h--){for(a=0;a=0;l--){for(var c=0;l>=0&&o[l]===0;l--)c++;if(l>=0&&c++,a=a.dblp(c),l<0)break;var u=o[l];J6(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};sh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,l=this._wnafT3,c=0,u,f,h;for(u=0;u=1;u-=2){var m=u-1,w=u;if(o[m]!==1||o[w]!==1){l[m]=Z6(n[m],o[m],this._bitLength),l[w]=Z6(n[w],o[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var E=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(E[1]=r[m].add(r[w]),E[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(E[1]=r[m].toJ().mixedAdd(r[w]),E[2]=r[m].add(r[w].neg())):(E[1]=r[m].toJ().mixedAdd(r[w]),E[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],_=gje(n[m],n[w]);for(c=Math.max(_[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var S=0;u>=0;){var U=!0;for(f=0;f=0&&S++,R=R.dblp(S),u<0)break;for(f=0;f0?h=a[f][G-1>>1]:G<0&&(h=a[f][-G-1>>1].neg()),h.type==="affine"?R=R.mixedAdd(h):R=R.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};ul.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=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}]};dl.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),l=o.mul(i.a),c=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};dl.prototype.pointFromX=function(e,r){e=new ti(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 s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};dl.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};dl.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};ns.prototype.isInfinity=function(){return this.inf};ns.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)};ns.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(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};ns.prototype.getX=function(){return this.x.fromRed()};ns.prototype.getY=function(){return this.y.fromRed()};ns.prototype.mul=function(e){return e=new ti(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)};ns.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};ns.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};ns.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)};ns.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(s){return s.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};ns.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 ps(t,e,r,n){em.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ti(0)):(this.x=new ti(e,16),this.y=new ti(r,16),this.z=new ti(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(ps,em.BasePoint);dl.prototype.jpoint=function(e,r,n){return new ps(this,e,r,n)};ps.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)};ps.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ps.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),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),c=o.redSub(a);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(o.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};ps.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),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),l=s.redSub(o);if(a.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=n.redMul(c),h=l.redSqr().redIAdd(u).redISub(f).redISub(f),g=l.redMul(f.redISub(h)).redISub(s.redMul(u)),m=this.z.redMul(a);return this.curve.jpoint(h,g,m)};ps.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(s),this.x.cmp(n)===0)return!0}};ps.prototype.inspect=function(){return this.isInfinity()?"":""};ps.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var E1=Rd,Kee=io,N_=k_,wje=Sa;function tm(t){N_.call(this,"mont",t),this.a=new E1(t.a,16).toRed(this.red),this.b=new E1(t.b,16).toRed(this.red),this.i4=new E1(4).toRed(this.red).redInvm(),this.two=new E1(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Kee(tm,N_);var bje=tm;tm.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),s=i.redSqrt();return s.redSqr().cmp(i)===0};function ts(t,e,r){N_.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new E1(e,16),this.z=new E1(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Kee(ts,N_.BasePoint);tm.prototype.decodePoint=function(e,r){return this.point(wje.toArray(e,r),1)};tm.prototype.point=function(e,r){return new ts(this,e,r)};tm.prototype.pointFromJSON=function(e){return ts.fromJSON(this,e)};ts.prototype.precompute=function(){};ts.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};ts.fromJSON=function(e,r){return new ts(e,r[0],r[1]||e.one)};ts.prototype.inspect=function(){return this.isInfinity()?"":""};ts.prototype.isInfinity=function(){return this.z.cmpn(0)===0};ts.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=r.redSub(i),o=r.redMul(i),a=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(o,a)};ts.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};ts.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),o=e.x.redSub(e.z),a=o.redMul(n),l=s.redMul(i),c=r.z.redMul(a.redAdd(l).redSqr()),u=r.x.redMul(a.redISub(l).redSqr());return this.curve.point(c,u)};ts.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),s=this,o=[];r.cmpn(0)!==0;r.iushrn(1))o.push(r.andln(1));for(var a=o.length-1;a>=0;a--)o[a]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i};ts.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};ts.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};ts.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};ts.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};ts.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var _je=Sa,nd=Rd,Yee=io,P_=k_,xje=_je.assert;function hu(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,P_.call(this,"edwards",t),this.a=new nd(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new nd(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new nd(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),xje(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}Yee(hu,P_);var Eje=hu;hu.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};hu.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};hu.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};hu.prototype.pointFromX=function(e,r){e=new nd(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var l=a.fromRed().isOdd();return(r&&!l||!r&&l)&&(a=a.redNeg()),this.point(e,a)};hu.prototype.pointFromY=function(e,r){e=new nd(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(o.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(a.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)};hu.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),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(s)===0};function Sn(t,e,r,n,i){P_.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 nd(e,16),this.y=new nd(r,16),this.z=n?new nd(n,16):this.curve.one,this.t=i&&new nd(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()))))}Yee(Sn,P_.BasePoint);hu.prototype.pointFromJSON=function(e){return Sn.fromJSON(this,e)};hu.prototype.point=function(e,r,n,i){return new Sn(this,e,r,n,i)};Sn.fromJSON=function(e,r){return new Sn(e,r[0],r[1],r[2])};Sn.prototype.inspect=function(){return this.isInfinity()?"":""};Sn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Sn.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),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),o=i.redAdd(r),a=o.redSub(n),l=i.redSub(r),c=s.redMul(a),u=o.redMul(l),f=s.redMul(l),h=a.redMul(o);return this.curve.point(c,u,h,f)};Sn.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,s,o,a,l,c;if(this.curve.twisted){a=this.curve._mulA(r);var u=a.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(u.redSub(this.curve.two)),s=u.redMul(a.redSub(n)),o=u.redSqr().redSub(u).redSub(u)):(l=this.z.redSqr(),c=u.redSub(l).redISub(l),i=e.redSub(r).redISub(n).redMul(c),s=u.redMul(a.redSub(n)),o=u.redMul(c))}else a=r.redAdd(n),l=this.curve._mulC(this.z).redSqr(),c=a.redSub(l).redSub(l),i=this.curve._mulC(e.redISub(a)).redMul(c),s=this.curve._mulC(a).redMul(r.redISub(n)),o=a.redMul(c);return this.curve.point(i,s,o)};Sn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Sn.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),s=this.z.redMul(e.z.redAdd(e.z)),o=n.redSub(r),a=s.redSub(i),l=s.redAdd(i),c=n.redAdd(r),u=o.redMul(a),f=l.redMul(c),h=o.redMul(c),g=a.redMul(l);return this.curve.point(u,f,g,h)};Sn.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(i).redMul(s),a=n.redSub(o),l=n.redAdd(o),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),u=r.redMul(a).redMul(c),f,h;return this.curve.twisted?(f=r.redMul(l).redMul(s.redSub(this.curve._mulA(i))),h=a.redMul(l)):(f=r.redMul(l).redMul(s.redSub(i)),h=this.curve._mulC(a).redMul(l)),this.curve.point(u,f,h)};Sn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};Sn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};Sn.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};Sn.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};Sn.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};Sn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Sn.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Sn.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Sn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Sn.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}};Sn.prototype.toP=Sn.prototype.normalize;Sn.prototype.mixedAdd=Sn.prototype.add;(function(t){var e=t;e.base=k_,e.short=vje,e.mont=bje,e.edwards=Eje})(SN);var R_={},zE,xU;function Cje(){return xU||(xU=1,zE={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"]]}}),zE}(function(t){var e=t,r=Sv,n=SN,i=Sa,s=i.assert;function o(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,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=o;function a(c,u){Object.defineProperty(e,c,{configurable:!0,enumerable:!0,get:function(){var f=new o(u);return Object.defineProperty(e,c,{configurable:!0,enumerable:!0,value:f}),f}})}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:r.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:r.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:r.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: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"]}),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: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"]}),a("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"]}),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:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var l;try{l=Cje()}catch{l=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:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",l]})})(R_);var Aje=Sv,s0=CN,Zee=W0;function Bf(t){if(!(this instanceof Bf))return new Bf(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=s0.toArray(t.entropy,t.entropyEnc||"hex"),r=s0.toArray(t.nonce,t.nonceEnc||"hex"),n=s0.toArray(t.pers,t.persEnc||"hex");Zee(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Sje=Bf;Bf.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 s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Bf.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=s0.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var Q6=Rd,TN=Sa,kje=TN.assert;function M_(t,e){if(t instanceof M_)return t;this._importDER(t,e)||(kje(t.r&&t.s,"Signature without r or s"),this.r=new Q6(t.r,16),this.s=new Q6(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Nje=M_;function Pje(){this.place=0}function HE(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,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function EU(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)}M_.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=EU(r),n=EU(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];qE(i,r.length),i=i.concat(r),i.push(2),qE(i,n.length);var s=i.concat(n),o=[48];return qE(o,s.length),o=o.concat(s),TN.encode(o,e)};var Ul=Rd,Jee=Sje,Rje=Sa,VE=R_,Mje=Gee,Fh=Rje.assert,$N=$je,O_=Nje;function il(t){if(!(this instanceof il))return new il(t);typeof t=="string"&&(Fh(Object.prototype.hasOwnProperty.call(VE,t),"Unknown curve "+t),t=VE[t]),t instanceof VE.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 Oje=il;il.prototype.keyPair=function(e){return new $N(this,e)};il.prototype.keyFromPrivate=function(e,r){return $N.fromPrivate(this,e,r)};il.prototype.keyFromPublic=function(e,r){return $N.fromPublic(this,e,r)};il.prototype.genKeyPair=function(e){e||(e={});for(var r=new Jee({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Mje(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Ul(2));;){var s=new Ul(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};il.prototype._truncateToN=function(e,r,n){var i;if(Ul.isBN(e)||typeof e=="number")e=new Ul(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new Ul(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new Ul(s,16)}typeof n!="number"&&(n=i*8);var o=n-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};il.prototype.sign=function(e,r,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!Ul.isBN(e)){Fh(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),Fh(e.length>>>0===e.length);for(var s=0;s=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 E=h.invm(this.n).mul(w.mul(r.getPrivate()).iadd(e));if(E=E.umod(this.n),E.cmpn(0)!==0){var v=(g.getY().isOdd()?1:0)|(m.cmp(w)!==0?2:0);return i.canonical&&E.cmp(this.nh)>0&&(E=this.n.sub(E),v^=1),new O_({r:w,s:E,recoveryParam:v})}}}}}};il.prototype.verify=function(e,r,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),r=new O_(r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var l=a.invm(this.n),c=l.mul(e).umod(this.n),u=l.mul(o).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(o)):(f=this.g.mulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(o)===0)};il.prototype.recoverPubKey=function(t,e,r,n){Fh((3&r)===r,"The recovery param is more than two bits"),e=new O_(e,n);var i=this.n,s=new Ul(t),o=e.r,a=e.s,l=r&1,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),h=a.mul(u).umod(i);return this.g.mulAdd(f,o,h)};il.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new O_(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var hw=Sa,Qee=hw.assert,CU=hw.parseBytes,rm=hw.cachedProperty;function Qi(t,e){this.eddsa=t,this._secret=CU(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=CU(e.pub)}Qi.fromPublic=function(e,r){return r instanceof Qi?r:new Qi(e,{pub:r})};Qi.fromSecret=function(e,r){return r instanceof Qi?r:new Qi(e,{secret:r})};Qi.prototype.secret=function(){return this._secret};rm(Qi,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});rm(Qi,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});rm(Qi,"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});rm(Qi,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});rm(Qi,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});rm(Qi,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Qi.prototype.sign=function(e){return Qee(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Qi.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};Qi.prototype.getSecret=function(e){return Qee(this._secret,"KeyPair is public only"),hw.encode(this.secret(),e)};Qi.prototype.getPublic=function(e){return hw.encode(this.pubBytes(),e)};var jje=Qi,Dje=Rd,j_=Sa,AU=j_.assert,D_=j_.cachedProperty,Lje=j_.parseBytes;function rp(t,e){this.eddsa=t,typeof e!="object"&&(e=Lje(e)),Array.isArray(e)&&(AU(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),AU(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof Dje&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}D_(rp,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});D_(rp,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});D_(rp,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});D_(rp,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});rp.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};rp.prototype.toHex=function(){return j_.encode(this.toBytes(),"hex").toUpperCase()};var Fje=rp,Uje=Sv,Bje=R_,vg=Sa,Wje=vg.assert,Xee=vg.parseBytes,ete=jje,SU=Fje;function Uo(t){if(Wje(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Uo))return new Uo(t);t=Bje[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=Uje.sha512}var zje=Uo;Uo.prototype.sign=function(e,r){e=Xee(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),o=this.encodePoint(s),a=this.hashInt(o,n.pubBytes(),e).mul(n.priv()),l=i.add(a).umod(this.curve.n);return this.makeSignature({R:s,S:l,Rencoded:o})};Uo.prototype.verify=function(e,r,n){if(e=Xee(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(r.Rencoded(),i.pubBytes(),e),o=this.g.mul(r.S()),a=r.R().add(i.pub().mul(s));return a.eq(o)};Uo.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&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=s(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},a.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}},a.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},a.prototype.cleanSavedState=function(l){r.wipe(l.stateHi),r.wipe(l.stateLo),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},a}();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 s(a,l,c,u,f,h,g){for(var m=c[0],w=c[1],E=c[2],v=c[3],_=c[4],A=c[5],C=c[6],R=c[7],B=u[0],S=u[1],U=u[2],G=u[3],oe=u[4],K=u[5],N=u[6],k=u[7],b,x,P,L,O,j,I,D;g>=128;){for(var M=0;M<16;M++){var X=8*M+h;a[M]=e.readUint32BE(f,X),l[M]=e.readUint32BE(f,X+4)}for(var M=0;M<80;M++){var le=m,H=w,ee=E,Z=v,te=_,re=A,W=C,q=R,J=B,me=S,be=U,Ce=G,Fe=oe,Ue=K,Ye=N,lt=k;if(b=R,x=k,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=(_>>>14|oe<<18)^(_>>>18|oe<<14)^(oe>>>9|_<<23),x=(oe>>>14|_<<18)^(oe>>>18|_<<14)^(_>>>9|oe<<23),O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,b=_&A^~_&C,x=oe&K^~oe&N,O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,b=i[M*2],x=i[M*2+1],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,b=a[M%16],x=l[M%16],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,P=I&65535|D<<16,L=O&65535|j<<16,b=P,x=L,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=(m>>>28|B<<4)^(B>>>2|m<<30)^(B>>>7|m<<25),x=(B>>>28|m<<4)^(m>>>2|B<<30)^(m>>>7|B<<25),O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,b=m&w^m&E^w&E,x=B&S^B&U^S&U,O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,q=I&65535|D<<16,lt=O&65535|j<<16,b=Z,x=Ce,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=P,x=L,O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,Z=I&65535|D<<16,Ce=O&65535|j<<16,w=le,E=H,v=ee,_=Z,A=te,C=re,R=W,m=q,S=J,U=me,G=be,oe=Ce,K=Fe,N=Ue,k=Ye,B=lt,M%16===15)for(var X=0;X<16;X++)b=a[X],x=l[X],O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=a[(X+9)%16],x=l[(X+9)%16],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,P=a[(X+1)%16],L=l[(X+1)%16],b=(P>>>1|L<<31)^(P>>>8|L<<24)^P>>>7,x=(L>>>1|P<<31)^(L>>>8|P<<24)^(L>>>7|P<<25),O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,P=a[(X+14)%16],L=l[(X+14)%16],b=(P>>>19|L<<13)^(L>>>29|P<<3)^P>>>6,x=(L>>>19|P<<13)^(P>>>29|L<<3)^(L>>>6|P<<26),O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,a[X]=I&65535|D<<16,l[X]=O&65535|j<<16}b=m,x=B,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=c[0],x=u[0],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,c[0]=m=I&65535|D<<16,u[0]=B=O&65535|j<<16,b=w,x=S,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=c[1],x=u[1],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,c[1]=w=I&65535|D<<16,u[1]=S=O&65535|j<<16,b=E,x=U,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=c[2],x=u[2],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,c[2]=E=I&65535|D<<16,u[2]=U=O&65535|j<<16,b=v,x=G,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=c[3],x=u[3],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,c[3]=v=I&65535|D<<16,u[3]=G=O&65535|j<<16,b=_,x=oe,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=c[4],x=u[4],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,c[4]=_=I&65535|D<<16,u[4]=oe=O&65535|j<<16,b=A,x=K,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=c[5],x=u[5],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,c[5]=A=I&65535|D<<16,u[5]=K=O&65535|j<<16,b=C,x=N,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=c[6],x=u[6],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,c[6]=C=I&65535|D<<16,u[6]=N=O&65535|j<<16,b=R,x=k,O=x&65535,j=x>>>16,I=b&65535,D=b>>>16,b=c[7],x=u[7],O+=x&65535,j+=x>>>16,I+=b&65535,D+=b>>>16,j+=O>>>16,I+=j>>>16,D+=I>>>16,c[7]=R=I&65535|D<<16,u[7]=k=O&65535|j<<16,h+=128,g-=128}return h}function o(a){var l=new n;l.update(a);var c=l.digest();return l.clean(),c}t.hash=o})(tte);(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=ih,r=tte,n=Aa;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(Z){const te=new Float64Array(16);if(Z)for(let re=0;re>16&1),re[me-1]&=65535;re[15]=W[15]-32767-(re[14]>>16&1);const J=re[15]>>16&1;re[14]&=65535,w(W,re,1-J)}for(let q=0;q<16;q++)Z[2*q]=W[q]&255,Z[2*q+1]=W[q]>>8}function v(Z,te){let re=0;for(let W=0;W<32;W++)re|=Z[W]^te[W];return(1&re-1>>>8)-1}function _(Z,te){const re=new Uint8Array(32),W=new Uint8Array(32);return E(re,Z),E(W,te),v(re,W)}function A(Z){const te=new Uint8Array(32);return E(te,Z),te[0]&1}function C(Z,te){for(let re=0;re<16;re++)Z[re]=te[2*re]+(te[2*re+1]<<8);Z[15]&=32767}function R(Z,te,re){for(let W=0;W<16;W++)Z[W]=te[W]+re[W]}function B(Z,te,re){for(let W=0;W<16;W++)Z[W]=te[W]-re[W]}function S(Z,te,re){let W,q,J=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ye=0,lt=0,xe=0,He=0,Ve=0,Ie=0,Ne=0,Oe=0,Me=0,Y=0,F=0,z=0,ie=0,pe=0,ve=0,he=0,De=0,Ze=0,et=0,it=0,ut=0,pt=0,tr=0,Wt=0,At=0,mt=re[0],Ct=re[1],dt=re[2],Nt=re[3],jt=re[4],gt=re[5],Vt=re[6],zt=re[7],at=re[8],Gt=re[9],Ft=re[10],yt=re[11],Qe=re[12],Ot=re[13],_t=re[14],Zt=re[15];W=te[0],J+=W*mt,me+=W*Ct,be+=W*dt,Ce+=W*Nt,Fe+=W*jt,Ue+=W*gt,Ye+=W*Vt,lt+=W*zt,xe+=W*at,He+=W*Gt,Ve+=W*Ft,Ie+=W*yt,Ne+=W*Qe,Oe+=W*Ot,Me+=W*_t,Y+=W*Zt,W=te[1],me+=W*mt,be+=W*Ct,Ce+=W*dt,Fe+=W*Nt,Ue+=W*jt,Ye+=W*gt,lt+=W*Vt,xe+=W*zt,He+=W*at,Ve+=W*Gt,Ie+=W*Ft,Ne+=W*yt,Oe+=W*Qe,Me+=W*Ot,Y+=W*_t,F+=W*Zt,W=te[2],be+=W*mt,Ce+=W*Ct,Fe+=W*dt,Ue+=W*Nt,Ye+=W*jt,lt+=W*gt,xe+=W*Vt,He+=W*zt,Ve+=W*at,Ie+=W*Gt,Ne+=W*Ft,Oe+=W*yt,Me+=W*Qe,Y+=W*Ot,F+=W*_t,z+=W*Zt,W=te[3],Ce+=W*mt,Fe+=W*Ct,Ue+=W*dt,Ye+=W*Nt,lt+=W*jt,xe+=W*gt,He+=W*Vt,Ve+=W*zt,Ie+=W*at,Ne+=W*Gt,Oe+=W*Ft,Me+=W*yt,Y+=W*Qe,F+=W*Ot,z+=W*_t,ie+=W*Zt,W=te[4],Fe+=W*mt,Ue+=W*Ct,Ye+=W*dt,lt+=W*Nt,xe+=W*jt,He+=W*gt,Ve+=W*Vt,Ie+=W*zt,Ne+=W*at,Oe+=W*Gt,Me+=W*Ft,Y+=W*yt,F+=W*Qe,z+=W*Ot,ie+=W*_t,pe+=W*Zt,W=te[5],Ue+=W*mt,Ye+=W*Ct,lt+=W*dt,xe+=W*Nt,He+=W*jt,Ve+=W*gt,Ie+=W*Vt,Ne+=W*zt,Oe+=W*at,Me+=W*Gt,Y+=W*Ft,F+=W*yt,z+=W*Qe,ie+=W*Ot,pe+=W*_t,ve+=W*Zt,W=te[6],Ye+=W*mt,lt+=W*Ct,xe+=W*dt,He+=W*Nt,Ve+=W*jt,Ie+=W*gt,Ne+=W*Vt,Oe+=W*zt,Me+=W*at,Y+=W*Gt,F+=W*Ft,z+=W*yt,ie+=W*Qe,pe+=W*Ot,ve+=W*_t,he+=W*Zt,W=te[7],lt+=W*mt,xe+=W*Ct,He+=W*dt,Ve+=W*Nt,Ie+=W*jt,Ne+=W*gt,Oe+=W*Vt,Me+=W*zt,Y+=W*at,F+=W*Gt,z+=W*Ft,ie+=W*yt,pe+=W*Qe,ve+=W*Ot,he+=W*_t,De+=W*Zt,W=te[8],xe+=W*mt,He+=W*Ct,Ve+=W*dt,Ie+=W*Nt,Ne+=W*jt,Oe+=W*gt,Me+=W*Vt,Y+=W*zt,F+=W*at,z+=W*Gt,ie+=W*Ft,pe+=W*yt,ve+=W*Qe,he+=W*Ot,De+=W*_t,Ze+=W*Zt,W=te[9],He+=W*mt,Ve+=W*Ct,Ie+=W*dt,Ne+=W*Nt,Oe+=W*jt,Me+=W*gt,Y+=W*Vt,F+=W*zt,z+=W*at,ie+=W*Gt,pe+=W*Ft,ve+=W*yt,he+=W*Qe,De+=W*Ot,Ze+=W*_t,et+=W*Zt,W=te[10],Ve+=W*mt,Ie+=W*Ct,Ne+=W*dt,Oe+=W*Nt,Me+=W*jt,Y+=W*gt,F+=W*Vt,z+=W*zt,ie+=W*at,pe+=W*Gt,ve+=W*Ft,he+=W*yt,De+=W*Qe,Ze+=W*Ot,et+=W*_t,it+=W*Zt,W=te[11],Ie+=W*mt,Ne+=W*Ct,Oe+=W*dt,Me+=W*Nt,Y+=W*jt,F+=W*gt,z+=W*Vt,ie+=W*zt,pe+=W*at,ve+=W*Gt,he+=W*Ft,De+=W*yt,Ze+=W*Qe,et+=W*Ot,it+=W*_t,ut+=W*Zt,W=te[12],Ne+=W*mt,Oe+=W*Ct,Me+=W*dt,Y+=W*Nt,F+=W*jt,z+=W*gt,ie+=W*Vt,pe+=W*zt,ve+=W*at,he+=W*Gt,De+=W*Ft,Ze+=W*yt,et+=W*Qe,it+=W*Ot,ut+=W*_t,pt+=W*Zt,W=te[13],Oe+=W*mt,Me+=W*Ct,Y+=W*dt,F+=W*Nt,z+=W*jt,ie+=W*gt,pe+=W*Vt,ve+=W*zt,he+=W*at,De+=W*Gt,Ze+=W*Ft,et+=W*yt,it+=W*Qe,ut+=W*Ot,pt+=W*_t,tr+=W*Zt,W=te[14],Me+=W*mt,Y+=W*Ct,F+=W*dt,z+=W*Nt,ie+=W*jt,pe+=W*gt,ve+=W*Vt,he+=W*zt,De+=W*at,Ze+=W*Gt,et+=W*Ft,it+=W*yt,ut+=W*Qe,pt+=W*Ot,tr+=W*_t,Wt+=W*Zt,W=te[15],Y+=W*mt,F+=W*Ct,z+=W*dt,ie+=W*Nt,pe+=W*jt,ve+=W*gt,he+=W*Vt,De+=W*zt,Ze+=W*at,et+=W*Gt,it+=W*Ft,ut+=W*yt,pt+=W*Qe,tr+=W*Ot,Wt+=W*_t,At+=W*Zt,J+=38*F,me+=38*z,be+=38*ie,Ce+=38*pe,Fe+=38*ve,Ue+=38*he,Ye+=38*De,lt+=38*Ze,xe+=38*et,He+=38*it,Ve+=38*ut,Ie+=38*pt,Ne+=38*tr,Oe+=38*Wt,Me+=38*At,q=1,W=J+q+65535,q=Math.floor(W/65536),J=W-q*65536,W=me+q+65535,q=Math.floor(W/65536),me=W-q*65536,W=be+q+65535,q=Math.floor(W/65536),be=W-q*65536,W=Ce+q+65535,q=Math.floor(W/65536),Ce=W-q*65536,W=Fe+q+65535,q=Math.floor(W/65536),Fe=W-q*65536,W=Ue+q+65535,q=Math.floor(W/65536),Ue=W-q*65536,W=Ye+q+65535,q=Math.floor(W/65536),Ye=W-q*65536,W=lt+q+65535,q=Math.floor(W/65536),lt=W-q*65536,W=xe+q+65535,q=Math.floor(W/65536),xe=W-q*65536,W=He+q+65535,q=Math.floor(W/65536),He=W-q*65536,W=Ve+q+65535,q=Math.floor(W/65536),Ve=W-q*65536,W=Ie+q+65535,q=Math.floor(W/65536),Ie=W-q*65536,W=Ne+q+65535,q=Math.floor(W/65536),Ne=W-q*65536,W=Oe+q+65535,q=Math.floor(W/65536),Oe=W-q*65536,W=Me+q+65535,q=Math.floor(W/65536),Me=W-q*65536,W=Y+q+65535,q=Math.floor(W/65536),Y=W-q*65536,J+=q-1+37*(q-1),q=1,W=J+q+65535,q=Math.floor(W/65536),J=W-q*65536,W=me+q+65535,q=Math.floor(W/65536),me=W-q*65536,W=be+q+65535,q=Math.floor(W/65536),be=W-q*65536,W=Ce+q+65535,q=Math.floor(W/65536),Ce=W-q*65536,W=Fe+q+65535,q=Math.floor(W/65536),Fe=W-q*65536,W=Ue+q+65535,q=Math.floor(W/65536),Ue=W-q*65536,W=Ye+q+65535,q=Math.floor(W/65536),Ye=W-q*65536,W=lt+q+65535,q=Math.floor(W/65536),lt=W-q*65536,W=xe+q+65535,q=Math.floor(W/65536),xe=W-q*65536,W=He+q+65535,q=Math.floor(W/65536),He=W-q*65536,W=Ve+q+65535,q=Math.floor(W/65536),Ve=W-q*65536,W=Ie+q+65535,q=Math.floor(W/65536),Ie=W-q*65536,W=Ne+q+65535,q=Math.floor(W/65536),Ne=W-q*65536,W=Oe+q+65535,q=Math.floor(W/65536),Oe=W-q*65536,W=Me+q+65535,q=Math.floor(W/65536),Me=W-q*65536,W=Y+q+65535,q=Math.floor(W/65536),Y=W-q*65536,J+=q-1+37*(q-1),Z[0]=J,Z[1]=me,Z[2]=be,Z[3]=Ce,Z[4]=Fe,Z[5]=Ue,Z[6]=Ye,Z[7]=lt,Z[8]=xe,Z[9]=He,Z[10]=Ve,Z[11]=Ie,Z[12]=Ne,Z[13]=Oe,Z[14]=Me,Z[15]=Y}function U(Z,te){S(Z,te,te)}function G(Z,te){const re=i();let W;for(W=0;W<16;W++)re[W]=te[W];for(W=253;W>=0;W--)U(re,re),W!==2&&W!==4&&S(re,re,te);for(W=0;W<16;W++)Z[W]=re[W]}function oe(Z,te){const re=i();let W;for(W=0;W<16;W++)re[W]=te[W];for(W=250;W>=0;W--)U(re,re),W!==1&&S(re,re,te);for(W=0;W<16;W++)Z[W]=re[W]}function K(Z,te){const re=i(),W=i(),q=i(),J=i(),me=i(),be=i(),Ce=i(),Fe=i(),Ue=i();B(re,Z[1],Z[0]),B(Ue,te[1],te[0]),S(re,re,Ue),R(W,Z[0],Z[1]),R(Ue,te[0],te[1]),S(W,W,Ue),S(q,Z[3],te[3]),S(q,q,c),S(J,Z[2],te[2]),R(J,J,J),B(me,W,re),B(be,J,q),R(Ce,J,q),R(Fe,W,re),S(Z[0],me,be),S(Z[1],Fe,Ce),S(Z[2],Ce,be),S(Z[3],me,Fe)}function N(Z,te,re){for(let W=0;W<4;W++)w(Z[W],te[W],re)}function k(Z,te){const re=i(),W=i(),q=i();G(q,te[2]),S(re,te[0],q),S(W,te[1],q),E(Z,W),Z[31]^=A(re)<<7}function b(Z,te,re){g(Z[0],o),g(Z[1],a),g(Z[2],a),g(Z[3],o);for(let W=255;W>=0;--W){const q=re[W/8|0]>>(W&7)&1;N(Z,te,q),K(te,Z),K(Z,Z),N(Z,te,q)}}function x(Z,te){const re=[i(),i(),i(),i()];g(re[0],u),g(re[1],f),g(re[2],a),S(re[3],u,f),b(Z,re,te)}function P(Z){if(Z.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const te=(0,r.hash)(Z);te[0]&=248,te[31]&=127,te[31]|=64;const re=new Uint8Array(32),W=[i(),i(),i(),i()];x(W,te),k(re,W);const q=new Uint8Array(64);return q.set(Z),q.set(re,32),{publicKey:re,secretKey:q}}t.generateKeyPairFromSeed=P;function L(Z){const te=(0,e.randomBytes)(32,Z),re=P(te);return(0,n.wipe)(te),re}t.generateKeyPair=L;function O(Z){if(Z.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Z.subarray(32))}t.extractPublicKeyFromSecretKey=O;const j=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 I(Z,te){let re,W,q,J;for(W=63;W>=32;--W){for(re=0,q=W-32,J=W-12;q>4)*j[q],re=te[q]>>8,te[q]&=255;for(q=0;q<32;q++)te[q]-=re*j[q];for(W=0;W<32;W++)te[W+1]+=te[W]>>8,Z[W]=te[W]&255}function D(Z){const te=new Float64Array(64);for(let re=0;re<64;re++)te[re]=Z[re];for(let re=0;re<64;re++)Z[re]=0;I(Z,te)}function M(Z,te){const re=new Float64Array(64),W=[i(),i(),i(),i()],q=(0,r.hash)(Z.subarray(0,32));q[0]&=248,q[31]&=127,q[31]|=64;const J=new Uint8Array(64);J.set(q.subarray(32),32);const me=new r.SHA512;me.update(J.subarray(32)),me.update(te);const be=me.digest();me.clean(),D(be),x(W,be),k(J,W),me.reset(),me.update(J.subarray(0,32)),me.update(Z.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]*q[Ue];return I(J.subarray(32),re),J}t.sign=M;function X(Z,te){const re=i(),W=i(),q=i(),J=i(),me=i(),be=i(),Ce=i();return g(Z[2],a),C(Z[1],te),U(q,Z[1]),S(J,q,l),B(q,q,Z[2]),R(J,Z[2],J),U(me,J),U(be,me),S(Ce,be,me),S(re,Ce,q),S(re,re,J),oe(re,re),S(re,re,q),S(re,re,J),S(re,re,J),S(Z[0],re,J),U(W,Z[0]),S(W,W,J),_(W,q)&&S(Z[0],Z[0],h),U(W,Z[0]),S(W,W,J),_(W,q)?-1:(A(Z[0])===te[31]>>7&&B(Z[0],o,Z[0]),S(Z[3],Z[0],Z[1]),0)}function le(Z,te,re){const W=new Uint8Array(32),q=[i(),i(),i(),i()],J=[i(),i(),i(),i()];if(re.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(X(J,Z))return!1;const me=new r.SHA512;me.update(re.subarray(0,32)),me.update(Z),me.update(te);const be=me.digest();return D(be),b(q,J,be),x(J,re.subarray(32)),K(q,J),k(W,q),!v(re,W)}t.verify=le;function H(Z){let te=[i(),i(),i(),i()];if(X(te,Z))throw new Error("Ed25519: invalid public key");let re=i(),W=i(),q=te[1];R(re,a,q),B(W,a,q),G(W,W),S(re,re,W);let J=new Uint8Array(32);return E(J,re),J}t.convertPublicKeyToX25519=H;function ee(Z){const te=(0,r.hash)(Z.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})(kN);const Hje="EdDSA",qje="JWT",X6=".",L_="base64url",rte="utf8",nte="utf8",Vje=":",Gje="did",Kje="key",IU="base58btc",Yje="z",Zje="K36",Jje=32,Qje=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),Xje=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 N0(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return Xje(t)}catch{return t}}function Cd(t){return typeof t=="string"?t:Qje(t)||""}function TU(t){return N0(Ji(Ki(t,L_),rte))}function e4(t){return Ji(Ki(Cd(t),rte),L_)}function ite(t){const e=Ki(Zje,IU),r=Yje+Ji(N5([e,t]),IU);return[Gje,Kje,r].join(Vje)}function eDe(t){return Ji(t,L_)}function tDe(t){return Ki(t,L_)}function rDe(t){return Ki([e4(t.header),e4(t.payload)].join(X6),nte)}function nDe(t){return[e4(t.header),e4(t.payload),eDe(t.signature)].join(X6)}function kI(t){const e=t.split(X6),r=TU(e[0]),n=TU(e[1]),i=tDe(e[2]),s=Ki(e.slice(0,2).join(X6),nte);return{header:r,payload:n,signature:i,data:s}}function $U(t=ih.randomBytes(Jje)){return kN.generateKeyPairFromSeed(t)}async function iDe(t,e,r,n,i=ct.fromMiliseconds(Date.now())){const s={alg:Hje,typ:qje},o=ite(n.publicKey),a=i+r,l={iss:o,sub:t,aud:e,iat:i,exp:a},c=rDe({header:s,payload:l}),u=kN.sign(n.secretKey,c);return nDe({header:s,payload:l,signature:u})}const sDe={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 oDe={};const aDe=":";function L1(t){const[e,r]=t.split(aDe);return{namespace:e,reference:r}}function kU(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 ste(t,e){return t.includes(":")?[t]:e.chains||[]}var lDe=Object.defineProperty,NU=Object.getOwnPropertySymbols,cDe=Object.prototype.hasOwnProperty,uDe=Object.prototype.propertyIsEnumerable,PU=(t,e,r)=>e in t?lDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,RU=(t,e)=>{for(var r in e||(e={}))cDe.call(e,r)&&PU(t,r,e[r]);if(NU)for(var r of NU(e))uDe.call(e,r)&&PU(t,r,e[r]);return t};const dDe="ReactNative",fa={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},fDe="js";function t4(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function oh(){return!lw()&&!!vN()&&navigator.product===dDe}function hDe(){return oh()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function pDe(){return oh()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function pw(){return!t4()&&!!vN()&&!!lw()}function gw(){return oh()?fa.reactNative:t4()?fa.node:pw()?fa.browser:fa.unknown}function MU(){var t;try{return oh()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function gDe(t,e){let r=sv.parse(t);return r=RU(RU({},r),e),t=sv.stringify(r),t}function ote(){return Tee()||{name:"",description:"",url:"",icons:[""]}}function mDe(){if(gw()===fa.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=bRe();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 yDe(){var t;const e=gw();return e===fa.browser?[e,((t=Iee())==null?void 0:t.host)||"unknown"].join(":"):e}function ate(t,e,r){const n=mDe(),i=yDe();return[[t,e].join("-"),[fDe,r].join("-"),n,i].join("/")}function vDe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a,packageName:l}){const c=r.split("?"),u=ate(t,e,n),f={auth:i,ua:u,projectId:s,useOnCloseEvent:o||void 0,packageName:l||void 0,bundleId:a||void 0},h=gDe(c[1]||"",f);return c[0]+"?"+h}function Gh(t,e){return t.filter(r=>e.includes(r)).length===t.length}function lte(t){return Object.fromEntries(t.entries())}function cte(t){return new Map(Object.entries(t))}function Ph(t=ct.FIVE_MINUTES,e){const r=ct.toMiliseconds(t||ct.FIVE_MINUTES);let n,i,s,o;return{resolve:a=>{s&&n&&(clearTimeout(s),n(a),o=Promise.resolve(a))},reject:a=>{s&&i&&(clearTimeout(s),i(a))},done:()=>new Promise((a,l)=>{if(o)return a(o);s=setTimeout(()=>{const c=new Error(e);o=Promise.reject(c),l(c)},r),n=a,i=l})}}function mf(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function ute(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 wDe(t){return ute("topic",t)}function bDe(t){return ute("id",t)}function dte(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 Ci(t,e){return ct.fromMiliseconds(Date.now()+ct.toMiliseconds(t))}function sf(t){return Date.now()>=ct.toMiliseconds(t)}function Nr(t,e){return`${t}${e?`:${e}`:""}`}function P5(t=[],e=[]){return[...new Set([...t,...e])]}async function _De({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,s=i==null?void 0:i.href;if(typeof s!="string")return;const o=xDe(s,t,e),a=gw();if(a===fa.browser){if(!((n=lw())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}o.startsWith("https://")||o.startsWith("http://")?window.open(o,"_blank","noreferrer noopener"):window.open(o,CDe()?"_blank":"_self","noreferrer noopener")}else a===fa.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}function xDe(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 s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${ADe(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function EDe(t,e){let r="";try{if(pw()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function OU(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function jU(){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 NN(){return typeof process<"u"&&oDe.IS_VITEST==="true"}function CDe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function ADe(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function fte(t){return Buffer.from(t,"base64").toString("utf-8")}function SDe(t){return new Promise(e=>setTimeout(e,t))}const IDe="https://rpc.walletconnect.org/v1";async function TDe(t,e,r,n,i,s){switch(r.t){case"eip191":return $De(t,e,r.s);case"eip1271":return await kDe(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function $De(t,e,r){return N$(LV(e),r).toLowerCase()===t.toLowerCase()}async function kDe(t,e,r,n,i,s){const o=L1(n);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const a="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",u=r.substring(2),f=LV(e).substring(2),h=a+f+l+c+u,g=await fetch(`${s||IDe}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:NDe(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:h},"latest"]})}),{result:m}=await g.json();return m?m.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function NDe(){return Date.now()+Math.floor(Math.random()*1e3)}var PDe=Object.defineProperty,RDe=Object.defineProperties,MDe=Object.getOwnPropertyDescriptors,DU=Object.getOwnPropertySymbols,ODe=Object.prototype.hasOwnProperty,jDe=Object.prototype.propertyIsEnumerable,LU=(t,e,r)=>e in t?PDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,DDe=(t,e)=>{for(var r in e||(e={}))ODe.call(e,r)&&LU(t,r,e[r]);if(DU)for(var r of DU(e))jDe.call(e,r)&&LU(t,r,e[r]);return t},LDe=(t,e)=>RDe(t,MDe(e));const FDe="did:pkh:",PN=t=>t==null?void 0:t.split(":"),UDe=t=>{const e=t&&PN(t);if(e)return t.includes(FDe)?e[3]:e[1]},NI=t=>{const e=t&&PN(t);if(e)return e[2]+":"+e[3]},r4=t=>{const e=t&&PN(t);if(e)return e.pop()};async function FU(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=hte(i,i.iss),o=r4(i.iss);return await TDe(o,s,n,NI(i.iss),r)}const hte=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=r4(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 s=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,a=`Chain ID: ${UDe(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=R5(t.resources);if(m){const w=ov(m);i=YDe(i,w)}return[r,n,"",i,"",s,o,a,l,c,u,f,h,g].filter(w=>w!=null).join(` -`)};function BDe(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function WDe(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function P0(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 s=n[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function zDe(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:HDe(e,r,n)}}}function HDe(t,e,r={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function pte(t){return P0(t),`urn:recap:${BDe(t).replace(/=/g,"")}`}function ov(t){const e=WDe(t.replace("urn:recap:",""));return P0(e),e}function qDe(t,e,r){const n=zDe(t,e,r);return pte(n)}function VDe(t){return t&&t.includes("urn:recap:")}function GDe(t,e){const r=ov(t),n=ov(e),i=KDe(r,n);return pte(i)}function KDe(t,e){P0(t),P0(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),n={att:{}};return r.forEach(i=>{var s,o;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((a,l)=>a.localeCompare(l)).forEach(a=>{var l,c;n.att[i]=LDe(DDe({},n.att[i]),{[a]:((l=t.att[i])==null?void 0:l[a])||((c=e.att[i])==null?void 0:c[a])})})}),n}function YDe(t="",e){P0(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(a=>{const l=Object.keys(e.att[a]).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 '${a}'.`));n.push(u.join(", ").replace(".,","."))});const s=n.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}function UU(t){var e;const r=ov(t);P0(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function BU(t){const e=ov(t);P0(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function R5(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return VDe(e)?e:void 0}const gte="base10",Xs="base16",yf="base64pad",ny="base64url",mw="utf8",mte=0,ad=1,yw=2,ZDe=0,WU=1,Zy=12,RN=32;function JDe(){const t=xN.generateKeyPair();return{privateKey:Ji(t.secretKey,Xs),publicKey:Ji(t.publicKey,Xs)}}function PI(){const t=ih.randomBytes(RN);return Ji(t,Xs)}function QDe(t,e){const r=xN.sharedKey(Ki(t,Xs),Ki(e,Xs),!0),n=new ZMe(uw.SHA256,r).expand(RN);return Ji(n,Xs)}function M5(t){const e=uw.hash(Ki(t,Xs));return Ji(e,Xs)}function Zu(t){const e=uw.hash(Ki(t,mw));return Ji(e,Xs)}function yte(t){return Ki(`${t}`,gte)}function R0(t){return Number(Ji(t,gte))}function XDe(t){const e=yte(typeof t.type<"u"?t.type:mte);if(R0(e)===ad&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Ki(t.senderPublicKey,Xs):void 0,n=typeof t.iv<"u"?Ki(t.iv,Xs):ih.randomBytes(Zy),i=new bN.ChaCha20Poly1305(Ki(t.symKey,Xs)).seal(n,Ki(t.message,mw));return vte({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function eLe(t,e){const r=yte(yw),n=ih.randomBytes(Zy),i=Ki(t,mw);return vte({type:r,sealed:i,iv:n,encoding:e})}function tLe(t){const e=new bN.ChaCha20Poly1305(Ki(t.symKey,Xs)),{sealed:r,iv:n}=av({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 Ji(i,mw)}function rLe(t,e){const{sealed:r}=av({encoded:t,encoding:e});return Ji(r,mw)}function vte(t){const{encoding:e=yf}=t;if(R0(t.type)===yw)return Ji(N5([t.type,t.sealed]),e);if(R0(t.type)===ad){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Ji(N5([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return Ji(N5([t.type,t.iv,t.sealed]),e)}function av(t){const{encoded:e,encoding:r=yf}=t,n=Ki(e,r),i=n.slice(ZDe,WU),s=WU;if(R0(i)===ad){const c=s+RN,u=c+Zy,f=n.slice(s,c),h=n.slice(c,u),g=n.slice(u);return{type:i,sealed:g,iv:h,senderPublicKey:f}}if(R0(i)===yw){const c=n.slice(s),u=ih.randomBytes(Zy);return{type:i,sealed:c,iv:u}}const o=s+Zy,a=n.slice(s,o),l=n.slice(o);return{type:i,sealed:l,iv:a}}function nLe(t,e){const r=av({encoded:t,encoding:e==null?void 0:e.encoding});return wte({type:R0(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Ji(r.senderPublicKey,Xs):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function wte(t){const e=(t==null?void 0:t.type)||mte;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 zU(t){return t.type===ad&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function HU(t){return t.type===yw}function iLe(t){return new Vee.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function sLe(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function oLe(t){return Buffer.from(sLe(t),"base64")}function aLe(t,e){const[r,n,i]=t.split("."),s=oLe(i);if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32).toString("hex"),a=s.slice(32,64).toString("hex"),l=`${r}.${n}`,c=new uw.SHA256().update(Buffer.from(l)).digest(),u=iLe(e),f=Buffer.from(c).toString("hex");if(!u.verify(f,{r:o,s:a}))throw new Error("Invalid signature");return kI(t).payload}const lLe="irn";function n4(t){return(t==null?void 0:t.relay)||{protocol:lLe}}function Ay(t){const e=sDe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var cLe=Object.defineProperty,uLe=Object.defineProperties,dLe=Object.getOwnPropertyDescriptors,qU=Object.getOwnPropertySymbols,fLe=Object.prototype.hasOwnProperty,hLe=Object.prototype.propertyIsEnumerable,VU=(t,e,r)=>e in t?cLe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,GU=(t,e)=>{for(var r in e||(e={}))fLe.call(e,r)&&VU(t,r,e[r]);if(qU)for(var r of qU(e))hLe.call(e,r)&&VU(t,r,e[r]);return t},pLe=(t,e)=>uLe(t,dLe(e));function gLe(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function KU(t){if(!t.includes("wc:")){const l=fte(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("@"),s=typeof r<"u"?t.substring(r):"",o=sv.parse(s),a=typeof o.methods=="string"?o.methods.split(","):void 0;return{protocol:n,topic:mLe(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:gLe(o),methods:a,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function mLe(t){return t.startsWith("//")?t.substring(2):t}function yLe(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function YU(t){return`${t.protocol}:${t.topic}@${t.version}?`+sv.stringify(GU(pLe(GU({symKey:t.symKey},yLe(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function Pb(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function nm(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function vLe(t){const e=[];return Object.values(t).forEach(r=>{e.push(...nm(r.accounts))}),e}function wLe(t,e){const r=[];return Object.values(t).forEach(n=>{nm(n.accounts).includes(e)&&r.push(...n.methods)}),r}function bLe(t,e){const r=[];return Object.values(t).forEach(n=>{nm(n.accounts).includes(e)&&r.push(...n.events)}),r}function MN(t){return t.includes(":")}function Sy(t){return MN(t)?t.split(":")[0]:t}function _Le(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 ZU(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=_Le(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=P5(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const xLe={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}},ELe={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}=ELe[t];return{message:e?`${r} ${e}`:r,code:n}}function sn(t,e){const{message:r,code:n}=xLe[t];return{message:e?`${r} ${e}`:r,code:n}}function Ad(t,e){return!!Array.isArray(t)}function lv(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Io(t){return typeof t>"u"}function li(t,e){return e&&Io(t)?!0:typeof t=="string"&&!!t.trim().length}function ON(t,e){return typeof t=="number"&&!isNaN(t)}function CLe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return Gh(i,n)?(n.forEach(o=>{const{accounts:a,methods:l,events:c}=t.namespaces[o],u=nm(a),f=r[o];(!Gh(ste(o,f),u)||!Gh(f.methods,l)||!Gh(f.events,c))&&(s=!1)}),s):!1}function i4(t){return li(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function ALe(t){if(li(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&i4(r)}}return!1}function SLe(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(li(t,!1)){if(e(t))return!0;const r=fte(t);return e(r)}}catch{}return!1}function ILe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function TLe(t){return t==null?void 0:t.topic}function $Le(t,e){let r=null;return li(t==null?void 0:t.publicKey,!1)||(r=ht("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function JU(t){let e=!0;return Ad(t)?t.length&&(e=t.every(r=>li(r,!1))):e=!1,e}function kLe(t,e,r){let n=null;return Ad(e)&&e.length?e.forEach(i=>{n||i4(i)||(n=sn("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):i4(t)||(n=sn("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 NLe(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=kLe(i,ste(i,s),`${e} ${r}`);o&&(n=o)}),n}function PLe(t,e){let r=null;return Ad(t)?t.forEach(n=>{r||ALe(n)||(r=sn("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=sn("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function RLe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=PLe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function MLe(t,e){let r=null;return JU(t==null?void 0:t.methods)?JU(t==null?void 0:t.events)||(r=sn("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=sn("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function bte(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=MLe(n,`${e}, namespace`);i&&(r=i)}),r}function OLe(t,e,r){let n=null;if(t&&lv(t)){const i=bte(t,e);i&&(n=i);const s=NLe(t,e,r);s&&(n=s)}else n=ht("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function GE(t,e){let r=null;if(t&&lv(t)){const n=bte(t,e);n&&(r=n);const i=RLe(t,e);i&&(r=i)}else r=ht("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function _te(t){return li(t.protocol,!0)}function jLe(t,e){let r=!1;return t?t&&Ad(t)&&t.length&&t.forEach(n=>{r=_te(n)}):r=!0,r}function DLe(t){return typeof t=="number"}function _o(t){return typeof t<"u"&&typeof t!==null}function LLe(t){return!(!t||typeof t!="object"||!t.code||!ON(t.code)||!t.message||!li(t.message,!1))}function FLe(t){return!(Io(t)||!li(t.method,!1))}function ULe(t){return!(Io(t)||Io(t.result)&&Io(t.error)||!ON(t.id)||!li(t.jsonrpc,!1))}function BLe(t){return!(Io(t)||!li(t.name,!1))}function QU(t,e){return!(!i4(e)||!vLe(t).includes(e))}function WLe(t,e,r){return li(r,!1)?wLe(t,e).includes(r):!1}function zLe(t,e,r){return li(r,!1)?bLe(t,e).includes(r):!1}function XU(t,e,r){let n=null;const i=HLe(t),s=qLe(e),o=Object.keys(i),a=Object.keys(s),l=eB(Object.keys(t)),c=eB(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 II=function(t,e){return II=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])},II(t,e)};function AMe(t,e){II(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var TI=function(){return TI=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function TMe(t,e){return function(r,n){e(r,n,t)}}function $Me(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function kMe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})}function NMe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;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&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=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(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[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 Zee(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function MMe(){for(var t=[],e=0;e1||o(h,g)})})}function o(h,g){try{l(n[h](g))}catch(m){f(s[0][3],m)}}function l(h){h.value instanceof ov?Promise.resolve(h.value.v).then(c,u):f(s[0][2],h)}function c(h){o("next",h)}function u(h){o("throw",h)}function f(h,g){h(g),s.shift(),s.length&&o(s[0][0],s[0][1])}}function LMe(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,s){e[i]=t[i]?function(a){return(r=!r)?{value:ov(t[i](a)),done:i==="return"}:s?s(a):a}:s}}function DMe(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 $I=="function"?$I(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(a){return new Promise(function(o,l){a=t[s](a),i(o,l,a.done,a.value)})}}function i(s,a,o,l){Promise.resolve(l).then(function(c){s({value:c,done:o})},a)}}function FMe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function UMe(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 BMe(t){return t&&t.__esModule?t:{default:t}}function WMe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function zMe(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 HMe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return TI},__asyncDelegator:LMe,__asyncGenerator:jMe,__asyncValues:DMe,__await:ov,__awaiter:kMe,__classPrivateFieldGet:WMe,__classPrivateFieldSet:zMe,__createBinding:PMe,__decorate:IMe,__exportStar:RMe,__extends:AMe,__generator:NMe,__importDefault:BMe,__importStar:UMe,__makeTemplateObject:FMe,__metadata:$Me,__param:TMe,__read:Zee,__rest:SMe,__spread:MMe,__spreadArrays:OMe,__values:$I},Symbol.toStringTag,{value:"Module"})),k_=Kf(HMe);var HE={},ny={},EU;function qMe(){if(EU)return ny;EU=1,Object.defineProperty(ny,"__esModule",{value:!0}),ny.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return ny.delay=t,ny}var Sh={},qE={},Ih={},CU;function VMe(){return CU||(CU=1,Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.ONE_THOUSAND=Ih.ONE_HUNDRED=void 0,Ih.ONE_HUNDRED=100,Ih.ONE_THOUSAND=1e3),Ih}var VE={},AU;function GMe(){return AU||(AU=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}(VE)),VE}var SU;function Jee(){return SU||(SU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=k_;e.__exportStar(VMe(),t),e.__exportStar(GMe(),t)}(qE)),qE}var IU;function KMe(){if(IU)return Sh;IU=1,Object.defineProperty(Sh,"__esModule",{value:!0}),Sh.fromMiliseconds=Sh.toMiliseconds=void 0;const t=Jee();function e(n){return n*t.ONE_THOUSAND}Sh.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Sh.fromMiliseconds=r,Sh}var TU;function YMe(){return TU||(TU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=k_;e.__exportStar(qMe(),t),e.__exportStar(KMe(),t)}(HE)),HE}var Hp={},$U;function ZMe(){if($U)return Hp;$U=1,Object.defineProperty(Hp,"__esModule",{value:!0}),Hp.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 Hp.Watch=t,Hp.default=t,Hp}var GE={},iy={},kU;function JMe(){if(kU)return iy;kU=1,Object.defineProperty(iy,"__esModule",{value:!0}),iy.IWatch=void 0;class t{}return iy.IWatch=t,iy}var NU;function QMe(){return NU||(NU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),k_.__exportStar(JMe(),t)}(GE)),GE}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=k_;e.__exportStar(YMe(),t),e.__exportStar(ZMe(),t),e.__exportStar(QMe(),t),e.__exportStar(Jee(),t)})(ct);var xn={};Object.defineProperty(xn,"__esModule",{value:!0});xn.getLocalStorage=xn.getLocalStorageOrThrow=xn.getCrypto=xn.getCryptoOrThrow=Qee=xn.getLocation=xn.getLocationOrThrow=$N=xn.getNavigator=xn.getNavigatorOrThrow=dw=xn.getDocument=xn.getDocumentOrThrow=xn.getFromWindowOrThrow=xn.getFromWindow=void 0;function ip(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}xn.getFromWindow=ip;function tm(t){const e=ip(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}xn.getFromWindowOrThrow=tm;function XMe(){return tm("document")}xn.getDocumentOrThrow=XMe;function eOe(){return ip("document")}var dw=xn.getDocument=eOe;function tOe(){return tm("navigator")}xn.getNavigatorOrThrow=tOe;function rOe(){return ip("navigator")}var $N=xn.getNavigator=rOe;function nOe(){return tm("location")}xn.getLocationOrThrow=nOe;function iOe(){return ip("location")}var Qee=xn.getLocation=iOe;function sOe(){return tm("crypto")}xn.getCryptoOrThrow=sOe;function aOe(){return ip("crypto")}xn.getCrypto=aOe;function oOe(){return tm("localStorage")}xn.getLocalStorageOrThrow=oOe;function lOe(){return ip("localStorage")}xn.getLocalStorage=lOe;var kN={};Object.defineProperty(kN,"__esModule",{value:!0});var Xee=kN.getWindowMetadata=void 0;const PU=xn;function cOe(){let t,e;try{t=PU.getDocumentOrThrow(),e=PU.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),h=[];for(let g=0;g-1){const E=m.getAttribute("href");if(E)if(E.toLowerCase().indexOf("https:")===-1&&E.toLowerCase().indexOf("http:")===-1&&E.indexOf("//")!==0){let v=e.protocol+"//"+e.host;if(E.indexOf("/")===0)v+=E;else{const _=e.pathname.split("/");_.pop();const A=_.join("/");v+=A+"/"+E}h.push(v)}else if(E.indexOf("//")===0){const v=e.protocol+E;h.push(v)}else h.push(E)}}return h}function n(...f){const h=t.getElementsByTagName("meta");for(let g=0;gm.getAttribute(E)).filter(E=>E?f.includes(E):!1);if(w.length&&w){const E=m.getAttribute("content");if(E)return E}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function s(){return n("description","og:description","twitter:description","keywords")}const a=i(),o=s(),l=e.origin,c=r();return{description:o,url:l,icons:c,name:a}}Xee=kN.getWindowMetadata=cOe;var lv={},uOe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),ete="%[a-f0-9]{2}",RU=new RegExp("("+ete+")|([^%]+?)","gi"),MU=new RegExp("("+ete+")+","gi");function kI(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([],kI(r),kI(n))}function dOe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(RU)||[],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)]},gOe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;s_==null,a=Symbol("encodeFragmentIdentifier");function o(_){switch(_.arrayFormat){case"index":return A=>(C,R)=>{const B=C.length;return R===void 0||_.skipNull&&R===null||_.skipEmptyString&&R===""?C:R===null?[...C,[u(A,_),"[",B,"]"].join("")]:[...C,[u(A,_),"[",u(B,_),"]=",u(R,_)].join("")]};case"bracket":return A=>(C,R)=>R===void 0||_.skipNull&&R===null||_.skipEmptyString&&R===""?C:R===null?[...C,[u(A,_),"[]"].join("")]:[...C,[u(A,_),"[]=",u(R,_)].join("")];case"colon-list-separator":return A=>(C,R)=>R===void 0||_.skipNull&&R===null||_.skipEmptyString&&R===""?C:R===null?[...C,[u(A,_),":list="].join("")]:[...C,[u(A,_),":list=",u(R,_)].join("")];case"comma":case"separator":case"bracket-separator":{const A=_.arrayFormat==="bracket-separator"?"[]=":"=";return C=>(R,B)=>B===void 0||_.skipNull&&B===null||_.skipEmptyString&&B===""?R:(B=B===null?"":B,R.length===0?[[u(C,_),A,u(B,_)].join("")]:[[R,u(B,_)].join(_.arrayFormatSeparator)])}default:return A=>(C,R)=>R===void 0||_.skipNull&&R===null||_.skipEmptyString&&R===""?C:R===null?[...C,u(A,_)]:[...C,[u(A,_),"=",u(R,_)].join("")]}}function l(_){let A;switch(_.arrayFormat){case"index":return(C,R,B)=>{if(A=/\[(\d*)\]$/.exec(C),C=C.replace(/\[\d*\]$/,""),!A){B[C]=R;return}B[C]===void 0&&(B[C]={}),B[C][A[1]]=R};case"bracket":return(C,R,B)=>{if(A=/(\[\])$/.exec(C),C=C.replace(/\[\]$/,""),!A){B[C]=R;return}if(B[C]===void 0){B[C]=[R];return}B[C]=[].concat(B[C],R)};case"colon-list-separator":return(C,R,B)=>{if(A=/(:list)$/.exec(C),C=C.replace(/:list$/,""),!A){B[C]=R;return}if(B[C]===void 0){B[C]=[R];return}B[C]=[].concat(B[C],R)};case"comma":case"separator":return(C,R,B)=>{const S=typeof R=="string"&&R.includes(_.arrayFormatSeparator),U=typeof R=="string"&&!S&&f(R,_).includes(_.arrayFormatSeparator);R=U?f(R,_):R;const G=S||U?R.split(_.arrayFormatSeparator).map(ae=>f(ae,_)):R===null?R:f(R,_);B[C]=G};case"bracket-separator":return(C,R,B)=>{const S=/(\[\])$/.test(C);if(C=C.replace(/\[\]$/,""),!S){B[C]=R&&f(R,_);return}const U=R===null?[]:R.split(_.arrayFormatSeparator).map(G=>f(G,_));if(B[C]===void 0){B[C]=U;return}B[C]=[].concat(B[C],U)};default:return(C,R,B)=>{if(B[C]===void 0){B[C]=R;return}B[C]=[].concat(B[C],R)}}}function c(_){if(typeof _!="string"||_.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(_,A){return A.encode?A.strict?e(_):encodeURIComponent(_):_}function f(_,A){return A.decode?r(_):_}function h(_){return Array.isArray(_)?_.sort():typeof _=="object"?h(Object.keys(_)).sort((A,C)=>Number(A)-Number(C)).map(A=>_[A]):_}function g(_){const A=_.indexOf("#");return A!==-1&&(_=_.slice(0,A)),_}function m(_){let A="";const C=_.indexOf("#");return C!==-1&&(A=_.slice(C)),A}function w(_){_=g(_);const A=_.indexOf("?");return A===-1?"":_.slice(A+1)}function E(_,A){return A.parseNumbers&&!Number.isNaN(Number(_))&&typeof _=="string"&&_.trim()!==""?_=Number(_):A.parseBooleans&&_!==null&&(_.toLowerCase()==="true"||_.toLowerCase()==="false")&&(_=_.toLowerCase()==="true"),_}function v(_,A){A=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},A),c(A.arrayFormatSeparator);const C=l(A),R=Object.create(null);if(typeof _!="string"||(_=_.trim().replace(/^[?#&]/,""),!_))return R;for(const B of _.split("&")){if(B==="")continue;let[S,U]=n(A.decode?B.replace(/\+/g," "):B,"=");U=U===void 0?null:["comma","separator","bracket-separator"].includes(A.arrayFormat)?U:f(U,A),C(f(S,A),U,R)}for(const B of Object.keys(R)){const S=R[B];if(typeof S=="object"&&S!==null)for(const U of Object.keys(S))S[U]=E(S[U],A);else R[B]=E(S,A)}return A.sort===!1?R:(A.sort===!0?Object.keys(R).sort():Object.keys(R).sort(A.sort)).reduce((B,S)=>{const U=R[S];return U&&typeof U=="object"&&!Array.isArray(U)?B[S]=h(U):B[S]=U,B},Object.create(null))}t.extract=w,t.parse=v,t.stringify=(_,A)=>{if(!_)return"";A=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},A),c(A.arrayFormatSeparator);const C=U=>A.skipNull&&s(_[U])||A.skipEmptyString&&_[U]==="",R=o(A),B={};for(const U of Object.keys(_))C(U)||(B[U]=_[U]);const S=Object.keys(B);return A.sort!==!1&&S.sort(A.sort),S.map(U=>{const G=_[U];return G===void 0?"":G===null?u(U,A):Array.isArray(G)?G.length===0&&A.arrayFormat==="bracket-separator"?u(U,A)+"[]":G.reduce(R(U),[]).join("&"):u(U,A)+"="+u(G,A)}).filter(U=>U.length>0).join("&")},t.parseUrl=(_,A)=>{A=Object.assign({decode:!0},A);const[C,R]=n(_,"#");return Object.assign({url:C.split("?")[0]||"",query:v(w(_),A)},A&&A.parseFragmentIdentifier&&R?{fragmentIdentifier:f(R,A)}:{})},t.stringifyUrl=(_,A)=>{A=Object.assign({encode:!0,strict:!0,[a]:!0},A);const C=g(_.url).split("?")[0]||"",R=t.extract(_.url),B=t.parse(R,{sort:!1}),S=Object.assign(B,_.query);let U=t.stringify(S,A);U&&(U=`?${U}`);let G=m(_.url);return _.fragmentIdentifier&&(G=`#${A[a]?u(_.fragmentIdentifier,A):_.fragmentIdentifier}`),`${C}${U}${G}`},t.pick=(_,A,C)=>{C=Object.assign({parseFragmentIdentifier:!0,[a]:!1},C);const{url:R,query:B,fragmentIdentifier:S}=t.parseUrl(_,C);return t.stringifyUrl({url:R,query:i(B,A),fragmentIdentifier:S},C)},t.exclude=(_,A,C)=>{const R=Array.isArray(A)?B=>!A.includes(B):(B,S)=>!A(B,S);return t.pick(_,R,C)}})(lv);var NN={},N_={},vr={},tte={};(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 s(o,l){return o<<32-l|o>>>l}t.rotr=s;function a(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o}t.isInteger=Number.isInteger||a,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(o){return t.isInteger(o)&&o>=-t.MAX_SAFE_INTEGER&&o<=t.MAX_SAFE_INTEGER}})(tte);Object.defineProperty(vr,"__esModule",{value:!0});var rte=tte;function mOe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}vr.readInt16BE=mOe;function yOe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}vr.readUint16BE=yOe;function vOe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}vr.readInt16LE=vOe;function wOe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}vr.readUint16LE=wOe;function nte(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}vr.writeUint16BE=nte;vr.writeInt16BE=nte;function ite(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}vr.writeUint16LE=ite;vr.writeInt16LE=ite;function NI(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}vr.readInt32BE=NI;function PI(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}vr.readUint32BE=PI;function RI(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}vr.readInt32LE=RI;function MI(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}vr.readUint32LE=MI;function X4(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}vr.writeUint32BE=X4;vr.writeInt32BE=X4;function e6(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}vr.writeUint32LE=e6;vr.writeInt32LE=e6;function bOe(t,e){e===void 0&&(e=0);var r=NI(t,e),n=NI(t,e+4);return r*4294967296+n-(n>>31)*4294967296}vr.readInt64BE=bOe;function _Oe(t,e){e===void 0&&(e=0);var r=PI(t,e),n=PI(t,e+4);return r*4294967296+n}vr.readUint64BE=_Oe;function xOe(t,e){e===void 0&&(e=0);var r=RI(t,e),n=RI(t,e+4);return n*4294967296+r-(r>>31)*4294967296}vr.readInt64LE=xOe;function EOe(t,e){e===void 0&&(e=0);var r=MI(t,e),n=MI(t,e+4);return n*4294967296+r}vr.readUint64LE=EOe;function ste(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),X4(t/4294967296>>>0,e,r),X4(t>>>0,e,r+4),e}vr.writeUint64BE=ste;vr.writeInt64BE=ste;function ate(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),e6(t>>>0,e,r),e6(t/4294967296>>>0,e,r+4),e}vr.writeUint64LE=ate;vr.writeInt64LE=ate;function COe(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,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}vr.readUintBE=COe;function AOe(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,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}vr.writeUintBE=SOe;function IOe(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(!rte.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>16|x<<16,K=K+x|0,S^=K,S=S>>>20|S<<12,C=C+U|0,P^=C,P=P>>>16|P<<16,N=N+P|0,U^=N,U=U>>>20|U<<12,R=R+G|0,D^=R,D=D>>>16|D<<16,k=k+D|0,G^=k,G=G>>>20|G<<12,B=B+ae|0,O^=B,O=O>>>16|O<<16,b=b+O|0,ae^=b,ae=ae>>>20|ae<<12,R=R+G|0,D^=R,D=D>>>24|D<<8,k=k+D|0,G^=k,G=G>>>25|G<<7,B=B+ae|0,O^=B,O=O>>>24|O<<8,b=b+O|0,ae^=b,ae=ae>>>25|ae<<7,C=C+U|0,P^=C,P=P>>>24|P<<8,N=N+P|0,U^=N,U=U>>>25|U<<7,A=A+S|0,x^=A,x=x>>>24|x<<8,K=K+x|0,S^=K,S=S>>>25|S<<7,A=A+U|0,O^=A,O=O>>>16|O<<16,k=k+O|0,U^=k,U=U>>>20|U<<12,C=C+G|0,x^=C,x=x>>>16|x<<16,b=b+x|0,G^=b,G=G>>>20|G<<12,R=R+ae|0,P^=R,P=P>>>16|P<<16,K=K+P|0,ae^=K,ae=ae>>>20|ae<<12,B=B+S|0,D^=B,D=D>>>16|D<<16,N=N+D|0,S^=N,S=S>>>20|S<<12,R=R+ae|0,P^=R,P=P>>>24|P<<8,K=K+P|0,ae^=K,ae=ae>>>25|ae<<7,B=B+S|0,D^=B,D=D>>>24|D<<8,N=N+D|0,S^=N,S=S>>>25|S<<7,C=C+G|0,x^=C,x=x>>>24|x<<8,b=b+x|0,G^=b,G=G>>>25|G<<7,A=A+U|0,O^=A,O=O>>>24|O<<8,k=k+O|0,U^=k,U=U>>>25|U<<7;bs.writeUint32LE(A+n|0,t,0),bs.writeUint32LE(C+i|0,t,4),bs.writeUint32LE(R+s|0,t,8),bs.writeUint32LE(B+a|0,t,12),bs.writeUint32LE(S+o|0,t,16),bs.writeUint32LE(U+l|0,t,20),bs.writeUint32LE(G+c|0,t,24),bs.writeUint32LE(ae+u|0,t,28),bs.writeUint32LE(K+f|0,t,32),bs.writeUint32LE(N+h|0,t,36),bs.writeUint32LE(k+g|0,t,40),bs.writeUint32LE(b+m|0,t,44),bs.writeUint32LE(x+w|0,t,48),bs.writeUint32LE(P+E|0,t,52),bs.writeUint32LE(D+v|0,t,56),bs.writeUint32LE(O+_|0,t,60)}function ote(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 lte={},ah={};Object.defineProperty(ah,"__esModule",{value:!0});function BOe(t,e,r){return~(t-1)&e|t-1&r}ah.select=BOe;function WOe(t,e){return(t|0)-(e|0)-1>>>31&1}ah.lessOrEqual=WOe;function cte(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}ah.compare=cte;function zOe(t,e){return t.length===0||e.length===0?!1:cte(t,e)!==0}ah.equal=zOe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=ah,r=Ao;t.DIGEST_LENGTH=16;var n=function(){function a(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 a.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],E=this._h[5],v=this._h[6],_=this._h[7],A=this._h[8],C=this._h[9],R=this._r[0],B=this._r[1],S=this._r[2],U=this._r[3],G=this._r[4],ae=this._r[5],K=this._r[6],N=this._r[7],k=this._r[8],b=this._r[9];c>=16;){var x=o[l+0]|o[l+1]<<8;f+=x&8191;var P=o[l+2]|o[l+3]<<8;h+=(x>>>13|P<<3)&8191;var D=o[l+4]|o[l+5]<<8;g+=(P>>>10|D<<6)&8191;var O=o[l+6]|o[l+7]<<8;m+=(D>>>7|O<<9)&8191;var j=o[l+8]|o[l+9]<<8;w+=(O>>>4|j<<12)&8191,E+=j>>>1&8191;var T=o[l+10]|o[l+11]<<8;v+=(j>>>14|T<<2)&8191;var L=o[l+12]|o[l+13]<<8;_+=(T>>>11|L<<5)&8191;var M=o[l+14]|o[l+15]<<8;A+=(L>>>8|M<<8)&8191,C+=M>>>5|u;var X=0,le=X;le+=f*R,le+=h*(5*b),le+=g*(5*k),le+=m*(5*N),le+=w*(5*K),X=le>>>13,le&=8191,le+=E*(5*ae),le+=v*(5*G),le+=_*(5*U),le+=A*(5*S),le+=C*(5*B),X+=le>>>13,le&=8191;var H=X;H+=f*B,H+=h*R,H+=g*(5*b),H+=m*(5*k),H+=w*(5*N),X=H>>>13,H&=8191,H+=E*(5*K),H+=v*(5*ae),H+=_*(5*G),H+=A*(5*U),H+=C*(5*S),X+=H>>>13,H&=8191;var ee=X;ee+=f*S,ee+=h*B,ee+=g*R,ee+=m*(5*b),ee+=w*(5*k),X=ee>>>13,ee&=8191,ee+=E*(5*N),ee+=v*(5*K),ee+=_*(5*ae),ee+=A*(5*G),ee+=C*(5*U),X+=ee>>>13,ee&=8191;var Z=X;Z+=f*U,Z+=h*S,Z+=g*B,Z+=m*R,Z+=w*(5*b),X=Z>>>13,Z&=8191,Z+=E*(5*k),Z+=v*(5*N),Z+=_*(5*K),Z+=A*(5*ae),Z+=C*(5*G),X+=Z>>>13,Z&=8191;var te=X;te+=f*G,te+=h*U,te+=g*S,te+=m*B,te+=w*R,X=te>>>13,te&=8191,te+=E*(5*b),te+=v*(5*k),te+=_*(5*N),te+=A*(5*K),te+=C*(5*ae),X+=te>>>13,te&=8191;var re=X;re+=f*ae,re+=h*G,re+=g*U,re+=m*S,re+=w*B,X=re>>>13,re&=8191,re+=E*R,re+=v*(5*b),re+=_*(5*k),re+=A*(5*N),re+=C*(5*K),X+=re>>>13,re&=8191;var W=X;W+=f*K,W+=h*ae,W+=g*G,W+=m*U,W+=w*S,X=W>>>13,W&=8191,W+=E*B,W+=v*R,W+=_*(5*b),W+=A*(5*k),W+=C*(5*N),X+=W>>>13,W&=8191;var q=X;q+=f*N,q+=h*K,q+=g*ae,q+=m*G,q+=w*U,X=q>>>13,q&=8191,q+=E*S,q+=v*B,q+=_*R,q+=A*(5*b),q+=C*(5*k),X+=q>>>13,q&=8191;var J=X;J+=f*k,J+=h*N,J+=g*K,J+=m*ae,J+=w*G,X=J>>>13,J&=8191,J+=E*U,J+=v*S,J+=_*B,J+=A*R,J+=C*(5*b),X+=J>>>13,J&=8191;var me=X;me+=f*b,me+=h*k,me+=g*N,me+=m*K,me+=w*ae,X=me>>>13,me&=8191,me+=E*G,me+=v*U,me+=_*S,me+=A*B,me+=C*R,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=Z,w=te,E=re,v=W,_=q,A=J,C=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]=E,this._h[6]=v,this._h[7]=_,this._h[8]=A,this._h[9]=C},a.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},a.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,E;if(h){if(h.length!==w)throw new Error("ChaCha20Poly1305: incorrect destination length");E=h}else E=new Uint8Array(w);return e.streamXOR(this._key,g,u,E,4),this._authenticate(E.subarray(E.length-this.tagLength,E.length),m,E.subarray(0,E.length-this.tagLength),f),n.wipe(g),E},l.prototype.open=function(c,u,f,h){if(c.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&g.update(a.subarray(h.length%16))),g.update(f),f.length%16>0&&g.update(a.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(),E=0;Ethis.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 E=0;E0;E++){const v=w[E];v0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=s(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 s(o,l,c,u,f){for(;f>=64;){for(var h=l[0],g=l[1],m=l[2],w=l[3],E=l[4],v=l[5],_=l[6],A=l[7],C=0;C<16;C++){var R=u+C*4;o[C]=e.readUint32BE(c,R)}for(var C=16;C<64;C++){var B=o[C-2],S=(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10;B=o[C-15];var U=(B>>>7|B<<25)^(B>>>18|B<<14)^B>>>3;o[C]=(S+o[C-7]|0)+(U+o[C-16]|0)}for(var C=0;C<64;C++){var S=(((E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7))+(E&v^~E&_)|0)+(A+(i[C]+o[C]|0)|0)|0,U=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&g^h&m^g&m)|0;A=_,_=v,v=E,E=w+S|0,w=m,m=g,g=h,h=S+U|0}l[0]+=h,l[1]+=g,l[2]+=m,l[3]+=w,l[4]+=E,l[5]+=v,l[6]+=_,l[7]+=A,u+=64,f-=64}return u}function a(o){var l=new n;l.update(o);var c=l.digest();return l.clean(),c}t.hash=a})(hw);var RN={};(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=oh,r=Ao;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(C){const R=new Float64Array(16);if(C)for(let B=0;B>16&1),B[ae-1]&=65535;B[15]=S[15]-32767-(B[14]>>16&1);const G=B[15]>>16&1;B[14]&=65535,o(S,B,1-G)}for(let U=0;U<16;U++)C[2*U]=S[U]&255,C[2*U+1]=S[U]>>8}function c(C,R){for(let B=0;B<16;B++)C[B]=R[2*B]+(R[2*B+1]<<8);C[15]&=32767}function u(C,R,B){for(let S=0;S<16;S++)C[S]=R[S]+B[S]}function f(C,R,B){for(let S=0;S<16;S++)C[S]=R[S]-B[S]}function h(C,R,B){let S,U,G=0,ae=0,K=0,N=0,k=0,b=0,x=0,P=0,D=0,O=0,j=0,T=0,L=0,M=0,X=0,le=0,H=0,ee=0,Z=0,te=0,re=0,W=0,q=0,J=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ye=0,lt=0,xe=B[0],He=B[1],Ve=B[2],Ie=B[3],Ne=B[4],Oe=B[5],Me=B[6],Y=B[7],F=B[8],z=B[9],ie=B[10],pe=B[11],ve=B[12],he=B[13],Le=B[14],Ze=B[15];S=R[0],G+=S*xe,ae+=S*He,K+=S*Ve,N+=S*Ie,k+=S*Ne,b+=S*Oe,x+=S*Me,P+=S*Y,D+=S*F,O+=S*z,j+=S*ie,T+=S*pe,L+=S*ve,M+=S*he,X+=S*Le,le+=S*Ze,S=R[1],ae+=S*xe,K+=S*He,N+=S*Ve,k+=S*Ie,b+=S*Ne,x+=S*Oe,P+=S*Me,D+=S*Y,O+=S*F,j+=S*z,T+=S*ie,L+=S*pe,M+=S*ve,X+=S*he,le+=S*Le,H+=S*Ze,S=R[2],K+=S*xe,N+=S*He,k+=S*Ve,b+=S*Ie,x+=S*Ne,P+=S*Oe,D+=S*Me,O+=S*Y,j+=S*F,T+=S*z,L+=S*ie,M+=S*pe,X+=S*ve,le+=S*he,H+=S*Le,ee+=S*Ze,S=R[3],N+=S*xe,k+=S*He,b+=S*Ve,x+=S*Ie,P+=S*Ne,D+=S*Oe,O+=S*Me,j+=S*Y,T+=S*F,L+=S*z,M+=S*ie,X+=S*pe,le+=S*ve,H+=S*he,ee+=S*Le,Z+=S*Ze,S=R[4],k+=S*xe,b+=S*He,x+=S*Ve,P+=S*Ie,D+=S*Ne,O+=S*Oe,j+=S*Me,T+=S*Y,L+=S*F,M+=S*z,X+=S*ie,le+=S*pe,H+=S*ve,ee+=S*he,Z+=S*Le,te+=S*Ze,S=R[5],b+=S*xe,x+=S*He,P+=S*Ve,D+=S*Ie,O+=S*Ne,j+=S*Oe,T+=S*Me,L+=S*Y,M+=S*F,X+=S*z,le+=S*ie,H+=S*pe,ee+=S*ve,Z+=S*he,te+=S*Le,re+=S*Ze,S=R[6],x+=S*xe,P+=S*He,D+=S*Ve,O+=S*Ie,j+=S*Ne,T+=S*Oe,L+=S*Me,M+=S*Y,X+=S*F,le+=S*z,H+=S*ie,ee+=S*pe,Z+=S*ve,te+=S*he,re+=S*Le,W+=S*Ze,S=R[7],P+=S*xe,D+=S*He,O+=S*Ve,j+=S*Ie,T+=S*Ne,L+=S*Oe,M+=S*Me,X+=S*Y,le+=S*F,H+=S*z,ee+=S*ie,Z+=S*pe,te+=S*ve,re+=S*he,W+=S*Le,q+=S*Ze,S=R[8],D+=S*xe,O+=S*He,j+=S*Ve,T+=S*Ie,L+=S*Ne,M+=S*Oe,X+=S*Me,le+=S*Y,H+=S*F,ee+=S*z,Z+=S*ie,te+=S*pe,re+=S*ve,W+=S*he,q+=S*Le,J+=S*Ze,S=R[9],O+=S*xe,j+=S*He,T+=S*Ve,L+=S*Ie,M+=S*Ne,X+=S*Oe,le+=S*Me,H+=S*Y,ee+=S*F,Z+=S*z,te+=S*ie,re+=S*pe,W+=S*ve,q+=S*he,J+=S*Le,me+=S*Ze,S=R[10],j+=S*xe,T+=S*He,L+=S*Ve,M+=S*Ie,X+=S*Ne,le+=S*Oe,H+=S*Me,ee+=S*Y,Z+=S*F,te+=S*z,re+=S*ie,W+=S*pe,q+=S*ve,J+=S*he,me+=S*Le,be+=S*Ze,S=R[11],T+=S*xe,L+=S*He,M+=S*Ve,X+=S*Ie,le+=S*Ne,H+=S*Oe,ee+=S*Me,Z+=S*Y,te+=S*F,re+=S*z,W+=S*ie,q+=S*pe,J+=S*ve,me+=S*he,be+=S*Le,Ce+=S*Ze,S=R[12],L+=S*xe,M+=S*He,X+=S*Ve,le+=S*Ie,H+=S*Ne,ee+=S*Oe,Z+=S*Me,te+=S*Y,re+=S*F,W+=S*z,q+=S*ie,J+=S*pe,me+=S*ve,be+=S*he,Ce+=S*Le,Fe+=S*Ze,S=R[13],M+=S*xe,X+=S*He,le+=S*Ve,H+=S*Ie,ee+=S*Ne,Z+=S*Oe,te+=S*Me,re+=S*Y,W+=S*F,q+=S*z,J+=S*ie,me+=S*pe,be+=S*ve,Ce+=S*he,Fe+=S*Le,Ue+=S*Ze,S=R[14],X+=S*xe,le+=S*He,H+=S*Ve,ee+=S*Ie,Z+=S*Ne,te+=S*Oe,re+=S*Me,W+=S*Y,q+=S*F,J+=S*z,me+=S*ie,be+=S*pe,Ce+=S*ve,Fe+=S*he,Ue+=S*Le,Ye+=S*Ze,S=R[15],le+=S*xe,H+=S*He,ee+=S*Ve,Z+=S*Ie,te+=S*Ne,re+=S*Oe,W+=S*Me,q+=S*Y,J+=S*F,me+=S*z,be+=S*ie,Ce+=S*pe,Fe+=S*ve,Ue+=S*he,Ye+=S*Le,lt+=S*Ze,G+=38*H,ae+=38*ee,K+=38*Z,N+=38*te,k+=38*re,b+=38*W,x+=38*q,P+=38*J,D+=38*me,O+=38*be,j+=38*Ce,T+=38*Fe,L+=38*Ue,M+=38*Ye,X+=38*lt,U=1,S=G+U+65535,U=Math.floor(S/65536),G=S-U*65536,S=ae+U+65535,U=Math.floor(S/65536),ae=S-U*65536,S=K+U+65535,U=Math.floor(S/65536),K=S-U*65536,S=N+U+65535,U=Math.floor(S/65536),N=S-U*65536,S=k+U+65535,U=Math.floor(S/65536),k=S-U*65536,S=b+U+65535,U=Math.floor(S/65536),b=S-U*65536,S=x+U+65535,U=Math.floor(S/65536),x=S-U*65536,S=P+U+65535,U=Math.floor(S/65536),P=S-U*65536,S=D+U+65535,U=Math.floor(S/65536),D=S-U*65536,S=O+U+65535,U=Math.floor(S/65536),O=S-U*65536,S=j+U+65535,U=Math.floor(S/65536),j=S-U*65536,S=T+U+65535,U=Math.floor(S/65536),T=S-U*65536,S=L+U+65535,U=Math.floor(S/65536),L=S-U*65536,S=M+U+65535,U=Math.floor(S/65536),M=S-U*65536,S=X+U+65535,U=Math.floor(S/65536),X=S-U*65536,S=le+U+65535,U=Math.floor(S/65536),le=S-U*65536,G+=U-1+37*(U-1),U=1,S=G+U+65535,U=Math.floor(S/65536),G=S-U*65536,S=ae+U+65535,U=Math.floor(S/65536),ae=S-U*65536,S=K+U+65535,U=Math.floor(S/65536),K=S-U*65536,S=N+U+65535,U=Math.floor(S/65536),N=S-U*65536,S=k+U+65535,U=Math.floor(S/65536),k=S-U*65536,S=b+U+65535,U=Math.floor(S/65536),b=S-U*65536,S=x+U+65535,U=Math.floor(S/65536),x=S-U*65536,S=P+U+65535,U=Math.floor(S/65536),P=S-U*65536,S=D+U+65535,U=Math.floor(S/65536),D=S-U*65536,S=O+U+65535,U=Math.floor(S/65536),O=S-U*65536,S=j+U+65535,U=Math.floor(S/65536),j=S-U*65536,S=T+U+65535,U=Math.floor(S/65536),T=S-U*65536,S=L+U+65535,U=Math.floor(S/65536),L=S-U*65536,S=M+U+65535,U=Math.floor(S/65536),M=S-U*65536,S=X+U+65535,U=Math.floor(S/65536),X=S-U*65536,S=le+U+65535,U=Math.floor(S/65536),le=S-U*65536,G+=U-1+37*(U-1),C[0]=G,C[1]=ae,C[2]=K,C[3]=N,C[4]=k,C[5]=b,C[6]=x,C[7]=P,C[8]=D,C[9]=O,C[10]=j,C[11]=T,C[12]=L,C[13]=M,C[14]=X,C[15]=le}function g(C,R){h(C,R,R)}function m(C,R){const B=n();for(let S=0;S<16;S++)B[S]=R[S];for(let S=253;S>=0;S--)g(B,B),S!==2&&S!==4&&h(B,B,R);for(let S=0;S<16;S++)C[S]=B[S]}function w(C,R){const B=new Uint8Array(32),S=new Float64Array(80),U=n(),G=n(),ae=n(),K=n(),N=n(),k=n();for(let D=0;D<31;D++)B[D]=C[D];B[31]=C[31]&127|64,B[0]&=248,c(S,R);for(let D=0;D<16;D++)G[D]=S[D];U[0]=K[0]=1;for(let D=254;D>=0;--D){const O=B[D>>>3]>>>(D&7)&1;o(U,G,O),o(ae,K,O),u(N,U,ae),f(U,U,ae),u(ae,G,K),f(G,G,K),g(K,N),g(k,U),h(U,ae,U),h(ae,G,N),u(N,U,ae),f(U,U,ae),g(G,U),f(ae,K,k),h(U,ae,s),u(U,U,K),h(ae,ae,U),h(U,K,k),h(K,G,S),g(G,N),o(U,G,O),o(ae,K,O)}for(let D=0;D<16;D++)S[D+16]=U[D],S[D+32]=ae[D],S[D+48]=G[D],S[D+64]=K[D];const b=S.subarray(32),x=S.subarray(16);m(b,b),h(x,x,b);const P=new Uint8Array(32);return l(P,x),P}t.scalarMult=w;function E(C){return w(C,i)}t.scalarMultBase=E;function v(C){if(C.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const R=new Uint8Array(C);return{publicKey:E(R),secretKey:R}}t.generateKeyPairFromSeed=v;function _(C){const R=(0,e.randomBytes)(32,C),B=v(R);return(0,r.wipe)(R),B}t.generateKeyPair=_;function A(C,R,B=!1){if(C.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(R.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const S=w(C,R);if(B){let U=0;for(let G=0;Gi+s.length,0));const r=fte(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function nje(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,C=new Uint8Array(A);v!==_;){for(var R=m[v],B=0,S=A-1;(R!==0||B>>0,C[S]=R%o>>>0,R=R/o>>>0;if(R!==0)throw new Error("Non-zero carry");E=B,v++}for(var U=A-E;U!==A&&C[U]===0;)U++;for(var G=l.repeat(w);U>>0,A=new Uint8Array(_);m[w];){var C=r[m.charCodeAt(w)];if(C===255)return;for(var R=0,B=_-1;(C!==0||R>>0,A[B]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");v=R,w++}if(m[w]!==" "){for(var S=_-v;S!==_&&A[S]===0;)S++;for(var U=new Uint8Array(E+(_-S)),G=E;S!==_;)U[G++]=A[S++];return U}}}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 ije=nje,sje=ije;const aje=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")},oje=t=>new TextEncoder().encode(t),lje=t=>new TextDecoder().decode(t);class cje{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 uje{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 hte(this,e)}}class dje{constructor(e){this.decoders=e}or(e){return hte(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 hte=(t,e)=>new dje({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class fje{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new cje(e,r,n),this.decoder=new uje(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const O_=({name:t,prefix:e,encode:r,decode:n})=>new fje(t,e,r,n),pw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=sje(r,e);return O_({prefix:t,name:e,encode:n,decode:s=>aje(i(s))})},hje=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(o-=8,a[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return a},pje=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)a-=r,s+=e[i&o>>a];if(a&&(s+=e[i&o<O_({prefix:e,name:t,encode(i){return pje(i,n,r)},decode(i){return hje(i,n,r,t)}}),gje=O_({prefix:"\0",name:"identity",encode:t=>lje(t),decode:t=>oje(t)}),mje=Object.freeze(Object.defineProperty({__proto__:null,identity:gje},Symbol.toStringTag,{value:"Module"})),yje=hs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),vje=Object.freeze(Object.defineProperty({__proto__:null,base2:yje},Symbol.toStringTag,{value:"Module"})),wje=hs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),bje=Object.freeze(Object.defineProperty({__proto__:null,base8:wje},Symbol.toStringTag,{value:"Module"})),_je=pw({prefix:"9",name:"base10",alphabet:"0123456789"}),xje=Object.freeze(Object.defineProperty({__proto__:null,base10:_je},Symbol.toStringTag,{value:"Module"})),Eje=hs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Cje=hs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Aje=Object.freeze(Object.defineProperty({__proto__:null,base16:Eje,base16upper:Cje},Symbol.toStringTag,{value:"Module"})),Sje=hs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ije=hs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Tje=hs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$je=hs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),kje=hs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Nje=hs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Pje=hs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Rje=hs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Mje=hs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Oje=Object.freeze(Object.defineProperty({__proto__:null,base32:Sje,base32hex:kje,base32hexpad:Pje,base32hexpadupper:Rje,base32hexupper:Nje,base32pad:Tje,base32padupper:$je,base32upper:Ije,base32z:Mje},Symbol.toStringTag,{value:"Module"})),jje=pw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Lje=pw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Dje=Object.freeze(Object.defineProperty({__proto__:null,base36:jje,base36upper:Lje},Symbol.toStringTag,{value:"Module"})),Fje=pw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Uje=pw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Bje=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Fje,base58flickr:Uje},Symbol.toStringTag,{value:"Module"})),Wje=hs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),zje=hs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Hje=hs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),qje=hs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Vje=Object.freeze(Object.defineProperty({__proto__:null,base64:Wje,base64pad:zje,base64url:Hje,base64urlpad:qje},Symbol.toStringTag,{value:"Module"})),pte=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Gje=pte.reduce((t,e,r)=>(t[r]=e,t),[]),Kje=pte.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Yje(t){return t.reduce((e,r)=>(e+=Gje[r],e),"")}function Zje(t){const e=[];for(const r of t){const n=Kje[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Jje=O_({prefix:"🚀",name:"base256emoji",encode:Yje,decode:Zje}),Qje=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Jje},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const DU={...mje,...vje,...bje,...xje,...Aje,...Oje,...Dje,...Bje,...Vje,...Qje};function gte(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const FU=gte("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),KE=gte("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=fte(t.length);for(let r=0;r",lLe="MIT",cLe={url:"https://github.com/indutny/elliptic/issues"},uLe="https://github.com/indutny/elliptic",dLe={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"},fLe={"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"},hLe={name:Xje,version:eLe,description:tLe,main:rLe,files:nLe,scripts:iLe,repository:sLe,keywords:aLe,author:oLe,license:lLe,bugs:cLe,homepage:uLe,devDependencies:dLe,dependencies:fLe};var So={},MN={exports:{}};MN.exports;(function(t){(function(e,r){function n(K,N){if(!K)throw new Error(N||"Assertion failed")}function i(K,N){K.super_=N;var k=function(){};k.prototype=N.prototype,K.prototype=new k,K.prototype.constructor=K}function s(K,N,k){if(s.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((N==="le"||N==="be")&&(k=N,N=10),this._init(K||0,N||10,k||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=Rg.Buffer}catch{}s.isBN=function(N){return N instanceof s?!0:N!==null&&typeof N=="object"&&N.constructor.wordSize===s.wordSize&&Array.isArray(N.words)},s.max=function(N,k){return N.cmp(k)>0?N:k},s.min=function(N,k){return N.cmp(k)<0?N:k},s.prototype._init=function(N,k,b){if(typeof N=="number")return this._initNumber(N,k,b);if(typeof N=="object")return this._initArray(N,k,b);k==="hex"&&(k=16),n(k===(k|0)&&k>=2&&k<=36),N=N.toString().replace(/\s+/g,"");var x=0;N[0]==="-"&&(x++,this.negative=1),x=0;x-=3)D=N[x]|N[x-1]<<8|N[x-2]<<16,this.words[P]|=D<>>26-O&67108863,O+=24,O>=26&&(O-=26,P++);else if(b==="le")for(x=0,P=0;x>>26-O&67108863,O+=24,O>=26&&(O-=26,P++);return this.strip()};function o(K,N){var k=K.charCodeAt(N);return k>=65&&k<=70?k-55:k>=97&&k<=102?k-87:k-48&15}function l(K,N,k){var b=o(K,k);return k-1>=N&&(b|=o(K,k-1)<<4),b}s.prototype._parseHex=function(N,k,b){this.length=Math.ceil((N.length-k)/6),this.words=new Array(this.length);for(var x=0;x=k;x-=2)O=l(N,k,x)<=18?(P-=18,D+=1,this.words[D]|=O>>>26):P+=8;else{var j=N.length-k;for(x=j%2===0?k+1:k;x=18?(P-=18,D+=1,this.words[D]|=O>>>26):P+=8}this.strip()};function c(K,N,k,b){for(var x=0,P=Math.min(K.length,k),D=N;D=49?x+=O-49+10:O>=17?x+=O-17+10:x+=O}return x}s.prototype._parseBase=function(N,k,b){this.words=[0],this.length=1;for(var x=0,P=1;P<=67108863;P*=k)x++;x--,P=P/k|0;for(var D=N.length-b,O=D%x,j=Math.min(D,D-O)+b,T=0,L=b;L1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.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];s.prototype.toString=function(N,k){N=N||10,k=k|0||1;var b;if(N===16||N==="hex"){b="";for(var x=0,P=0,D=0;D>>24-x&16777215,x+=2,x>=26&&(x-=26,D--),P!==0||D!==this.length-1?b=u[6-j.length]+j+b:b=j+b}for(P!==0&&(b=P.toString(16)+b);b.length%k!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(N===(N|0)&&N>=2&&N<=36){var T=f[N],L=h[N];b="";var M=this.clone();for(M.negative=0;!M.isZero();){var X=M.modn(L).toString(N);M=M.idivn(L),M.isZero()?b=X+b:b=u[T-X.length]+X+b}for(this.isZero()&&(b="0"+b);b.length%k!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}n(!1,"Base should be between 2 and 36")},s.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},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(N,k){return n(typeof a<"u"),this.toArrayLike(a,N,k)},s.prototype.toArray=function(N,k){return this.toArrayLike(Array,N,k)},s.prototype.toArrayLike=function(N,k,b){var x=this.byteLength(),P=b||Math.max(1,x);n(x<=P,"byte array longer than desired length"),n(P>0,"Requested array length <= 0"),this.strip();var D=k==="le",O=new N(P),j,T,L=this.clone();if(D){for(T=0;!L.isZero();T++)j=L.andln(255),L.iushrn(8),O[T]=j;for(;T=4096&&(b+=13,k>>>=13),k>=64&&(b+=7,k>>>=7),k>=8&&(b+=4,k>>>=4),k>=2&&(b+=2,k>>>=2),b+k},s.prototype._zeroBits=function(N){if(N===0)return 26;var k=N,b=0;return k&8191||(b+=13,k>>>=13),k&127||(b+=7,k>>>=7),k&15||(b+=4,k>>>=4),k&3||(b+=2,k>>>=2),k&1||b++,b},s.prototype.bitLength=function(){var N=this.words[this.length-1],k=this._countBits(N);return(this.length-1)*26+k};function g(K){for(var N=new Array(K.bitLength()),k=0;k>>x}return N}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var N=0,k=0;kN.length?this.clone().ior(N):N.clone().ior(this)},s.prototype.uor=function(N){return this.length>N.length?this.clone().iuor(N):N.clone().iuor(this)},s.prototype.iuand=function(N){var k;this.length>N.length?k=N:k=this;for(var b=0;bN.length?this.clone().iand(N):N.clone().iand(this)},s.prototype.uand=function(N){return this.length>N.length?this.clone().iuand(N):N.clone().iuand(this)},s.prototype.iuxor=function(N){var k,b;this.length>N.length?(k=this,b=N):(k=N,b=this);for(var x=0;xN.length?this.clone().ixor(N):N.clone().ixor(this)},s.prototype.uxor=function(N){return this.length>N.length?this.clone().iuxor(N):N.clone().iuxor(this)},s.prototype.inotn=function(N){n(typeof N=="number"&&N>=0);var k=Math.ceil(N/26)|0,b=N%26;this._expand(k),b>0&&k--;for(var x=0;x0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},s.prototype.notn=function(N){return this.clone().inotn(N)},s.prototype.setn=function(N,k){n(typeof N=="number"&&N>=0);var b=N/26|0,x=N%26;return this._expand(b+1),k?this.words[b]=this.words[b]|1<N.length?(b=this,x=N):(b=N,x=this);for(var P=0,D=0;D>>26;for(;P!==0&&D>>26;if(this.length=b.length,P!==0)this.words[this.length]=P,this.length++;else if(b!==this)for(;DN.length?this.clone().iadd(N):N.clone().iadd(this)},s.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 b=this.cmp(N);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,P;b>0?(x=this,P=N):(x=N,P=this);for(var D=0,O=0;O>26,this.words[O]=k&67108863;for(;D!==0&&O>26,this.words[O]=k&67108863;if(D===0&&O>>26,M=j&67108863,X=Math.min(T,N.length-1),le=Math.max(0,T-K.length+1);le<=X;le++){var H=T-le|0;x=K.words[H]|0,P=N.words[le]|0,D=x*P+M,L+=D/67108864|0,M=D&67108863}k.words[T]=M|0,j=L|0}return j!==0?k.words[T]=j|0:k.length--,k.strip()}var w=function(N,k,b){var x=N.words,P=k.words,D=b.words,O=0,j,T,L,M=x[0]|0,X=M&8191,le=M>>>13,H=x[1]|0,ee=H&8191,Z=H>>>13,te=x[2]|0,re=te&8191,W=te>>>13,q=x[3]|0,J=q&8191,me=q>>>13,be=x[4]|0,Ce=be&8191,Fe=be>>>13,Ue=x[5]|0,Ye=Ue&8191,lt=Ue>>>13,xe=x[6]|0,He=xe&8191,Ve=xe>>>13,Ie=x[7]|0,Ne=Ie&8191,Oe=Ie>>>13,Me=x[8]|0,Y=Me&8191,F=Me>>>13,z=x[9]|0,ie=z&8191,pe=z>>>13,ve=P[0]|0,he=ve&8191,Le=ve>>>13,Ze=P[1]|0,et=Ze&8191,it=Ze>>>13,ut=P[2]|0,pt=ut&8191,tr=ut>>>13,Wt=P[3]|0,At=Wt&8191,mt=Wt>>>13,Ct=P[4]|0,dt=Ct&8191,Nt=Ct>>>13,jt=P[5]|0,gt=jt&8191,Vt=jt>>>13,zt=P[6]|0,ot=zt&8191,Gt=zt>>>13,Ft=P[7]|0,yt=Ft&8191,Qe=Ft>>>13,Ot=P[8]|0,_t=Ot&8191,Zt=Ot>>>13,Cr=P[9]|0,qt=Cr&8191,Ar=Cr>>>13;b.negative=N.negative^k.negative,b.length=19,j=Math.imul(X,he),T=Math.imul(X,Le),T=T+Math.imul(le,he)|0,L=Math.imul(le,Le);var cr=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(cr>>>26)|0,cr&=67108863,j=Math.imul(ee,he),T=Math.imul(ee,Le),T=T+Math.imul(Z,he)|0,L=Math.imul(Z,Le),j=j+Math.imul(X,et)|0,T=T+Math.imul(X,it)|0,T=T+Math.imul(le,et)|0,L=L+Math.imul(le,it)|0;var br=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(br>>>26)|0,br&=67108863,j=Math.imul(re,he),T=Math.imul(re,Le),T=T+Math.imul(W,he)|0,L=Math.imul(W,Le),j=j+Math.imul(ee,et)|0,T=T+Math.imul(ee,it)|0,T=T+Math.imul(Z,et)|0,L=L+Math.imul(Z,it)|0,j=j+Math.imul(X,pt)|0,T=T+Math.imul(X,tr)|0,T=T+Math.imul(le,pt)|0,L=L+Math.imul(le,tr)|0;var Q=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(Q>>>26)|0,Q&=67108863,j=Math.imul(J,he),T=Math.imul(J,Le),T=T+Math.imul(me,he)|0,L=Math.imul(me,Le),j=j+Math.imul(re,et)|0,T=T+Math.imul(re,it)|0,T=T+Math.imul(W,et)|0,L=L+Math.imul(W,it)|0,j=j+Math.imul(ee,pt)|0,T=T+Math.imul(ee,tr)|0,T=T+Math.imul(Z,pt)|0,L=L+Math.imul(Z,tr)|0,j=j+Math.imul(X,At)|0,T=T+Math.imul(X,mt)|0,T=T+Math.imul(le,At)|0,L=L+Math.imul(le,mt)|0;var se=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(se>>>26)|0,se&=67108863,j=Math.imul(Ce,he),T=Math.imul(Ce,Le),T=T+Math.imul(Fe,he)|0,L=Math.imul(Fe,Le),j=j+Math.imul(J,et)|0,T=T+Math.imul(J,it)|0,T=T+Math.imul(me,et)|0,L=L+Math.imul(me,it)|0,j=j+Math.imul(re,pt)|0,T=T+Math.imul(re,tr)|0,T=T+Math.imul(W,pt)|0,L=L+Math.imul(W,tr)|0,j=j+Math.imul(ee,At)|0,T=T+Math.imul(ee,mt)|0,T=T+Math.imul(Z,At)|0,L=L+Math.imul(Z,mt)|0,j=j+Math.imul(X,dt)|0,T=T+Math.imul(X,Nt)|0,T=T+Math.imul(le,dt)|0,L=L+Math.imul(le,Nt)|0;var de=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(de>>>26)|0,de&=67108863,j=Math.imul(Ye,he),T=Math.imul(Ye,Le),T=T+Math.imul(lt,he)|0,L=Math.imul(lt,Le),j=j+Math.imul(Ce,et)|0,T=T+Math.imul(Ce,it)|0,T=T+Math.imul(Fe,et)|0,L=L+Math.imul(Fe,it)|0,j=j+Math.imul(J,pt)|0,T=T+Math.imul(J,tr)|0,T=T+Math.imul(me,pt)|0,L=L+Math.imul(me,tr)|0,j=j+Math.imul(re,At)|0,T=T+Math.imul(re,mt)|0,T=T+Math.imul(W,At)|0,L=L+Math.imul(W,mt)|0,j=j+Math.imul(ee,dt)|0,T=T+Math.imul(ee,Nt)|0,T=T+Math.imul(Z,dt)|0,L=L+Math.imul(Z,Nt)|0,j=j+Math.imul(X,gt)|0,T=T+Math.imul(X,Vt)|0,T=T+Math.imul(le,gt)|0,L=L+Math.imul(le,Vt)|0;var ue=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(ue>>>26)|0,ue&=67108863,j=Math.imul(He,he),T=Math.imul(He,Le),T=T+Math.imul(Ve,he)|0,L=Math.imul(Ve,Le),j=j+Math.imul(Ye,et)|0,T=T+Math.imul(Ye,it)|0,T=T+Math.imul(lt,et)|0,L=L+Math.imul(lt,it)|0,j=j+Math.imul(Ce,pt)|0,T=T+Math.imul(Ce,tr)|0,T=T+Math.imul(Fe,pt)|0,L=L+Math.imul(Fe,tr)|0,j=j+Math.imul(J,At)|0,T=T+Math.imul(J,mt)|0,T=T+Math.imul(me,At)|0,L=L+Math.imul(me,mt)|0,j=j+Math.imul(re,dt)|0,T=T+Math.imul(re,Nt)|0,T=T+Math.imul(W,dt)|0,L=L+Math.imul(W,Nt)|0,j=j+Math.imul(ee,gt)|0,T=T+Math.imul(ee,Vt)|0,T=T+Math.imul(Z,gt)|0,L=L+Math.imul(Z,Vt)|0,j=j+Math.imul(X,ot)|0,T=T+Math.imul(X,Gt)|0,T=T+Math.imul(le,ot)|0,L=L+Math.imul(le,Gt)|0;var we=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(we>>>26)|0,we&=67108863,j=Math.imul(Ne,he),T=Math.imul(Ne,Le),T=T+Math.imul(Oe,he)|0,L=Math.imul(Oe,Le),j=j+Math.imul(He,et)|0,T=T+Math.imul(He,it)|0,T=T+Math.imul(Ve,et)|0,L=L+Math.imul(Ve,it)|0,j=j+Math.imul(Ye,pt)|0,T=T+Math.imul(Ye,tr)|0,T=T+Math.imul(lt,pt)|0,L=L+Math.imul(lt,tr)|0,j=j+Math.imul(Ce,At)|0,T=T+Math.imul(Ce,mt)|0,T=T+Math.imul(Fe,At)|0,L=L+Math.imul(Fe,mt)|0,j=j+Math.imul(J,dt)|0,T=T+Math.imul(J,Nt)|0,T=T+Math.imul(me,dt)|0,L=L+Math.imul(me,Nt)|0,j=j+Math.imul(re,gt)|0,T=T+Math.imul(re,Vt)|0,T=T+Math.imul(W,gt)|0,L=L+Math.imul(W,Vt)|0,j=j+Math.imul(ee,ot)|0,T=T+Math.imul(ee,Gt)|0,T=T+Math.imul(Z,ot)|0,L=L+Math.imul(Z,Gt)|0,j=j+Math.imul(X,yt)|0,T=T+Math.imul(X,Qe)|0,T=T+Math.imul(le,yt)|0,L=L+Math.imul(le,Qe)|0;var Re=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(Re>>>26)|0,Re&=67108863,j=Math.imul(Y,he),T=Math.imul(Y,Le),T=T+Math.imul(F,he)|0,L=Math.imul(F,Le),j=j+Math.imul(Ne,et)|0,T=T+Math.imul(Ne,it)|0,T=T+Math.imul(Oe,et)|0,L=L+Math.imul(Oe,it)|0,j=j+Math.imul(He,pt)|0,T=T+Math.imul(He,tr)|0,T=T+Math.imul(Ve,pt)|0,L=L+Math.imul(Ve,tr)|0,j=j+Math.imul(Ye,At)|0,T=T+Math.imul(Ye,mt)|0,T=T+Math.imul(lt,At)|0,L=L+Math.imul(lt,mt)|0,j=j+Math.imul(Ce,dt)|0,T=T+Math.imul(Ce,Nt)|0,T=T+Math.imul(Fe,dt)|0,L=L+Math.imul(Fe,Nt)|0,j=j+Math.imul(J,gt)|0,T=T+Math.imul(J,Vt)|0,T=T+Math.imul(me,gt)|0,L=L+Math.imul(me,Vt)|0,j=j+Math.imul(re,ot)|0,T=T+Math.imul(re,Gt)|0,T=T+Math.imul(W,ot)|0,L=L+Math.imul(W,Gt)|0,j=j+Math.imul(ee,yt)|0,T=T+Math.imul(ee,Qe)|0,T=T+Math.imul(Z,yt)|0,L=L+Math.imul(Z,Qe)|0,j=j+Math.imul(X,_t)|0,T=T+Math.imul(X,Zt)|0,T=T+Math.imul(le,_t)|0,L=L+Math.imul(le,Zt)|0;var qe=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(qe>>>26)|0,qe&=67108863,j=Math.imul(ie,he),T=Math.imul(ie,Le),T=T+Math.imul(pe,he)|0,L=Math.imul(pe,Le),j=j+Math.imul(Y,et)|0,T=T+Math.imul(Y,it)|0,T=T+Math.imul(F,et)|0,L=L+Math.imul(F,it)|0,j=j+Math.imul(Ne,pt)|0,T=T+Math.imul(Ne,tr)|0,T=T+Math.imul(Oe,pt)|0,L=L+Math.imul(Oe,tr)|0,j=j+Math.imul(He,At)|0,T=T+Math.imul(He,mt)|0,T=T+Math.imul(Ve,At)|0,L=L+Math.imul(Ve,mt)|0,j=j+Math.imul(Ye,dt)|0,T=T+Math.imul(Ye,Nt)|0,T=T+Math.imul(lt,dt)|0,L=L+Math.imul(lt,Nt)|0,j=j+Math.imul(Ce,gt)|0,T=T+Math.imul(Ce,Vt)|0,T=T+Math.imul(Fe,gt)|0,L=L+Math.imul(Fe,Vt)|0,j=j+Math.imul(J,ot)|0,T=T+Math.imul(J,Gt)|0,T=T+Math.imul(me,ot)|0,L=L+Math.imul(me,Gt)|0,j=j+Math.imul(re,yt)|0,T=T+Math.imul(re,Qe)|0,T=T+Math.imul(W,yt)|0,L=L+Math.imul(W,Qe)|0,j=j+Math.imul(ee,_t)|0,T=T+Math.imul(ee,Zt)|0,T=T+Math.imul(Z,_t)|0,L=L+Math.imul(Z,Zt)|0,j=j+Math.imul(X,qt)|0,T=T+Math.imul(X,Ar)|0,T=T+Math.imul(le,qt)|0,L=L+Math.imul(le,Ar)|0;var Be=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(Be>>>26)|0,Be&=67108863,j=Math.imul(ie,et),T=Math.imul(ie,it),T=T+Math.imul(pe,et)|0,L=Math.imul(pe,it),j=j+Math.imul(Y,pt)|0,T=T+Math.imul(Y,tr)|0,T=T+Math.imul(F,pt)|0,L=L+Math.imul(F,tr)|0,j=j+Math.imul(Ne,At)|0,T=T+Math.imul(Ne,mt)|0,T=T+Math.imul(Oe,At)|0,L=L+Math.imul(Oe,mt)|0,j=j+Math.imul(He,dt)|0,T=T+Math.imul(He,Nt)|0,T=T+Math.imul(Ve,dt)|0,L=L+Math.imul(Ve,Nt)|0,j=j+Math.imul(Ye,gt)|0,T=T+Math.imul(Ye,Vt)|0,T=T+Math.imul(lt,gt)|0,L=L+Math.imul(lt,Vt)|0,j=j+Math.imul(Ce,ot)|0,T=T+Math.imul(Ce,Gt)|0,T=T+Math.imul(Fe,ot)|0,L=L+Math.imul(Fe,Gt)|0,j=j+Math.imul(J,yt)|0,T=T+Math.imul(J,Qe)|0,T=T+Math.imul(me,yt)|0,L=L+Math.imul(me,Qe)|0,j=j+Math.imul(re,_t)|0,T=T+Math.imul(re,Zt)|0,T=T+Math.imul(W,_t)|0,L=L+Math.imul(W,Zt)|0,j=j+Math.imul(ee,qt)|0,T=T+Math.imul(ee,Ar)|0,T=T+Math.imul(Z,qt)|0,L=L+Math.imul(Z,Ar)|0;var tt=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(tt>>>26)|0,tt&=67108863,j=Math.imul(ie,pt),T=Math.imul(ie,tr),T=T+Math.imul(pe,pt)|0,L=Math.imul(pe,tr),j=j+Math.imul(Y,At)|0,T=T+Math.imul(Y,mt)|0,T=T+Math.imul(F,At)|0,L=L+Math.imul(F,mt)|0,j=j+Math.imul(Ne,dt)|0,T=T+Math.imul(Ne,Nt)|0,T=T+Math.imul(Oe,dt)|0,L=L+Math.imul(Oe,Nt)|0,j=j+Math.imul(He,gt)|0,T=T+Math.imul(He,Vt)|0,T=T+Math.imul(Ve,gt)|0,L=L+Math.imul(Ve,Vt)|0,j=j+Math.imul(Ye,ot)|0,T=T+Math.imul(Ye,Gt)|0,T=T+Math.imul(lt,ot)|0,L=L+Math.imul(lt,Gt)|0,j=j+Math.imul(Ce,yt)|0,T=T+Math.imul(Ce,Qe)|0,T=T+Math.imul(Fe,yt)|0,L=L+Math.imul(Fe,Qe)|0,j=j+Math.imul(J,_t)|0,T=T+Math.imul(J,Zt)|0,T=T+Math.imul(me,_t)|0,L=L+Math.imul(me,Zt)|0,j=j+Math.imul(re,qt)|0,T=T+Math.imul(re,Ar)|0,T=T+Math.imul(W,qt)|0,L=L+Math.imul(W,Ar)|0;var wt=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(wt>>>26)|0,wt&=67108863,j=Math.imul(ie,At),T=Math.imul(ie,mt),T=T+Math.imul(pe,At)|0,L=Math.imul(pe,mt),j=j+Math.imul(Y,dt)|0,T=T+Math.imul(Y,Nt)|0,T=T+Math.imul(F,dt)|0,L=L+Math.imul(F,Nt)|0,j=j+Math.imul(Ne,gt)|0,T=T+Math.imul(Ne,Vt)|0,T=T+Math.imul(Oe,gt)|0,L=L+Math.imul(Oe,Vt)|0,j=j+Math.imul(He,ot)|0,T=T+Math.imul(He,Gt)|0,T=T+Math.imul(Ve,ot)|0,L=L+Math.imul(Ve,Gt)|0,j=j+Math.imul(Ye,yt)|0,T=T+Math.imul(Ye,Qe)|0,T=T+Math.imul(lt,yt)|0,L=L+Math.imul(lt,Qe)|0,j=j+Math.imul(Ce,_t)|0,T=T+Math.imul(Ce,Zt)|0,T=T+Math.imul(Fe,_t)|0,L=L+Math.imul(Fe,Zt)|0,j=j+Math.imul(J,qt)|0,T=T+Math.imul(J,Ar)|0,T=T+Math.imul(me,qt)|0,L=L+Math.imul(me,Ar)|0;var Pt=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,j=Math.imul(ie,dt),T=Math.imul(ie,Nt),T=T+Math.imul(pe,dt)|0,L=Math.imul(pe,Nt),j=j+Math.imul(Y,gt)|0,T=T+Math.imul(Y,Vt)|0,T=T+Math.imul(F,gt)|0,L=L+Math.imul(F,Vt)|0,j=j+Math.imul(Ne,ot)|0,T=T+Math.imul(Ne,Gt)|0,T=T+Math.imul(Oe,ot)|0,L=L+Math.imul(Oe,Gt)|0,j=j+Math.imul(He,yt)|0,T=T+Math.imul(He,Qe)|0,T=T+Math.imul(Ve,yt)|0,L=L+Math.imul(Ve,Qe)|0,j=j+Math.imul(Ye,_t)|0,T=T+Math.imul(Ye,Zt)|0,T=T+Math.imul(lt,_t)|0,L=L+Math.imul(lt,Zt)|0,j=j+Math.imul(Ce,qt)|0,T=T+Math.imul(Ce,Ar)|0,T=T+Math.imul(Fe,qt)|0,L=L+Math.imul(Fe,Ar)|0;var Et=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(Et>>>26)|0,Et&=67108863,j=Math.imul(ie,gt),T=Math.imul(ie,Vt),T=T+Math.imul(pe,gt)|0,L=Math.imul(pe,Vt),j=j+Math.imul(Y,ot)|0,T=T+Math.imul(Y,Gt)|0,T=T+Math.imul(F,ot)|0,L=L+Math.imul(F,Gt)|0,j=j+Math.imul(Ne,yt)|0,T=T+Math.imul(Ne,Qe)|0,T=T+Math.imul(Oe,yt)|0,L=L+Math.imul(Oe,Qe)|0,j=j+Math.imul(He,_t)|0,T=T+Math.imul(He,Zt)|0,T=T+Math.imul(Ve,_t)|0,L=L+Math.imul(Ve,Zt)|0,j=j+Math.imul(Ye,qt)|0,T=T+Math.imul(Ye,Ar)|0,T=T+Math.imul(lt,qt)|0,L=L+Math.imul(lt,Ar)|0;var ir=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(ir>>>26)|0,ir&=67108863,j=Math.imul(ie,ot),T=Math.imul(ie,Gt),T=T+Math.imul(pe,ot)|0,L=Math.imul(pe,Gt),j=j+Math.imul(Y,yt)|0,T=T+Math.imul(Y,Qe)|0,T=T+Math.imul(F,yt)|0,L=L+Math.imul(F,Qe)|0,j=j+Math.imul(Ne,_t)|0,T=T+Math.imul(Ne,Zt)|0,T=T+Math.imul(Oe,_t)|0,L=L+Math.imul(Oe,Zt)|0,j=j+Math.imul(He,qt)|0,T=T+Math.imul(He,Ar)|0,T=T+Math.imul(Ve,qt)|0,L=L+Math.imul(Ve,Ar)|0;var Qt=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,j=Math.imul(ie,yt),T=Math.imul(ie,Qe),T=T+Math.imul(pe,yt)|0,L=Math.imul(pe,Qe),j=j+Math.imul(Y,_t)|0,T=T+Math.imul(Y,Zt)|0,T=T+Math.imul(F,_t)|0,L=L+Math.imul(F,Zt)|0,j=j+Math.imul(Ne,qt)|0,T=T+Math.imul(Ne,Ar)|0,T=T+Math.imul(Oe,qt)|0,L=L+Math.imul(Oe,Ar)|0;var rn=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(rn>>>26)|0,rn&=67108863,j=Math.imul(ie,_t),T=Math.imul(ie,Zt),T=T+Math.imul(pe,_t)|0,L=Math.imul(pe,Zt),j=j+Math.imul(Y,qt)|0,T=T+Math.imul(Y,Ar)|0,T=T+Math.imul(F,qt)|0,L=L+Math.imul(F,Ar)|0;var Mr=(O+j|0)+((T&8191)<<13)|0;O=(L+(T>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,j=Math.imul(ie,qt),T=Math.imul(ie,Ar),T=T+Math.imul(pe,qt)|0,L=Math.imul(pe,Ar);var ln=(O+j|0)+((T&8191)<<13)|0;return O=(L+(T>>>13)|0)+(ln>>>26)|0,ln&=67108863,D[0]=cr,D[1]=br,D[2]=Q,D[3]=se,D[4]=de,D[5]=ue,D[6]=we,D[7]=Re,D[8]=qe,D[9]=Be,D[10]=tt,D[11]=wt,D[12]=Pt,D[13]=Et,D[14]=ir,D[15]=Qt,D[16]=rn,D[17]=Mr,D[18]=ln,O!==0&&(D[19]=O,b.length++),b};Math.imul||(w=m);function E(K,N,k){k.negative=N.negative^K.negative,k.length=K.length+N.length;for(var b=0,x=0,P=0;P>>26)|0,x+=D>>>26,D&=67108863}k.words[P]=O,b=D,D=x}return b!==0?k.words[P]=b:k.length--,k.strip()}function v(K,N,k){var b=new _;return b.mulp(K,N,k)}s.prototype.mulTo=function(N,k){var b,x=this.length+N.length;return this.length===10&&N.length===10?b=w(this,N,k):x<63?b=m(this,N,k):x<1024?b=E(this,N,k):b=v(this,N,k),b};function _(K,N){this.x=K,this.y=N}_.prototype.makeRBT=function(N){for(var k=new Array(N),b=s.prototype._countBits(N)-1,x=0;x>=1;return x},_.prototype.permute=function(N,k,b,x,P,D){for(var O=0;O>>1)P++;return 1<>>13,b[2*D+1]=P&8191,P=P>>>13;for(D=2*k;D>=26,k+=x/67108864|0,k+=P>>>26,this.words[b]=P&67108863}return k!==0&&(this.words[b]=k,this.length++),this},s.prototype.muln=function(N){return this.clone().imuln(N)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(N){var k=g(N);if(k.length===0)return new s(1);for(var b=this,x=0;x=0);var k=N%26,b=(N-k)/26,x=67108863>>>26-k<<26-k,P;if(k!==0){var D=0;for(P=0;P>>26-k}D&&(this.words[P]=D,this.length++)}if(b!==0){for(P=this.length-1;P>=0;P--)this.words[P+b]=this.words[P];for(P=0;P=0);var x;k?x=(k-k%26)/26:x=0;var P=N%26,D=Math.min((N-P)/26,this.length),O=67108863^67108863>>>P<D)for(this.length-=D,T=0;T=0&&(L!==0||T>=x);T--){var M=this.words[T]|0;this.words[T]=L<<26-P|M>>>P,L=M&O}return j&&L!==0&&(j.words[j.length++]=L),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(N,k,b){return n(this.negative===0),this.iushrn(N,k,b)},s.prototype.shln=function(N){return this.clone().ishln(N)},s.prototype.ushln=function(N){return this.clone().iushln(N)},s.prototype.shrn=function(N){return this.clone().ishrn(N)},s.prototype.ushrn=function(N){return this.clone().iushrn(N)},s.prototype.testn=function(N){n(typeof N=="number"&&N>=0);var k=N%26,b=(N-k)/26,x=1<=0);var k=N%26,b=(N-k)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(k!==0&&b++,this.length=Math.min(b,this.length),k!==0){var x=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},s.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)-(j/67108864|0),this.words[P+b]=D&67108863}for(;P>26,this.words[P+b]=D&67108863;if(O===0)return this.strip();for(n(O===-1),O=0,P=0;P>26,this.words[P]=D&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(N,k){var b=this.length-N.length,x=this.clone(),P=N,D=P.words[P.length-1]|0,O=this._countBits(D);b=26-O,b!==0&&(P=P.ushln(b),x.iushln(b),D=P.words[P.length-1]|0);var j=x.length-P.length,T;if(k!=="mod"){T=new s(null),T.length=j+1,T.words=new Array(T.length);for(var L=0;L=0;X--){var le=(x.words[P.length+X]|0)*67108864+(x.words[P.length+X-1]|0);for(le=Math.min(le/D|0,67108863),x._ishlnsubmul(P,le,X);x.negative!==0;)le--,x.negative=0,x._ishlnsubmul(P,1,X),x.isZero()||(x.negative^=1);T&&(T.words[X]=le)}return T&&T.strip(),x.strip(),k!=="div"&&b!==0&&x.iushrn(b),{div:T||null,mod:x}},s.prototype.divmod=function(N,k,b){if(n(!N.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var x,P,D;return this.negative!==0&&N.negative===0?(D=this.neg().divmod(N,k),k!=="mod"&&(x=D.div.neg()),k!=="div"&&(P=D.mod.neg(),b&&P.negative!==0&&P.iadd(N)),{div:x,mod:P}):this.negative===0&&N.negative!==0?(D=this.divmod(N.neg(),k),k!=="mod"&&(x=D.div.neg()),{div:x,mod:D.mod}):this.negative&N.negative?(D=this.neg().divmod(N.neg(),k),k!=="div"&&(P=D.mod.neg(),b&&P.negative!==0&&P.isub(N)),{div:D.div,mod:P}):N.length>this.length||this.cmp(N)<0?{div:new s(0),mod:this}:N.length===1?k==="div"?{div:this.divn(N.words[0]),mod:null}:k==="mod"?{div:null,mod:new s(this.modn(N.words[0]))}:{div:this.divn(N.words[0]),mod:new s(this.modn(N.words[0]))}:this._wordDiv(N,k)},s.prototype.div=function(N){return this.divmod(N,"div",!1).div},s.prototype.mod=function(N){return this.divmod(N,"mod",!1).mod},s.prototype.umod=function(N){return this.divmod(N,"mod",!0).mod},s.prototype.divRound=function(N){var k=this.divmod(N);if(k.mod.isZero())return k.div;var b=k.div.negative!==0?k.mod.isub(N):k.mod,x=N.ushrn(1),P=N.andln(1),D=b.cmp(x);return D<0||P===1&&D===0?k.div:k.div.negative!==0?k.div.isubn(1):k.div.iaddn(1)},s.prototype.modn=function(N){n(N<=67108863);for(var k=(1<<26)%N,b=0,x=this.length-1;x>=0;x--)b=(k*b+(this.words[x]|0))%N;return b},s.prototype.idivn=function(N){n(N<=67108863);for(var k=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+k*67108864;this.words[b]=x/N|0,k=x%N}return this.strip()},s.prototype.divn=function(N){return this.clone().idivn(N)},s.prototype.egcd=function(N){n(N.negative===0),n(!N.isZero());var k=this,b=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var x=new s(1),P=new s(0),D=new s(0),O=new s(1),j=0;k.isEven()&&b.isEven();)k.iushrn(1),b.iushrn(1),++j;for(var T=b.clone(),L=k.clone();!k.isZero();){for(var M=0,X=1;!(k.words[0]&X)&&M<26;++M,X<<=1);if(M>0)for(k.iushrn(M);M-- >0;)(x.isOdd()||P.isOdd())&&(x.iadd(T),P.isub(L)),x.iushrn(1),P.iushrn(1);for(var le=0,H=1;!(b.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(b.iushrn(le);le-- >0;)(D.isOdd()||O.isOdd())&&(D.iadd(T),O.isub(L)),D.iushrn(1),O.iushrn(1);k.cmp(b)>=0?(k.isub(b),x.isub(D),P.isub(O)):(b.isub(k),D.isub(x),O.isub(P))}return{a:D,b:O,gcd:b.iushln(j)}},s.prototype._invmp=function(N){n(N.negative===0),n(!N.isZero());var k=this,b=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var x=new s(1),P=new s(0),D=b.clone();k.cmpn(1)>0&&b.cmpn(1)>0;){for(var O=0,j=1;!(k.words[0]&j)&&O<26;++O,j<<=1);if(O>0)for(k.iushrn(O);O-- >0;)x.isOdd()&&x.iadd(D),x.iushrn(1);for(var T=0,L=1;!(b.words[0]&L)&&T<26;++T,L<<=1);if(T>0)for(b.iushrn(T);T-- >0;)P.isOdd()&&P.iadd(D),P.iushrn(1);k.cmp(b)>=0?(k.isub(b),x.isub(P)):(b.isub(k),P.isub(x))}var M;return k.cmpn(1)===0?M=x:M=P,M.cmpn(0)<0&&M.iadd(N),M},s.prototype.gcd=function(N){if(this.isZero())return N.abs();if(N.isZero())return this.abs();var k=this.clone(),b=N.clone();k.negative=0,b.negative=0;for(var x=0;k.isEven()&&b.isEven();x++)k.iushrn(1),b.iushrn(1);do{for(;k.isEven();)k.iushrn(1);for(;b.isEven();)b.iushrn(1);var P=k.cmp(b);if(P<0){var D=k;k=b,b=D}else if(P===0||b.cmpn(1)===0)break;k.isub(b)}while(!0);return b.iushln(x)},s.prototype.invm=function(N){return this.egcd(N).a.umod(N)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(N){return this.words[0]&N},s.prototype.bincn=function(N){n(typeof N=="number");var k=N%26,b=(N-k)/26,x=1<>>26,O&=67108863,this.words[D]=O}return P!==0&&(this.words[D]=P,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.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 b;if(this.length>1)b=1;else{k&&(N=-N),n(N<=67108863,"Number is too big");var x=this.words[0]|0;b=x===N?0:xN.length)return 1;if(this.length=0;b--){var x=this.words[b]|0,P=N.words[b]|0;if(x!==P){xP&&(k=1);break}}return k},s.prototype.gtn=function(N){return this.cmpn(N)===1},s.prototype.gt=function(N){return this.cmp(N)===1},s.prototype.gten=function(N){return this.cmpn(N)>=0},s.prototype.gte=function(N){return this.cmp(N)>=0},s.prototype.ltn=function(N){return this.cmpn(N)===-1},s.prototype.lt=function(N){return this.cmp(N)===-1},s.prototype.lten=function(N){return this.cmpn(N)<=0},s.prototype.lte=function(N){return this.cmp(N)<=0},s.prototype.eqn=function(N){return this.cmpn(N)===0},s.prototype.eq=function(N){return this.cmp(N)===0},s.red=function(N){return new G(N)},s.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)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(N){return this.red=N,this},s.prototype.forceRed=function(N){return n(!this.red,"Already a number in reduction context"),this._forceRed(N)},s.prototype.redAdd=function(N){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,N)},s.prototype.redIAdd=function(N){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,N)},s.prototype.redSub=function(N){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,N)},s.prototype.redISub=function(N){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,N)},s.prototype.redShl=function(N){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,N)},s.prototype.redMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.mul(this,N)},s.prototype.redIMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.imul(this,N)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.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 C(K,N){this.name=K,this.p=new s(N,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}C.prototype._tmp=function(){var N=new s(null);return N.words=new Array(Math.ceil(this.n/13)),N},C.prototype.ireduce=function(N){var k=N,b;do this.split(k,this.tmp),k=this.imulK(k),k=k.iadd(this.tmp),b=k.bitLength();while(b>this.n);var x=b0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},C.prototype.split=function(N,k){N.iushrn(this.n,0,k)},C.prototype.imulK=function(N){return N.imul(this.k)};function R(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(R,C),R.prototype.split=function(N,k){for(var b=4194303,x=Math.min(N.length,9),P=0;P>>22,D=O}D>>>=22,N.words[P-10]=D,D===0&&N.length>10?N.length-=10:N.length-=9},R.prototype.imulK=function(N){N.words[N.length]=0,N.words[N.length+1]=0,N.length+=2;for(var k=0,b=0;b>>=26,N.words[b]=P,k=x}return k!==0&&(N.words[N.length++]=k),N},s._prime=function(N){if(A[N])return A[N];var k;if(N==="k256")k=new R;else if(N==="p224")k=new B;else if(N==="p192")k=new S;else if(N==="p25519")k=new U;else throw new Error("Unknown prime "+N);return A[N]=k,k};function G(K){if(typeof K=="string"){var N=s._prime(K);this.m=N.p,this.prime=N}else n(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}G.prototype._verify1=function(N){n(N.negative===0,"red works only with positives"),n(N.red,"red works only with red numbers")},G.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")},G.prototype.imod=function(N){return this.prime?this.prime.ireduce(N)._forceRed(this):N.umod(this.m)._forceRed(this)},G.prototype.neg=function(N){return N.isZero()?N.clone():this.m.sub(N)._forceRed(this)},G.prototype.add=function(N,k){this._verify2(N,k);var b=N.add(k);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},G.prototype.iadd=function(N,k){this._verify2(N,k);var b=N.iadd(k);return b.cmp(this.m)>=0&&b.isub(this.m),b},G.prototype.sub=function(N,k){this._verify2(N,k);var b=N.sub(k);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},G.prototype.isub=function(N,k){this._verify2(N,k);var b=N.isub(k);return b.cmpn(0)<0&&b.iadd(this.m),b},G.prototype.shl=function(N,k){return this._verify1(N),this.imod(N.ushln(k))},G.prototype.imul=function(N,k){return this._verify2(N,k),this.imod(N.imul(k))},G.prototype.mul=function(N,k){return this._verify2(N,k),this.imod(N.mul(k))},G.prototype.isqr=function(N){return this.imul(N,N.clone())},G.prototype.sqr=function(N){return this.mul(N,N)},G.prototype.sqrt=function(N){if(N.isZero())return N.clone();var k=this.m.andln(3);if(n(k%2===1),k===3){var b=this.m.add(new s(1)).iushrn(2);return this.pow(N,b)}for(var x=this.m.subn(1),P=0;!x.isZero()&&x.andln(1)===0;)P++,x.iushrn(1);n(!x.isZero());var D=new s(1).toRed(this),O=D.redNeg(),j=this.m.subn(1).iushrn(1),T=this.m.bitLength();for(T=new s(2*T*T).toRed(this);this.pow(T,j).cmp(O)!==0;)T.redIAdd(O);for(var L=this.pow(T,x),M=this.pow(N,x.addn(1).iushrn(1)),X=this.pow(N,x),le=P;X.cmp(D)!==0;){for(var H=X,ee=0;H.cmp(D)!==0;ee++)H=H.redSqr();n(ee=0;P--){for(var L=k.words[P],M=T-1;M>=0;M--){var X=L>>M&1;if(D!==x[0]&&(D=this.sqr(D)),X===0&&O===0){j=0;continue}O<<=1,O|=X,j++,!(j!==b&&(P!==0||M!==0))&&(D=this.mul(D,x[O]),j=0,O=0)}T=26}return D},G.prototype.convertTo=function(N){var k=N.umod(this.m);return k===N?k.clone():k},G.prototype.convertFrom=function(N){var k=N.clone();return k.red=null,k},s.mont=function(N){return new ae(N)};function ae(K){G.call(this,K),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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(ae,G),ae.prototype.convertTo=function(N){return this.imod(N.ushln(this.shift))},ae.prototype.convertFrom=function(N){var k=this.imod(N.mul(this.rinv));return k.red=null,k},ae.prototype.imul=function(N,k){if(N.isZero()||k.isZero())return N.words[0]=0,N.length=1,N;var b=N.imul(k),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=b.isub(x).iushrn(this.shift),D=P;return P.cmp(this.m)>=0?D=P.isub(this.m):P.cmpn(0)<0&&(D=P.iadd(this.m)),D._forceRed(this)},ae.prototype.mul=function(N,k){if(N.isZero()||k.isZero())return new s(0)._forceRed(this);var b=N.mul(k),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=b.isub(x).iushrn(this.shift),D=P;return P.cmp(this.m)>=0?D=P.isub(this.m):P.cmpn(0)<0&&(D=P.iadd(this.m)),D._forceRed(this)},ae.prototype.invm=function(N){var k=this.imod(N._invmp(this.m).mul(this.r2));return k._forceRed(this)}})(t,Xt)})(MN);var Od=MN.exports,ON={};(function(t){var e=t;function r(s,a){if(Array.isArray(s))return s.slice();if(!s)return[];var o=[];if(typeof s!="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(s){return s.length===1?"0"+s:s}e.zero2=n;function i(s){for(var a="",o=0;o(w>>1)-1?v=(w>>1)-_:v=_,E.isubn(v)):v=0,g[m]=v,E.iushrn(1)}return g}e.getNAF=s;function a(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 E=u.andln(3)+g&3,v=f.andln(3)+m&3;E===3&&(E=-1),v===3&&(v=-1);var _;E&1?(w=u.andln(7)+g&7,(w===3||w===5)&&v===2?_=-E:_=E):_=0,h[0].push(_);var A;v&1?(w=f.andln(7)+m&7,(w===3||w===5)&&E===2?A=-v:A=v):A=0,h[1].push(A),2*g===_+1&&(g=1-g),2*m===A+1&&(m=1-m),u.iushrn(1),f.iushrn(1)}return h}e.getJSF=a;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})(So);var jN={exports:{}},YE;jN.exports=function(e){return YE||(YE=new yf(null)),YE.generate(e)};function yf(t){this.rand=t}jN.exports.Rand=yf;yf.prototype.generate=function(e){return this._rand(e)};yf.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 j_=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){r6(e.precomputed);var n=e._getDoubles(),i=t6(r,1,this._bitLength),s=(1<=o;c--)l=(l<<1)+i[c];a.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=s;h>0;h--){for(o=0;o=0;l--){for(var c=0;l>=0&&a[l]===0;l--)c++;if(l>=0&&c++,o=o.dblp(c),l<0)break;var u=a[l];r6(u!==0),e.type==="affine"?u>0?o=o.mixedAdd(s[u-1>>1]):o=o.mixedAdd(s[-u-1>>1].neg()):u>0?o=o.add(s[u-1>>1]):o=o.add(s[-u-1>>1].neg())}return e.type==="affine"?o.toP():o};lh.prototype._wnafMulAdd=function(e,r,n,i,s){var a=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(a[m]!==1||a[w]!==1){l[m]=t6(n[m],a[m],this._bitLength),l[w]=t6(n[w],a[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var E=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(E[1]=r[m].add(r[w]),E[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(E[1]=r[m].toJ().mixedAdd(r[w]),E[2]=r[m].add(r[w].neg())):(E[1]=r[m].toJ().mixedAdd(r[w]),E[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],_=pLe(n[m],n[w]);for(c=Math.max(_[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var S=0;u>=0;){var U=!0;for(f=0;f=0&&S++,R=R.dblp(S),u<0)break;for(f=0;f0?h=o[f][G-1>>1]:G<0&&(h=o[f][-G-1>>1].neg()),h.type==="affine"?R=R.mixedAdd(h):R=R.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};ul.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=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}]};dl.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=s.mul(n.a),l=a.mul(i.a),c=s.mul(n.b),u=a.mul(i.b),f=e.sub(o).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};dl.prototype.pointFromX=function(e,r){e=new ti(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 s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};dl.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};dl.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a":""};ns.prototype.isInfinity=function(){return this.inf};ns.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)};ns.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(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),o=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)};ns.prototype.getX=function(){return this.x.fromRed()};ns.prototype.getY=function(){return this.y.fromRed()};ns.prototype.mul=function(e){return e=new ti(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)};ns.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};ns.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};ns.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)};ns.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(s){return s.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};ns.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 ps(t,e,r,n){rm.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ti(0)):(this.x=new ti(e,16),this.y=new ti(r,16),this.z=new ti(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}DN(ps,rm.BasePoint);dl.prototype.jpoint=function(e,r,n){return new ps(this,e,r,n)};ps.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)};ps.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ps.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),s=e.x.redMul(n),a=this.y.redMul(r.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),l=i.redSub(s),c=a.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(a.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};ps.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),s=this.y,a=e.y.redMul(r).redMul(this.z),o=n.redSub(i),l=s.redSub(a);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(s.redMul(u)),m=this.z.redMul(o);return this.curve.jpoint(h,g,m)};ps.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(s),this.x.cmp(n)===0)return!0}};ps.prototype.inspect=function(){return this.isInfinity()?"":""};ps.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var A1=Od,wte=ia,L_=j_,vLe=So;function nm(t){L_.call(this,"mont",t),this.a=new A1(t.a,16).toRed(this.red),this.b=new A1(t.b,16).toRed(this.red),this.i4=new A1(4).toRed(this.red).redInvm(),this.two=new A1(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}wte(nm,L_);var wLe=nm;nm.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),s=i.redSqrt();return s.redSqr().cmp(i)===0};function ts(t,e,r){L_.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new A1(e,16),this.z=new A1(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}wte(ts,L_.BasePoint);nm.prototype.decodePoint=function(e,r){return this.point(vLe.toArray(e,r),1)};nm.prototype.point=function(e,r){return new ts(this,e,r)};nm.prototype.pointFromJSON=function(e){return ts.fromJSON(this,e)};ts.prototype.precompute=function(){};ts.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};ts.fromJSON=function(e,r){return new ts(e,r[0],r[1]||e.one)};ts.prototype.inspect=function(){return this.isInfinity()?"":""};ts.prototype.isInfinity=function(){return this.z.cmpn(0)===0};ts.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=r.redSub(i),a=r.redMul(i),o=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(a,o)};ts.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};ts.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),a=e.x.redSub(e.z),o=a.redMul(n),l=s.redMul(i),c=r.z.redMul(o.redAdd(l).redSqr()),u=r.x.redMul(o.redISub(l).redSqr());return this.curve.point(c,u)};ts.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),s=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var o=a.length-1;o>=0;o--)a[o]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i};ts.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};ts.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};ts.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};ts.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};ts.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var bLe=So,sd=Od,bte=ia,D_=j_,_Le=bLe.assert;function gu(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,D_.call(this,"edwards",t),this.a=new sd(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new sd(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new sd(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),_Le(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}bte(gu,D_);var xLe=gu;gu.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};gu.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};gu.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};gu.prototype.pointFromX=function(e,r){e=new sd(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(s.redInvm()),o=a.redSqrt();if(o.redSqr().redSub(a).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)};gu.prototype.pointFromY=function(e,r){e=new sd(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(s.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(o.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return o.fromRed().isOdd()!==r&&(o=o.redNeg()),this.point(o,e)};gu.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),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(s)===0};function In(t,e,r,n,i){D_.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 sd(e,16),this.y=new sd(r,16),this.z=n?new sd(n,16):this.curve.one,this.t=i&&new sd(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()))))}bte(In,D_.BasePoint);gu.prototype.pointFromJSON=function(e){return In.fromJSON(this,e)};gu.prototype.point=function(e,r,n,i){return new In(this,e,r,n,i)};In.fromJSON=function(e,r){return new In(e,r[0],r[1],r[2])};In.prototype.inspect=function(){return this.isInfinity()?"":""};In.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};In.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),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),a=i.redAdd(r),o=a.redSub(n),l=i.redSub(r),c=s.redMul(o),u=a.redMul(l),f=s.redMul(l),h=o.redMul(a);return this.curve.point(c,u,h,f)};In.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,s,a,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)),s=u.redMul(o.redSub(n)),a=u.redSqr().redSub(u).redSub(u)):(l=this.z.redSqr(),c=u.redSub(l).redISub(l),i=e.redSub(r).redISub(n).redMul(c),s=u.redMul(o.redSub(n)),a=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),s=this.curve._mulC(o).redMul(r.redISub(n)),a=o.redMul(c);return this.curve.point(i,s,a)};In.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};In.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),s=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(r),o=s.redSub(i),l=s.redAdd(i),c=n.redAdd(r),u=a.redMul(o),f=l.redMul(c),h=a.redMul(c),g=o.redMul(l);return this.curve.point(u,f,g,h)};In.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(i).redMul(s),o=n.redSub(a),l=n.redAdd(a),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),u=r.redMul(o).redMul(c),f,h;return this.curve.twisted?(f=r.redMul(l).redMul(s.redSub(this.curve._mulA(i))),h=o.redMul(l)):(f=r.redMul(l).redMul(s.redSub(i)),h=this.curve._mulC(o).redMul(l)),this.curve.point(u,f,h)};In.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};In.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};In.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};In.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};In.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};In.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};In.prototype.getX=function(){return this.normalize(),this.x.fromRed()};In.prototype.getY=function(){return this.normalize(),this.y.fromRed()};In.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};In.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}};In.prototype.toP=In.prototype.normalize;In.prototype.mixedAdd=In.prototype.add;(function(t){var e=t;e.base=j_,e.short=yLe,e.mont=wLe,e.edwards=xLe})(LN);var F_={},ZE,BU;function ELe(){return BU||(BU=1,ZE={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"]]}}),ZE}(function(t){var e=t,r=$v,n=LN,i=So,s=i.assert;function a(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,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=a;function o(c,u){Object.defineProperty(e,c,{configurable:!0,enumerable:!0,get:function(){var f=new a(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=ELe()}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]})})(F_);var CLe=$v,c0=ON,_te=q0;function Hf(t){if(!(this instanceof Hf))return new Hf(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=c0.toArray(t.entropy,t.entropyEnc||"hex"),r=c0.toArray(t.nonce,t.nonceEnc||"hex"),n=c0.toArray(t.pers,t.persEnc||"hex");_te(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var ALe=Hf;Hf.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 s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Hf.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=c0.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var n6=Od,FN=So,$Le=FN.assert;function U_(t,e){if(t instanceof U_)return t;this._importDER(t,e)||($Le(t.r&&t.s,"Signature without r or s"),this.r=new n6(t.r,16),this.s=new n6(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var kLe=U_;function NLe(){this.place=0}function JE(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,s=0,a=e.place;s>>=0;return i<=127?!1:(e.place=a,i)}function WU(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)}U_.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=WU(r),n=WU(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];QE(i,r.length),i=i.concat(r),i.push(2),QE(i,n.length);var s=i.concat(n),a=[48];return QE(a,s.length),a=a.concat(s),FN.encode(a,e)};var Ul=Od,xte=ALe,PLe=So,XE=F_,RLe=vte,Wh=PLe.assert,UN=TLe,B_=kLe;function il(t){if(!(this instanceof il))return new il(t);typeof t=="string"&&(Wh(Object.prototype.hasOwnProperty.call(XE,t),"Unknown curve "+t),t=XE[t]),t instanceof XE.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 MLe=il;il.prototype.keyPair=function(e){return new UN(this,e)};il.prototype.keyFromPrivate=function(e,r){return UN.fromPrivate(this,e,r)};il.prototype.keyFromPublic=function(e,r){return UN.fromPublic(this,e,r)};il.prototype.genKeyPair=function(e){e||(e={});for(var r=new xte({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||RLe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Ul(2));;){var s=new Ul(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};il.prototype._truncateToN=function(e,r,n){var i;if(Ul.isBN(e)||typeof e=="number")e=new Ul(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new Ul(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new Ul(s,16)}typeof n!="number"&&(n=i*8);var a=n-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};il.prototype.sign=function(e,r,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!Ul.isBN(e)){Wh(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),Wh(e.length>>>0===e.length);for(var s=0;s=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 E=h.invm(this.n).mul(w.mul(r.getPrivate()).iadd(e));if(E=E.umod(this.n),E.cmpn(0)!==0){var v=(g.getY().isOdd()?1:0)|(m.cmp(w)!==0?2:0);return i.canonical&&E.cmp(this.nh)>0&&(E=this.n.sub(E),v^=1),new B_({r:w,s:E,recoveryParam:v})}}}}}};il.prototype.verify=function(e,r,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),r=new B_(r,"hex");var a=r.r,o=r.s;if(a.cmpn(1)<0||a.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(a).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(a)):(f=this.g.mulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(a)===0)};il.prototype.recoverPubKey=function(t,e,r,n){Wh((3&r)===r,"The recovery param is more than two bits"),e=new B_(e,n);var i=this.n,s=new Ul(t),a=e.r,o=e.s,l=r&1,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?a=this.curve.pointFromX(a.add(this.curve.n),l):a=this.curve.pointFromX(a,l);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(f,a,h)};il.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new B_(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var mw=So,Ete=mw.assert,zU=mw.parseBytes,im=mw.cachedProperty;function Qi(t,e){this.eddsa=t,this._secret=zU(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=zU(e.pub)}Qi.fromPublic=function(e,r){return r instanceof Qi?r:new Qi(e,{pub:r})};Qi.fromSecret=function(e,r){return r instanceof Qi?r:new Qi(e,{secret:r})};Qi.prototype.secret=function(){return this._secret};im(Qi,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});im(Qi,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});im(Qi,"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});im(Qi,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});im(Qi,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});im(Qi,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Qi.prototype.sign=function(e){return Ete(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Qi.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};Qi.prototype.getSecret=function(e){return Ete(this._secret,"KeyPair is public only"),mw.encode(this.secret(),e)};Qi.prototype.getPublic=function(e){return mw.encode(this.pubBytes(),e)};var OLe=Qi,jLe=Od,W_=So,HU=W_.assert,z_=W_.cachedProperty,LLe=W_.parseBytes;function sp(t,e){this.eddsa=t,typeof e!="object"&&(e=LLe(e)),Array.isArray(e)&&(HU(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),HU(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof jLe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}z_(sp,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});z_(sp,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});z_(sp,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});z_(sp,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});sp.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};sp.prototype.toHex=function(){return W_.encode(this.toBytes(),"hex").toUpperCase()};var DLe=sp,FLe=$v,ULe=F_,bg=So,BLe=bg.assert,Cte=bg.parseBytes,Ate=OLe,qU=DLe;function Fa(t){if(BLe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Fa))return new Fa(t);t=ULe[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=FLe.sha512}var WLe=Fa;Fa.prototype.sign=function(e,r){e=Cte(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),a=this.encodePoint(s),o=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),l=i.add(o).umod(this.curve.n);return this.makeSignature({R:s,S:l,Rencoded:a})};Fa.prototype.verify=function(e,r,n){if(e=Cte(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),s=this.hashInt(r.Rencoded(),i.pubBytes(),e),a=this.g.mul(r.S()),o=r.R().add(i.pub().mul(s));return o.eq(a)};Fa.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&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=s(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 s(o,l,c,u,f,h,g){for(var m=c[0],w=c[1],E=c[2],v=c[3],_=c[4],A=c[5],C=c[6],R=c[7],B=u[0],S=u[1],U=u[2],G=u[3],ae=u[4],K=u[5],N=u[6],k=u[7],b,x,P,D,O,j,T,L;g>=128;){for(var M=0;M<16;M++){var X=8*M+h;o[M]=e.readUint32BE(f,X),l[M]=e.readUint32BE(f,X+4)}for(var M=0;M<80;M++){var le=m,H=w,ee=E,Z=v,te=_,re=A,W=C,q=R,J=B,me=S,be=U,Ce=G,Fe=ae,Ue=K,Ye=N,lt=k;if(b=R,x=k,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=(_>>>14|ae<<18)^(_>>>18|ae<<14)^(ae>>>9|_<<23),x=(ae>>>14|_<<18)^(ae>>>18|_<<14)^(_>>>9|ae<<23),O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,b=_&A^~_&C,x=ae&K^~ae&N,O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,b=i[M*2],x=i[M*2+1],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,b=o[M%16],x=l[M%16],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,P=T&65535|L<<16,D=O&65535|j<<16,b=P,x=D,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=(m>>>28|B<<4)^(B>>>2|m<<30)^(B>>>7|m<<25),x=(B>>>28|m<<4)^(m>>>2|B<<30)^(m>>>7|B<<25),O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,b=m&w^m&E^w&E,x=B&S^B&U^S&U,O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,q=T&65535|L<<16,lt=O&65535|j<<16,b=Z,x=Ce,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=P,x=D,O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,Z=T&65535|L<<16,Ce=O&65535|j<<16,w=le,E=H,v=ee,_=Z,A=te,C=re,R=W,m=q,S=J,U=me,G=be,ae=Ce,K=Fe,N=Ue,k=Ye,B=lt,M%16===15)for(var X=0;X<16;X++)b=o[X],x=l[X],O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=o[(X+9)%16],x=l[(X+9)%16],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,P=o[(X+1)%16],D=l[(X+1)%16],b=(P>>>1|D<<31)^(P>>>8|D<<24)^P>>>7,x=(D>>>1|P<<31)^(D>>>8|P<<24)^(D>>>7|P<<25),O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,P=o[(X+14)%16],D=l[(X+14)%16],b=(P>>>19|D<<13)^(D>>>29|P<<3)^P>>>6,x=(D>>>19|P<<13)^(P>>>29|D<<3)^(D>>>6|P<<26),O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,o[X]=T&65535|L<<16,l[X]=O&65535|j<<16}b=m,x=B,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=c[0],x=u[0],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,c[0]=m=T&65535|L<<16,u[0]=B=O&65535|j<<16,b=w,x=S,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=c[1],x=u[1],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,c[1]=w=T&65535|L<<16,u[1]=S=O&65535|j<<16,b=E,x=U,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=c[2],x=u[2],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,c[2]=E=T&65535|L<<16,u[2]=U=O&65535|j<<16,b=v,x=G,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=c[3],x=u[3],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,c[3]=v=T&65535|L<<16,u[3]=G=O&65535|j<<16,b=_,x=ae,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=c[4],x=u[4],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,c[4]=_=T&65535|L<<16,u[4]=ae=O&65535|j<<16,b=A,x=K,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=c[5],x=u[5],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,c[5]=A=T&65535|L<<16,u[5]=K=O&65535|j<<16,b=C,x=N,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=c[6],x=u[6],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,c[6]=C=T&65535|L<<16,u[6]=N=O&65535|j<<16,b=R,x=k,O=x&65535,j=x>>>16,T=b&65535,L=b>>>16,b=c[7],x=u[7],O+=x&65535,j+=x>>>16,T+=b&65535,L+=b>>>16,j+=O>>>16,T+=j>>>16,L+=T>>>16,c[7]=R=T&65535|L<<16,u[7]=k=O&65535|j<<16,h+=128,g-=128}return h}function a(o){var l=new n;l.update(o);var c=l.digest();return l.clean(),c}t.hash=a})(Ste);(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=oh,r=Ste,n=Ao;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(Z){const te=new Float64Array(16);if(Z)for(let re=0;re>16&1),re[me-1]&=65535;re[15]=W[15]-32767-(re[14]>>16&1);const J=re[15]>>16&1;re[14]&=65535,w(W,re,1-J)}for(let q=0;q<16;q++)Z[2*q]=W[q]&255,Z[2*q+1]=W[q]>>8}function v(Z,te){let re=0;for(let W=0;W<32;W++)re|=Z[W]^te[W];return(1&re-1>>>8)-1}function _(Z,te){const re=new Uint8Array(32),W=new Uint8Array(32);return E(re,Z),E(W,te),v(re,W)}function A(Z){const te=new Uint8Array(32);return E(te,Z),te[0]&1}function C(Z,te){for(let re=0;re<16;re++)Z[re]=te[2*re]+(te[2*re+1]<<8);Z[15]&=32767}function R(Z,te,re){for(let W=0;W<16;W++)Z[W]=te[W]+re[W]}function B(Z,te,re){for(let W=0;W<16;W++)Z[W]=te[W]-re[W]}function S(Z,te,re){let W,q,J=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ye=0,lt=0,xe=0,He=0,Ve=0,Ie=0,Ne=0,Oe=0,Me=0,Y=0,F=0,z=0,ie=0,pe=0,ve=0,he=0,Le=0,Ze=0,et=0,it=0,ut=0,pt=0,tr=0,Wt=0,At=0,mt=re[0],Ct=re[1],dt=re[2],Nt=re[3],jt=re[4],gt=re[5],Vt=re[6],zt=re[7],ot=re[8],Gt=re[9],Ft=re[10],yt=re[11],Qe=re[12],Ot=re[13],_t=re[14],Zt=re[15];W=te[0],J+=W*mt,me+=W*Ct,be+=W*dt,Ce+=W*Nt,Fe+=W*jt,Ue+=W*gt,Ye+=W*Vt,lt+=W*zt,xe+=W*ot,He+=W*Gt,Ve+=W*Ft,Ie+=W*yt,Ne+=W*Qe,Oe+=W*Ot,Me+=W*_t,Y+=W*Zt,W=te[1],me+=W*mt,be+=W*Ct,Ce+=W*dt,Fe+=W*Nt,Ue+=W*jt,Ye+=W*gt,lt+=W*Vt,xe+=W*zt,He+=W*ot,Ve+=W*Gt,Ie+=W*Ft,Ne+=W*yt,Oe+=W*Qe,Me+=W*Ot,Y+=W*_t,F+=W*Zt,W=te[2],be+=W*mt,Ce+=W*Ct,Fe+=W*dt,Ue+=W*Nt,Ye+=W*jt,lt+=W*gt,xe+=W*Vt,He+=W*zt,Ve+=W*ot,Ie+=W*Gt,Ne+=W*Ft,Oe+=W*yt,Me+=W*Qe,Y+=W*Ot,F+=W*_t,z+=W*Zt,W=te[3],Ce+=W*mt,Fe+=W*Ct,Ue+=W*dt,Ye+=W*Nt,lt+=W*jt,xe+=W*gt,He+=W*Vt,Ve+=W*zt,Ie+=W*ot,Ne+=W*Gt,Oe+=W*Ft,Me+=W*yt,Y+=W*Qe,F+=W*Ot,z+=W*_t,ie+=W*Zt,W=te[4],Fe+=W*mt,Ue+=W*Ct,Ye+=W*dt,lt+=W*Nt,xe+=W*jt,He+=W*gt,Ve+=W*Vt,Ie+=W*zt,Ne+=W*ot,Oe+=W*Gt,Me+=W*Ft,Y+=W*yt,F+=W*Qe,z+=W*Ot,ie+=W*_t,pe+=W*Zt,W=te[5],Ue+=W*mt,Ye+=W*Ct,lt+=W*dt,xe+=W*Nt,He+=W*jt,Ve+=W*gt,Ie+=W*Vt,Ne+=W*zt,Oe+=W*ot,Me+=W*Gt,Y+=W*Ft,F+=W*yt,z+=W*Qe,ie+=W*Ot,pe+=W*_t,ve+=W*Zt,W=te[6],Ye+=W*mt,lt+=W*Ct,xe+=W*dt,He+=W*Nt,Ve+=W*jt,Ie+=W*gt,Ne+=W*Vt,Oe+=W*zt,Me+=W*ot,Y+=W*Gt,F+=W*Ft,z+=W*yt,ie+=W*Qe,pe+=W*Ot,ve+=W*_t,he+=W*Zt,W=te[7],lt+=W*mt,xe+=W*Ct,He+=W*dt,Ve+=W*Nt,Ie+=W*jt,Ne+=W*gt,Oe+=W*Vt,Me+=W*zt,Y+=W*ot,F+=W*Gt,z+=W*Ft,ie+=W*yt,pe+=W*Qe,ve+=W*Ot,he+=W*_t,Le+=W*Zt,W=te[8],xe+=W*mt,He+=W*Ct,Ve+=W*dt,Ie+=W*Nt,Ne+=W*jt,Oe+=W*gt,Me+=W*Vt,Y+=W*zt,F+=W*ot,z+=W*Gt,ie+=W*Ft,pe+=W*yt,ve+=W*Qe,he+=W*Ot,Le+=W*_t,Ze+=W*Zt,W=te[9],He+=W*mt,Ve+=W*Ct,Ie+=W*dt,Ne+=W*Nt,Oe+=W*jt,Me+=W*gt,Y+=W*Vt,F+=W*zt,z+=W*ot,ie+=W*Gt,pe+=W*Ft,ve+=W*yt,he+=W*Qe,Le+=W*Ot,Ze+=W*_t,et+=W*Zt,W=te[10],Ve+=W*mt,Ie+=W*Ct,Ne+=W*dt,Oe+=W*Nt,Me+=W*jt,Y+=W*gt,F+=W*Vt,z+=W*zt,ie+=W*ot,pe+=W*Gt,ve+=W*Ft,he+=W*yt,Le+=W*Qe,Ze+=W*Ot,et+=W*_t,it+=W*Zt,W=te[11],Ie+=W*mt,Ne+=W*Ct,Oe+=W*dt,Me+=W*Nt,Y+=W*jt,F+=W*gt,z+=W*Vt,ie+=W*zt,pe+=W*ot,ve+=W*Gt,he+=W*Ft,Le+=W*yt,Ze+=W*Qe,et+=W*Ot,it+=W*_t,ut+=W*Zt,W=te[12],Ne+=W*mt,Oe+=W*Ct,Me+=W*dt,Y+=W*Nt,F+=W*jt,z+=W*gt,ie+=W*Vt,pe+=W*zt,ve+=W*ot,he+=W*Gt,Le+=W*Ft,Ze+=W*yt,et+=W*Qe,it+=W*Ot,ut+=W*_t,pt+=W*Zt,W=te[13],Oe+=W*mt,Me+=W*Ct,Y+=W*dt,F+=W*Nt,z+=W*jt,ie+=W*gt,pe+=W*Vt,ve+=W*zt,he+=W*ot,Le+=W*Gt,Ze+=W*Ft,et+=W*yt,it+=W*Qe,ut+=W*Ot,pt+=W*_t,tr+=W*Zt,W=te[14],Me+=W*mt,Y+=W*Ct,F+=W*dt,z+=W*Nt,ie+=W*jt,pe+=W*gt,ve+=W*Vt,he+=W*zt,Le+=W*ot,Ze+=W*Gt,et+=W*Ft,it+=W*yt,ut+=W*Qe,pt+=W*Ot,tr+=W*_t,Wt+=W*Zt,W=te[15],Y+=W*mt,F+=W*Ct,z+=W*dt,ie+=W*Nt,pe+=W*jt,ve+=W*gt,he+=W*Vt,Le+=W*zt,Ze+=W*ot,et+=W*Gt,it+=W*Ft,ut+=W*yt,pt+=W*Qe,tr+=W*Ot,Wt+=W*_t,At+=W*Zt,J+=38*F,me+=38*z,be+=38*ie,Ce+=38*pe,Fe+=38*ve,Ue+=38*he,Ye+=38*Le,lt+=38*Ze,xe+=38*et,He+=38*it,Ve+=38*ut,Ie+=38*pt,Ne+=38*tr,Oe+=38*Wt,Me+=38*At,q=1,W=J+q+65535,q=Math.floor(W/65536),J=W-q*65536,W=me+q+65535,q=Math.floor(W/65536),me=W-q*65536,W=be+q+65535,q=Math.floor(W/65536),be=W-q*65536,W=Ce+q+65535,q=Math.floor(W/65536),Ce=W-q*65536,W=Fe+q+65535,q=Math.floor(W/65536),Fe=W-q*65536,W=Ue+q+65535,q=Math.floor(W/65536),Ue=W-q*65536,W=Ye+q+65535,q=Math.floor(W/65536),Ye=W-q*65536,W=lt+q+65535,q=Math.floor(W/65536),lt=W-q*65536,W=xe+q+65535,q=Math.floor(W/65536),xe=W-q*65536,W=He+q+65535,q=Math.floor(W/65536),He=W-q*65536,W=Ve+q+65535,q=Math.floor(W/65536),Ve=W-q*65536,W=Ie+q+65535,q=Math.floor(W/65536),Ie=W-q*65536,W=Ne+q+65535,q=Math.floor(W/65536),Ne=W-q*65536,W=Oe+q+65535,q=Math.floor(W/65536),Oe=W-q*65536,W=Me+q+65535,q=Math.floor(W/65536),Me=W-q*65536,W=Y+q+65535,q=Math.floor(W/65536),Y=W-q*65536,J+=q-1+37*(q-1),q=1,W=J+q+65535,q=Math.floor(W/65536),J=W-q*65536,W=me+q+65535,q=Math.floor(W/65536),me=W-q*65536,W=be+q+65535,q=Math.floor(W/65536),be=W-q*65536,W=Ce+q+65535,q=Math.floor(W/65536),Ce=W-q*65536,W=Fe+q+65535,q=Math.floor(W/65536),Fe=W-q*65536,W=Ue+q+65535,q=Math.floor(W/65536),Ue=W-q*65536,W=Ye+q+65535,q=Math.floor(W/65536),Ye=W-q*65536,W=lt+q+65535,q=Math.floor(W/65536),lt=W-q*65536,W=xe+q+65535,q=Math.floor(W/65536),xe=W-q*65536,W=He+q+65535,q=Math.floor(W/65536),He=W-q*65536,W=Ve+q+65535,q=Math.floor(W/65536),Ve=W-q*65536,W=Ie+q+65535,q=Math.floor(W/65536),Ie=W-q*65536,W=Ne+q+65535,q=Math.floor(W/65536),Ne=W-q*65536,W=Oe+q+65535,q=Math.floor(W/65536),Oe=W-q*65536,W=Me+q+65535,q=Math.floor(W/65536),Me=W-q*65536,W=Y+q+65535,q=Math.floor(W/65536),Y=W-q*65536,J+=q-1+37*(q-1),Z[0]=J,Z[1]=me,Z[2]=be,Z[3]=Ce,Z[4]=Fe,Z[5]=Ue,Z[6]=Ye,Z[7]=lt,Z[8]=xe,Z[9]=He,Z[10]=Ve,Z[11]=Ie,Z[12]=Ne,Z[13]=Oe,Z[14]=Me,Z[15]=Y}function U(Z,te){S(Z,te,te)}function G(Z,te){const re=i();let W;for(W=0;W<16;W++)re[W]=te[W];for(W=253;W>=0;W--)U(re,re),W!==2&&W!==4&&S(re,re,te);for(W=0;W<16;W++)Z[W]=re[W]}function ae(Z,te){const re=i();let W;for(W=0;W<16;W++)re[W]=te[W];for(W=250;W>=0;W--)U(re,re),W!==1&&S(re,re,te);for(W=0;W<16;W++)Z[W]=re[W]}function K(Z,te){const re=i(),W=i(),q=i(),J=i(),me=i(),be=i(),Ce=i(),Fe=i(),Ue=i();B(re,Z[1],Z[0]),B(Ue,te[1],te[0]),S(re,re,Ue),R(W,Z[0],Z[1]),R(Ue,te[0],te[1]),S(W,W,Ue),S(q,Z[3],te[3]),S(q,q,c),S(J,Z[2],te[2]),R(J,J,J),B(me,W,re),B(be,J,q),R(Ce,J,q),R(Fe,W,re),S(Z[0],me,be),S(Z[1],Fe,Ce),S(Z[2],Ce,be),S(Z[3],me,Fe)}function N(Z,te,re){for(let W=0;W<4;W++)w(Z[W],te[W],re)}function k(Z,te){const re=i(),W=i(),q=i();G(q,te[2]),S(re,te[0],q),S(W,te[1],q),E(Z,W),Z[31]^=A(re)<<7}function b(Z,te,re){g(Z[0],a),g(Z[1],o),g(Z[2],o),g(Z[3],a);for(let W=255;W>=0;--W){const q=re[W/8|0]>>(W&7)&1;N(Z,te,q),K(te,Z),K(Z,Z),N(Z,te,q)}}function x(Z,te){const re=[i(),i(),i(),i()];g(re[0],u),g(re[1],f),g(re[2],o),S(re[3],u,f),b(Z,re,te)}function P(Z){if(Z.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const te=(0,r.hash)(Z);te[0]&=248,te[31]&=127,te[31]|=64;const re=new Uint8Array(32),W=[i(),i(),i(),i()];x(W,te),k(re,W);const q=new Uint8Array(64);return q.set(Z),q.set(re,32),{publicKey:re,secretKey:q}}t.generateKeyPairFromSeed=P;function D(Z){const te=(0,e.randomBytes)(32,Z),re=P(te);return(0,n.wipe)(te),re}t.generateKeyPair=D;function O(Z){if(Z.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(Z.subarray(32))}t.extractPublicKeyFromSecretKey=O;const j=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 T(Z,te){let re,W,q,J;for(W=63;W>=32;--W){for(re=0,q=W-32,J=W-12;q>4)*j[q],re=te[q]>>8,te[q]&=255;for(q=0;q<32;q++)te[q]-=re*j[q];for(W=0;W<32;W++)te[W+1]+=te[W]>>8,Z[W]=te[W]&255}function L(Z){const te=new Float64Array(64);for(let re=0;re<64;re++)te[re]=Z[re];for(let re=0;re<64;re++)Z[re]=0;T(Z,te)}function M(Z,te){const re=new Float64Array(64),W=[i(),i(),i(),i()],q=(0,r.hash)(Z.subarray(0,32));q[0]&=248,q[31]&=127,q[31]|=64;const J=new Uint8Array(64);J.set(q.subarray(32),32);const me=new r.SHA512;me.update(J.subarray(32)),me.update(te);const be=me.digest();me.clean(),L(be),x(W,be),k(J,W),me.reset(),me.update(J.subarray(0,32)),me.update(Z.subarray(32)),me.update(te);const Ce=me.digest();L(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]*q[Ue];return T(J.subarray(32),re),J}t.sign=M;function X(Z,te){const re=i(),W=i(),q=i(),J=i(),me=i(),be=i(),Ce=i();return g(Z[2],o),C(Z[1],te),U(q,Z[1]),S(J,q,l),B(q,q,Z[2]),R(J,Z[2],J),U(me,J),U(be,me),S(Ce,be,me),S(re,Ce,q),S(re,re,J),ae(re,re),S(re,re,q),S(re,re,J),S(re,re,J),S(Z[0],re,J),U(W,Z[0]),S(W,W,J),_(W,q)&&S(Z[0],Z[0],h),U(W,Z[0]),S(W,W,J),_(W,q)?-1:(A(Z[0])===te[31]>>7&&B(Z[0],a,Z[0]),S(Z[3],Z[0],Z[1]),0)}function le(Z,te,re){const W=new Uint8Array(32),q=[i(),i(),i(),i()],J=[i(),i(),i(),i()];if(re.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(X(J,Z))return!1;const me=new r.SHA512;me.update(re.subarray(0,32)),me.update(Z),me.update(te);const be=me.digest();return L(be),b(q,J,be),x(J,re.subarray(32)),K(q,J),k(W,q),!v(re,W)}t.verify=le;function H(Z){let te=[i(),i(),i(),i()];if(X(te,Z))throw new Error("Ed25519: invalid public key");let re=i(),W=i(),q=te[1];R(re,o,q),B(W,o,q),G(W,W),S(re,re,W);let J=new Uint8Array(32);return E(J,re),J}t.convertPublicKeyToX25519=H;function ee(Z){const te=(0,r.hash)(Z.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})(BN);const zLe="EdDSA",HLe="JWT",i6=".",H_="base64url",Ite="utf8",Tte="utf8",qLe=":",VLe="did",GLe="key",VU="base58btc",KLe="z",YLe="K36",ZLe=32,JLe=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),QLe=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 M0(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return QLe(t)}catch{return t}}function Sd(t){return typeof t=="string"?t:JLe(t)||""}function GU(t){return M0(Ji(Ki(t,H_),Ite))}function s6(t){return Ji(Ki(Sd(t),Ite),H_)}function $te(t){const e=Ki(YLe,VU),r=KLe+Ji(M5([e,t]),VU);return[VLe,GLe,r].join(qLe)}function XLe(t){return Ji(t,H_)}function eDe(t){return Ki(t,H_)}function tDe(t){return Ki([s6(t.header),s6(t.payload)].join(i6),Tte)}function rDe(t){return[s6(t.header),s6(t.payload),XLe(t.signature)].join(i6)}function LI(t){const e=t.split(i6),r=GU(e[0]),n=GU(e[1]),i=eDe(e[2]),s=Ki(e.slice(0,2).join(i6),Tte);return{header:r,payload:n,signature:i,data:s}}function KU(t=oh.randomBytes(ZLe)){return BN.generateKeyPairFromSeed(t)}async function nDe(t,e,r,n,i=ct.fromMiliseconds(Date.now())){const s={alg:zLe,typ:HLe},a=$te(n.publicKey),o=i+r,l={iss:a,sub:t,aud:e,iat:i,exp:o},c=tDe({header:s,payload:l}),u=BN.sign(n.secretKey,c);return rDe({header:s,payload:l,signature:u})}const iDe={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 sDe={};const aDe=":";function U1(t){const[e,r]=t.split(aDe);return{namespace:e,reference:r}}function YU(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 kte(t,e){return t.includes(":")?[t]:e.chains||[]}var oDe=Object.defineProperty,ZU=Object.getOwnPropertySymbols,lDe=Object.prototype.hasOwnProperty,cDe=Object.prototype.propertyIsEnumerable,JU=(t,e,r)=>e in t?oDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,QU=(t,e)=>{for(var r in e||(e={}))lDe.call(e,r)&&JU(t,r,e[r]);if(ZU)for(var r of ZU(e))cDe.call(e,r)&&JU(t,r,e[r]);return t};const uDe="ReactNative",fo={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},dDe="js";function a6(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function ch(){return!dw()&&!!$N()&&navigator.product===uDe}function fDe(){return ch()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function hDe(){return ch()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function yw(){return!a6()&&!!$N()&&!!dw()}function vw(){return ch()?fo.reactNative:a6()?fo.node:yw()?fo.browser:fo.unknown}function XU(){var t;try{return ch()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function pDe(t,e){let r=lv.parse(t);return r=QU(QU({},r),e),t=lv.stringify(r),t}function Nte(){return Xee()||{name:"",description:"",url:"",icons:[""]}}function gDe(){if(vw()===fo.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=wMe();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 mDe(){var t;const e=vw();return e===fo.browser?[e,((t=Qee())==null?void 0:t.host)||"unknown"].join(":"):e}function Pte(t,e,r){const n=gDe(),i=mDe();return[[t,e].join("-"),[dDe,r].join("-"),n,i].join("/")}function yDe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:a,bundleId:o,packageName:l}){const c=r.split("?"),u=Pte(t,e,n),f={auth:i,ua:u,projectId:s,useOnCloseEvent:a||void 0,packageName:l||void 0,bundleId:o||void 0},h=pDe(c[1]||"",f);return c[0]+"?"+h}function Jh(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Rte(t){return Object.fromEntries(t.entries())}function Mte(t){return new Map(Object.entries(t))}function Oh(t=ct.FIVE_MINUTES,e){const r=ct.toMiliseconds(t||ct.FIVE_MINUTES);let n,i,s,a;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o),a=Promise.resolve(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,l)=>{if(a)return o(a);s=setTimeout(()=>{const c=new Error(e);a=Promise.reject(c),l(c)},r),n=o,i=l})}}function vf(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const a=await t;n(a)}catch(a){i(a)}clearTimeout(s)})}function Ote(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 vDe(t){return Ote("topic",t)}function wDe(t){return Ote("id",t)}function jte(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 Ci(t,e){return ct.fromMiliseconds(Date.now()+ct.toMiliseconds(t))}function of(t){return Date.now()>=ct.toMiliseconds(t)}function Nr(t,e){return`${t}${e?`:${e}`:""}`}function O5(t=[],e=[]){return[...new Set([...t,...e])]}async function bDe({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,s=i==null?void 0:i.href;if(typeof s!="string")return;const a=_De(s,t,e),o=vw();if(o===fo.browser){if(!((n=dw())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}a.startsWith("https://")||a.startsWith("http://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,EDe()?"_blank":"_self","noreferrer noopener")}else o===fo.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(a)}catch(i){console.error(i)}}function _De(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 s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${CDe(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function xDe(t,e){let r="";try{if(yw()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function eB(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function tB(){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 WN(){return typeof process<"u"&&sDe.IS_VITEST==="true"}function EDe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function CDe(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function Lte(t){return Buffer.from(t,"base64").toString("utf-8")}function ADe(t){return new Promise(e=>setTimeout(e,t))}const SDe="https://rpc.walletconnect.org/v1";async function IDe(t,e,r,n,i,s){switch(r.t){case"eip191":return TDe(t,e,r.s);case"eip1271":return await $De(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function TDe(t,e,r){return W$(cG(e),r).toLowerCase()===t.toLowerCase()}async function $De(t,e,r,n,i,s){const a=U1(n);if(!a.namespace||!a.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=cG(e).substring(2),h=o+f+l+c+u,g=await fetch(`${s||SDe}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:kDe(),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 kDe(){return Date.now()+Math.floor(Math.random()*1e3)}var NDe=Object.defineProperty,PDe=Object.defineProperties,RDe=Object.getOwnPropertyDescriptors,rB=Object.getOwnPropertySymbols,MDe=Object.prototype.hasOwnProperty,ODe=Object.prototype.propertyIsEnumerable,nB=(t,e,r)=>e in t?NDe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jDe=(t,e)=>{for(var r in e||(e={}))MDe.call(e,r)&&nB(t,r,e[r]);if(rB)for(var r of rB(e))ODe.call(e,r)&&nB(t,r,e[r]);return t},LDe=(t,e)=>PDe(t,RDe(e));const DDe="did:pkh:",zN=t=>t==null?void 0:t.split(":"),FDe=t=>{const e=t&&zN(t);if(e)return t.includes(DDe)?e[3]:e[1]},DI=t=>{const e=t&&zN(t);if(e)return e[2]+":"+e[3]},o6=t=>{const e=t&&zN(t);if(e)return e.pop()};async function iB(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=Dte(i,i.iss),a=o6(i.iss);return await IDe(a,s,n,DI(i.iss),r)}const Dte=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=o6(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 s=`URI: ${t.aud||t.uri}`,a=`Version: ${t.version}`,o=`Chain ID: ${FDe(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=j5(t.resources);if(m){const w=cv(m);i=KDe(i,w)}return[r,n,"",i,"",s,a,o,l,c,u,f,h,g].filter(w=>w!=null).join(` +`)};function UDe(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function BDe(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function O0(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 s=n[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(a=>{if(typeof a!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${a}`)})})})}function WDe(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:zDe(e,r,n)}}}function zDe(t,e,r={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function Fte(t){return O0(t),`urn:recap:${UDe(t).replace(/=/g,"")}`}function cv(t){const e=BDe(t.replace("urn:recap:",""));return O0(e),e}function HDe(t,e,r){const n=WDe(t,e,r);return Fte(n)}function qDe(t){return t&&t.includes("urn:recap:")}function VDe(t,e){const r=cv(t),n=cv(e),i=GDe(r,n);return Fte(i)}function GDe(t,e){O0(t),O0(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),n={att:{}};return r.forEach(i=>{var s,a;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((a=e.att)==null?void 0:a[i])||{})).sort((o,l)=>o.localeCompare(l)).forEach(o=>{var l,c;n.att[i]=LDe(jDe({},n.att[i]),{[o]:((l=t.att[i])==null?void 0:l[o])||((c=e.att[i])==null?void 0:c[o])})})}),n}function KDe(t="",e){O0(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 s=n.join(" "),a=`${r}${s}`;return`${t?t+" ":""}${a}`}function sB(t){var e;const r=cv(t);O0(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function aB(t){const e=cv(t);O0(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function j5(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return qDe(e)?e:void 0}const Ute="base10",Xs="base16",wf="base64pad",sy="base64url",ww="utf8",Bte=0,cd=1,bw=2,YDe=0,oB=1,Qy=12,HN=32;function ZDe(){const t=RN.generateKeyPair();return{privateKey:Ji(t.secretKey,Xs),publicKey:Ji(t.publicKey,Xs)}}function FI(){const t=oh.randomBytes(HN);return Ji(t,Xs)}function JDe(t,e){const r=RN.sharedKey(Ki(t,Xs),Ki(e,Xs),!0),n=new YOe(hw.SHA256,r).expand(HN);return Ji(n,Xs)}function L5(t){const e=hw.hash(Ki(t,Xs));return Ji(e,Xs)}function Qu(t){const e=hw.hash(Ki(t,ww));return Ji(e,Xs)}function Wte(t){return Ki(`${t}`,Ute)}function j0(t){return Number(Ji(t,Ute))}function QDe(t){const e=Wte(typeof t.type<"u"?t.type:Bte);if(j0(e)===cd&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Ki(t.senderPublicKey,Xs):void 0,n=typeof t.iv<"u"?Ki(t.iv,Xs):oh.randomBytes(Qy),i=new NN.ChaCha20Poly1305(Ki(t.symKey,Xs)).seal(n,Ki(t.message,ww));return zte({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function XDe(t,e){const r=Wte(bw),n=oh.randomBytes(Qy),i=Ki(t,ww);return zte({type:r,sealed:i,iv:n,encoding:e})}function eFe(t){const e=new NN.ChaCha20Poly1305(Ki(t.symKey,Xs)),{sealed:r,iv:n}=uv({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 Ji(i,ww)}function tFe(t,e){const{sealed:r}=uv({encoded:t,encoding:e});return Ji(r,ww)}function zte(t){const{encoding:e=wf}=t;if(j0(t.type)===bw)return Ji(M5([t.type,t.sealed]),e);if(j0(t.type)===cd){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Ji(M5([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return Ji(M5([t.type,t.iv,t.sealed]),e)}function uv(t){const{encoded:e,encoding:r=wf}=t,n=Ki(e,r),i=n.slice(YDe,oB),s=oB;if(j0(i)===cd){const c=s+HN,u=c+Qy,f=n.slice(s,c),h=n.slice(c,u),g=n.slice(u);return{type:i,sealed:g,iv:h,senderPublicKey:f}}if(j0(i)===bw){const c=n.slice(s),u=oh.randomBytes(Qy);return{type:i,sealed:c,iv:u}}const a=s+Qy,o=n.slice(s,a),l=n.slice(a);return{type:i,sealed:l,iv:o}}function rFe(t,e){const r=uv({encoded:t,encoding:e==null?void 0:e.encoding});return Hte({type:j0(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Ji(r.senderPublicKey,Xs):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Hte(t){const e=(t==null?void 0:t.type)||Bte;if(e===cd){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 lB(t){return t.type===cd&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function cB(t){return t.type===bw}function nFe(t){return new yte.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function iFe(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function sFe(t){return Buffer.from(iFe(t),"base64")}function aFe(t,e){const[r,n,i]=t.split("."),s=sFe(i);if(s.length!==64)throw new Error("Invalid signature length");const a=s.slice(0,32).toString("hex"),o=s.slice(32,64).toString("hex"),l=`${r}.${n}`,c=new hw.SHA256().update(Buffer.from(l)).digest(),u=nFe(e),f=Buffer.from(c).toString("hex");if(!u.verify(f,{r:a,s:o}))throw new Error("Invalid signature");return LI(t).payload}const oFe="irn";function l6(t){return(t==null?void 0:t.relay)||{protocol:oFe}}function Iy(t){const e=iDe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var lFe=Object.defineProperty,cFe=Object.defineProperties,uFe=Object.getOwnPropertyDescriptors,uB=Object.getOwnPropertySymbols,dFe=Object.prototype.hasOwnProperty,fFe=Object.prototype.propertyIsEnumerable,dB=(t,e,r)=>e in t?lFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fB=(t,e)=>{for(var r in e||(e={}))dFe.call(e,r)&&dB(t,r,e[r]);if(uB)for(var r of uB(e))fFe.call(e,r)&&dB(t,r,e[r]);return t},hFe=(t,e)=>cFe(t,uFe(e));function pFe(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),a=t[i];r[s]=a}}),r}function hB(t){if(!t.includes("wc:")){const l=Lte(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("@"),s=typeof r<"u"?t.substring(r):"",a=lv.parse(s),o=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:n,topic:gFe(i[0]),version:parseInt(i[1],10),symKey:a.symKey,relay:pFe(a),methods:o,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function gFe(t){return t.startsWith("//")?t.substring(2):t}function mFe(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function pB(t){return`${t.protocol}:${t.topic}@${t.version}?`+lv.stringify(fB(hFe(fB({symKey:t.symKey},mFe(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function Ob(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function sm(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function yFe(t){const e=[];return Object.values(t).forEach(r=>{e.push(...sm(r.accounts))}),e}function vFe(t,e){const r=[];return Object.values(t).forEach(n=>{sm(n.accounts).includes(e)&&r.push(...n.methods)}),r}function wFe(t,e){const r=[];return Object.values(t).forEach(n=>{sm(n.accounts).includes(e)&&r.push(...n.events)}),r}function qN(t){return t.includes(":")}function Ty(t){return qN(t)?t.split(":")[0]:t}function bFe(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 gB(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=bFe(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=O5(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const _Fe={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}},xFe={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}=xFe[t];return{message:e?`${r} ${e}`:r,code:n}}function sn(t,e){const{message:r,code:n}=_Fe[t];return{message:e?`${r} ${e}`:r,code:n}}function Id(t,e){return!!Array.isArray(t)}function dv(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Sa(t){return typeof t>"u"}function li(t,e){return e&&Sa(t)?!0:typeof t=="string"&&!!t.trim().length}function VN(t,e){return typeof t=="number"&&!isNaN(t)}function EFe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return Jh(i,n)?(n.forEach(a=>{const{accounts:o,methods:l,events:c}=t.namespaces[a],u=sm(o),f=r[a];(!Jh(kte(a,f),u)||!Jh(f.methods,l)||!Jh(f.events,c))&&(s=!1)}),s):!1}function c6(t){return li(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function CFe(t){if(li(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&c6(r)}}return!1}function AFe(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(li(t,!1)){if(e(t))return!0;const r=Lte(t);return e(r)}}catch{}return!1}function SFe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function IFe(t){return t==null?void 0:t.topic}function TFe(t,e){let r=null;return li(t==null?void 0:t.publicKey,!1)||(r=ht("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function mB(t){let e=!0;return Id(t)?t.length&&(e=t.every(r=>li(r,!1))):e=!1,e}function $Fe(t,e,r){let n=null;return Id(e)&&e.length?e.forEach(i=>{n||c6(i)||(n=sn("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):c6(t)||(n=sn("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 kFe(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const a=$Fe(i,kte(i,s),`${e} ${r}`);a&&(n=a)}),n}function NFe(t,e){let r=null;return Id(t)?t.forEach(n=>{r||CFe(n)||(r=sn("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=sn("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function PFe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=NFe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function RFe(t,e){let r=null;return mB(t==null?void 0:t.methods)?mB(t==null?void 0:t.events)||(r=sn("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=sn("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function qte(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=RFe(n,`${e}, namespace`);i&&(r=i)}),r}function MFe(t,e,r){let n=null;if(t&&dv(t)){const i=qte(t,e);i&&(n=i);const s=kFe(t,e,r);s&&(n=s)}else n=ht("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function eC(t,e){let r=null;if(t&&dv(t)){const n=qte(t,e);n&&(r=n);const i=PFe(t,e);i&&(r=i)}else r=ht("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Vte(t){return li(t.protocol,!0)}function OFe(t,e){let r=!1;return t?t&&Id(t)&&t.length&&t.forEach(n=>{r=Vte(n)}):r=!0,r}function jFe(t){return typeof t=="number"}function ba(t){return typeof t<"u"&&typeof t!==null}function LFe(t){return!(!t||typeof t!="object"||!t.code||!VN(t.code)||!t.message||!li(t.message,!1))}function DFe(t){return!(Sa(t)||!li(t.method,!1))}function FFe(t){return!(Sa(t)||Sa(t.result)&&Sa(t.error)||!VN(t.id)||!li(t.jsonrpc,!1))}function UFe(t){return!(Sa(t)||!li(t.name,!1))}function yB(t,e){return!(!c6(e)||!yFe(t).includes(e))}function BFe(t,e,r){return li(r,!1)?vFe(t,e).includes(r):!1}function WFe(t,e,r){return li(r,!1)?wFe(t,e).includes(r):!1}function vB(t,e,r){let n=null;const i=zFe(t),s=HFe(e),a=Object.keys(i),o=Object.keys(s),l=wB(Object.keys(t)),c=wB(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()}`)),Gh(o,a)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. - Required: ${o.toString()} - Approved: ${a.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const h=nm(e[f].accounts);h.includes(f)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} + Received: ${Object.keys(e).toString()}`)),Jh(a,o)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. + Required: ${a.toString()} + Approved: ${o.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const h=sm(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()}`))}),o.forEach(f=>{n||(Gh(i[f].methods,s[f].methods)?Gh(i[f].events,s[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 HLe(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 eB(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function qLe(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=nm(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function VLe(t,e){return ON(t)&&t<=e.max&&t>=e.min}function tB(){const t=gw();return new Promise(e=>{switch(t){case fa.browser:e(GLe());break;case fa.reactNative:e(KLe());break;case fa.node:e(YLe());break;default:e(!0)}})}function GLe(){return pw()&&(navigator==null?void 0:navigator.onLine)}async function KLe(){if(oh()&&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 YLe(){return!0}function ZLe(t){switch(gw()){case fa.browser:JLe(t);break;case fa.reactNative:QLe(t);break}}function JLe(t){!oh()&&pw()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function QLe(t){oh()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const KE={};class iy{static get(e){return KE[e]}static set(e,r){KE[e]=r}static delete(e){delete KE[e]}}class np{}let XLe=class extends np{constructor(e){super()}};const rB=ct.FIVE_SECONDS,im={pulse:"heartbeat_pulse"};let eFe=class xte extends XLe{constructor(e){super(e),this.events=new oo.EventEmitter,this.interval=rB,this.interval=(e==null?void 0:e.interval)||rB}static async init(e){const r=new xte(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(im.pulse)}};function tFe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function ji(t,...e){try{return tFe(t(...e))}catch(r){return Promise.reject(r)}}function rFe(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function nFe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function O5(t){if(rFe(t))return String(t);if(nFe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return O5(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const RI="base64:";function iFe(t){return typeof t=="string"?t:RI+aFe(t)}function sFe(t){return typeof t!="string"||!t.startsWith(RI)?t:oFe(t.slice(RI.length))}function oFe(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function aFe(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function bo(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function lFe(...t){return bo(t.join(":"))}function Rb(t){return t=bo(t),t?t+":":""}const cFe="memory",uFe=()=>{const t=new Map;return{name:cFe,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 dFe(t={}){const e={mounts:{"":t.driver||uFe()},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=bo(u);for(const f of e.watchListeners)f(c,u)}},s=async()=>{if(!e.watching){e.watching=!0;for(const c in e.mounts)e.unwatch[c]=await nB(e.mounts[c],i,c)}},o=async()=>{if(e.watching){for(const c in e.unwatch)await e.unwatch[c]();e.unwatch={},e.watching=!1}},a=(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",E=bo(w?m:m.key),v=w?void 0:m.value,_=w||!m.options?u:{...u,...m.options},A=r(E);g(A).items.push({key:E,value:v,relativeKey:A.relativeKey,options:_})}return Promise.all([...h.values()].map(m=>f(m))).then(m=>m.flat())},l={hasItem(c,u={}){c=bo(c);const{relativeKey:f,driver:h}=r(c);return ji(h.hasItem,f,u)},getItem(c,u={}){c=bo(c);const{relativeKey:f,driver:h}=r(c);return ji(h.getItem,f,u).then(g=>by(g))},getItems(c,u={}){return a(c,u,f=>f.driver.getItems?ji(f.driver.getItems,f.items.map(h=>({key:h.relativeKey,options:h.options})),u).then(h=>h.map(g=>({key:lFe(f.base,g.key),value:by(g.value)}))):Promise.all(f.items.map(h=>ji(f.driver.getItem,h.relativeKey,h.options).then(g=>({key:h.key,value:by(g)})))))},getItemRaw(c,u={}){c=bo(c);const{relativeKey:f,driver:h}=r(c);return h.getItemRaw?ji(h.getItemRaw,f,u):ji(h.getItem,f,u).then(g=>sFe(g))},async setItem(c,u,f={}){if(u===void 0)return l.removeItem(c);c=bo(c);const{relativeKey:h,driver:g}=r(c);g.setItem&&(await ji(g.setItem,h,O5(u),f),g.watch||i("update",c))},async setItems(c,u){await a(c,u,async f=>{if(f.driver.setItems)return ji(f.driver.setItems,f.items.map(h=>({key:h.relativeKey,value:O5(h.value),options:h.options})),u);f.driver.setItem&&await Promise.all(f.items.map(h=>ji(f.driver.setItem,h.relativeKey,O5(h.value),h.options)))})},async setItemRaw(c,u,f={}){if(u===void 0)return l.removeItem(c,f);c=bo(c);const{relativeKey:h,driver:g}=r(c);if(g.setItemRaw)await ji(g.setItemRaw,h,u,f);else if(g.setItem)await ji(g.setItem,h,iFe(u),f);else return;g.watch||i("update",c)},async removeItem(c,u={}){typeof u=="boolean"&&(u={removeMeta:u}),c=bo(c);const{relativeKey:f,driver:h}=r(c);h.removeItem&&(await ji(h.removeItem,f,u),(u.removeMeta||u.removeMata)&&await ji(h.removeItem,f+"$",u),h.watch||i("remove",c))},async getMeta(c,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),c=bo(c);const{relativeKey:f,driver:h}=r(c),g=Object.create(null);if(h.getMeta&&Object.assign(g,await ji(h.getMeta,f,u)),!u.nativeOnly){const m=await ji(h.getItem,f+"$",u).then(w=>by(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=Rb(c);const f=n(c,!0);let h=[];const g=[];for(const m of f){const w=await ji(m.driver.getKeys,m.relativeBase,u);for(const E of w){const v=m.mountpoint+bo(E);h.some(_=>v.startsWith(_))||g.push(v)}h=[m.mountpoint,...h.filter(E=>!E.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=Rb(c),await Promise.all(n(c,!1).map(async f=>{if(f.driver.clear)return ji(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=>iB(c)))},async watch(c){return await s(),e.watchListeners.push(c),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==c),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(c,u){if(c=Rb(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(nB(u,i,c)).then(f=>{e.unwatch[c]=f}).catch(console.error),l},async unmount(c,u=!0){var f,h;c=Rb(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 iB(e.mounts[c]),e.mountpoints=e.mountpoints.filter(g=>g!==c),delete e.mounts[c])},getMount(c=""){c=bo(c)+":";const u=r(c);return{driver:u.driver,base:u.base}},getMounts(c="",u={}){return c=bo(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 nB(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function iB(t){typeof t.dispose=="function"&&await ji(t.dispose)}function ip(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Ete(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=ip(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let YE;function vw(){return YE||(YE=Ete("keyval-store","keyval")),YE}function sB(t,e=vw()){return e("readonly",r=>ip(r.get(t)))}function fFe(t,e,r=vw()){return r("readwrite",n=>(n.put(e,t),ip(n.transaction)))}function hFe(t,e=vw()){return e("readwrite",r=>(r.delete(t),ip(r.transaction)))}function pFe(t=vw()){return t("readwrite",e=>(e.clear(),ip(e.transaction)))}function gFe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},ip(t.transaction)}function mFe(t=vw()){return t("readonly",e=>{if(e.getAllKeys)return ip(e.getAllKeys());const r=[];return gFe(e,n=>r.push(n.key)).then(()=>r)})}const yFe="idb-keyval";var vFe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Ete(t.dbName,t.storeName)),{name:yFe,options:t,async hasItem(i){return!(typeof await sB(r(i),n)>"u")},async getItem(i){return await sB(r(i),n)??null},setItem(i,s){return fFe(r(i),s,n)},removeItem(i){return hFe(r(i),n)},getKeys(){return mFe(n)},clear(){return pFe(n)}}};const wFe="WALLET_CONNECT_V2_INDEXED_DB",bFe="keyvaluestorage";let _Fe=class{constructor(){this.indexedDb=dFe({driver:vFe({dbName:wFe,storeName:bFe})})}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,Cd(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var ZE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},j5={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 ZE<"u"&&ZE.localStorage?j5.exports=ZE.localStorage:typeof window<"u"&&window.localStorage?j5.exports=window.localStorage:j5.exports=new e})();function xFe(t){var e;return[t[0],N0((e=t[1])!=null?e:"")]}let EFe=class{constructor(){this.localStorage=j5.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(xFe)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return N0(r)}async setItem(e,r){this.localStorage.setItem(e,Cd(r))}async removeItem(e){this.localStorage.removeItem(e)}};const CFe="wc_storage_version",oB=1,AFe=async(t,e,r)=>{const n=CFe,i=await e.getItem(n);if(i&&i>=oB){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const l=a.toLowerCase();if(l.includes("wc@")||l.includes("walletconnect")||l.includes("wc_")||l.includes("wallet_connect")){const c=await t.getItem(a);await e.setItem(a,c),o.push(a)}}await e.setItem(n,oB),r(e),SFe(t,o)},SFe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let IFe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new EFe;this.storage=e;try{const r=new _Fe;AFe(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 TFe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var $Fe=kFe;function kFe(t,e,r){var n=r&&r.stringify||TFe,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a-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&&(s=!1);const o=["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 a=t.level||"info",l=Object.create(r);l.log||(l.log=uv),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:o,timestamp:DFe(t)};l.levels=Zc.levels,l.level=a,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=uv,l.serializers=n,l._serialize=i,l._stdErrSerialize=s,l.child=g,e&&(l._logEvent=MI());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,zp(c,l,"error","log"),zp(c,l,"fatal","error"),zp(c,l,"warn","error"),zp(c,l,"info","log"),zp(c,l,"debug","log"),zp(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 E=w.serializers;if(i&&E){var v=Object.assign({},n,E),_=t.browser.serialize===!0?Object.keys(v):i;delete m.serializers,F_([m],_,v,this._stdErrSerialize)}function A(C){this._childLevel=(C._childLevel|0)+1,this.error=Hp(C,m,"error"),this.fatal=Hp(C,m,"fatal"),this.warn=Hp(C,m,"warn"),this.info=Hp(C,m,"info"),this.debug=Hp(C,m,"debug"),this.trace=Hp(C,m,"trace"),v&&(this.serializers=v,this._serialize=_),e&&(this._logEvent=MI([].concat(C._logEvent.bindings,m)))}return A.prototype=this,new A(this)}return l}Zc.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"}};Zc.stdSerializers=NFe;Zc.stdTimeFunctions=Object.assign({},{nullTime:Cte,epochTime:Ate,unixTime:LFe,isoTime:FFe});function zp(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?uv:i[r]?i[r]:cv[r]||cv[n]||uv,RFe(t,e,r)}function RFe(t,e,r){!t.transmit&&e[r]===uv||(e[r]=function(n){return function(){const s=t.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===cv?cv:this;for(var l=0;l-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function Hp(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}}}}},Ste=class{constructor(e,r=jN){this.level=e??"error",this.levelValue=Qp.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new lB(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===Qp.levels.values.error?console.error(e):r===Qp.levels.values.warn?console.warn(e):r===Qp.levels.values.debug?console.debug(e):r===Qp.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Cd({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 lB(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Cd({extraMetadata:e})),new Blob(r,{type:"application/json"})}},zFe=class{constructor(e,r=jN){this.baseChunkLogger=new Ste(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)}},HFe=class{constructor(e,r=jN){this.baseChunkLogger=new Ste(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 qFe=Object.defineProperty,VFe=Object.defineProperties,GFe=Object.getOwnPropertyDescriptors,cB=Object.getOwnPropertySymbols,KFe=Object.prototype.hasOwnProperty,YFe=Object.prototype.propertyIsEnumerable,uB=(t,e,r)=>e in t?qFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,s4=(t,e)=>{for(var r in e||(e={}))KFe.call(e,r)&&uB(t,r,e[r]);if(cB)for(var r of cB(e))YFe.call(e,r)&&uB(t,r,e[r]);return t},o4=(t,e)=>VFe(t,GFe(e));function U_(t){return o4(s4({},t),{level:(t==null?void 0:t.level)||BFe.level})}function ZFe(t,e=bw){return t[e]||""}function JFe(t,e,r=bw){return t[r]=e,t}function zo(t,e=bw){let r="";return typeof t.bindings>"u"?r=ZFe(t,e):r=t.bindings().context||"",r}function QFe(t,e,r=bw){const n=zo(t,r);return n.trim()?`${n}/${e}`:e}function ao(t,e,r=bw){const n=QFe(t,e,r),i=t.child({context:n});return JFe(i,n,r)}function XFe(t){var e,r;const n=new zFe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:ww(o4(s4({},t.opts),{level:"trace",browser:o4(s4({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function eUe(t){var e;const r=new HFe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:ww(o4(s4({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function tUe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?XFe(t):eUe(t)}let rUe=class extends np{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},nUe=class extends np{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},iUe=class{constructor(e,r){this.logger=e,this.core=r}},sUe=class extends np{constructor(e,r){super(),this.relayer=e,this.logger=r}},oUe=class extends np{constructor(e){super()}},aUe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},lUe=class extends np{constructor(e,r){super(),this.relayer=e,this.logger=r}},cUe=class extends np{constructor(e,r){super(),this.core=e,this.logger=r}},uUe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},dUe=class{constructor(e,r){this.projectId=e,this.logger=r}},fUe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},hUe=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},pUe=class{constructor(e){this.client=e}};const gUe="PARSE_ERROR",mUe="INVALID_REQUEST",yUe="METHOD_NOT_FOUND",vUe="INVALID_PARAMS",Ite="INTERNAL_ERROR",DN="SERVER_ERROR",wUe=[-32700,-32600,-32601,-32602,-32603],Jy={[gUe]:{code:-32700,message:"Parse error"},[mUe]:{code:-32600,message:"Invalid Request"},[yUe]:{code:-32601,message:"Method not found"},[vUe]:{code:-32602,message:"Invalid params"},[Ite]:{code:-32603,message:"Internal error"},[DN]:{code:-32e3,message:"Server error"}},Tte=DN;function bUe(t){return wUe.includes(t)}function dB(t){return Object.keys(Jy).includes(t)?Jy[t]:Jy[Tte]}function _Ue(t){const e=Object.values(Jy).find(r=>r.code===t);return e||Jy[Tte]}function $te(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var kte={};/*! ***************************************************************************** + Approved: ${h.toString()}`))}),a.forEach(f=>{n||(Jh(i[f].methods,s[f].methods)?Jh(i[f].events,s[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 zFe(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 wB(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function HFe(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=sm(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function qFe(t,e){return VN(t)&&t<=e.max&&t>=e.min}function bB(){const t=vw();return new Promise(e=>{switch(t){case fo.browser:e(VFe());break;case fo.reactNative:e(GFe());break;case fo.node:e(KFe());break;default:e(!0)}})}function VFe(){return yw()&&(navigator==null?void 0:navigator.onLine)}async function GFe(){if(ch()&&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 KFe(){return!0}function YFe(t){switch(vw()){case fo.browser:ZFe(t);break;case fo.reactNative:JFe(t);break}}function ZFe(t){!ch()&&yw()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function JFe(t){ch()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const tC={};class ay{static get(e){return tC[e]}static set(e,r){tC[e]=r}static delete(e){delete tC[e]}}class ap{}let QFe=class extends ap{constructor(e){super()}};const _B=ct.FIVE_SECONDS,am={pulse:"heartbeat_pulse"};let XFe=class Gte extends QFe{constructor(e){super(e),this.events=new aa.EventEmitter,this.interval=_B,this.interval=(e==null?void 0:e.interval)||_B}static async init(e){const r=new Gte(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(am.pulse)}};function eUe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function ji(t,...e){try{return eUe(t(...e))}catch(r){return Promise.reject(r)}}function tUe(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function rUe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function D5(t){if(tUe(t))return String(t);if(rUe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return D5(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const UI="base64:";function nUe(t){return typeof t=="string"?t:UI+aUe(t)}function iUe(t){return typeof t!="string"||!t.startsWith(UI)?t:sUe(t.slice(UI.length))}function sUe(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function aUe(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function wa(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function oUe(...t){return wa(t.join(":"))}function jb(t){return t=wa(t),t?t+":":""}const lUe="memory",cUe=()=>{const t=new Map;return{name:lUe,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 uUe(t={}){const e={mounts:{"":t.driver||cUe()},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=wa(u);for(const f of e.watchListeners)f(c,u)}},s=async()=>{if(!e.watching){e.watching=!0;for(const c in e.mounts)e.unwatch[c]=await xB(e.mounts[c],i,c)}},a=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",E=wa(w?m:m.key),v=w?void 0:m.value,_=w||!m.options?u:{...u,...m.options},A=r(E);g(A).items.push({key:E,value:v,relativeKey:A.relativeKey,options:_})}return Promise.all([...h.values()].map(m=>f(m))).then(m=>m.flat())},l={hasItem(c,u={}){c=wa(c);const{relativeKey:f,driver:h}=r(c);return ji(h.hasItem,f,u)},getItem(c,u={}){c=wa(c);const{relativeKey:f,driver:h}=r(c);return ji(h.getItem,f,u).then(g=>xy(g))},getItems(c,u={}){return o(c,u,f=>f.driver.getItems?ji(f.driver.getItems,f.items.map(h=>({key:h.relativeKey,options:h.options})),u).then(h=>h.map(g=>({key:oUe(f.base,g.key),value:xy(g.value)}))):Promise.all(f.items.map(h=>ji(f.driver.getItem,h.relativeKey,h.options).then(g=>({key:h.key,value:xy(g)})))))},getItemRaw(c,u={}){c=wa(c);const{relativeKey:f,driver:h}=r(c);return h.getItemRaw?ji(h.getItemRaw,f,u):ji(h.getItem,f,u).then(g=>iUe(g))},async setItem(c,u,f={}){if(u===void 0)return l.removeItem(c);c=wa(c);const{relativeKey:h,driver:g}=r(c);g.setItem&&(await ji(g.setItem,h,D5(u),f),g.watch||i("update",c))},async setItems(c,u){await o(c,u,async f=>{if(f.driver.setItems)return ji(f.driver.setItems,f.items.map(h=>({key:h.relativeKey,value:D5(h.value),options:h.options})),u);f.driver.setItem&&await Promise.all(f.items.map(h=>ji(f.driver.setItem,h.relativeKey,D5(h.value),h.options)))})},async setItemRaw(c,u,f={}){if(u===void 0)return l.removeItem(c,f);c=wa(c);const{relativeKey:h,driver:g}=r(c);if(g.setItemRaw)await ji(g.setItemRaw,h,u,f);else if(g.setItem)await ji(g.setItem,h,nUe(u),f);else return;g.watch||i("update",c)},async removeItem(c,u={}){typeof u=="boolean"&&(u={removeMeta:u}),c=wa(c);const{relativeKey:f,driver:h}=r(c);h.removeItem&&(await ji(h.removeItem,f,u),(u.removeMeta||u.removeMata)&&await ji(h.removeItem,f+"$",u),h.watch||i("remove",c))},async getMeta(c,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),c=wa(c);const{relativeKey:f,driver:h}=r(c),g=Object.create(null);if(h.getMeta&&Object.assign(g,await ji(h.getMeta,f,u)),!u.nativeOnly){const m=await ji(h.getItem,f+"$",u).then(w=>xy(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=jb(c);const f=n(c,!0);let h=[];const g=[];for(const m of f){const w=await ji(m.driver.getKeys,m.relativeBase,u);for(const E of w){const v=m.mountpoint+wa(E);h.some(_=>v.startsWith(_))||g.push(v)}h=[m.mountpoint,...h.filter(E=>!E.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=jb(c),await Promise.all(n(c,!1).map(async f=>{if(f.driver.clear)return ji(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=>EB(c)))},async watch(c){return await s(),e.watchListeners.push(c),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==c),e.watchListeners.length===0&&await a()}},async unwatch(){e.watchListeners=[],await a()},mount(c,u){if(c=jb(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(xB(u,i,c)).then(f=>{e.unwatch[c]=f}).catch(console.error),l},async unmount(c,u=!0){var f,h;c=jb(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 EB(e.mounts[c]),e.mountpoints=e.mountpoints.filter(g=>g!==c),delete e.mounts[c])},getMount(c=""){c=wa(c)+":";const u=r(c);return{driver:u.driver,base:u.base}},getMounts(c="",u={}){return c=wa(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 xB(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function EB(t){typeof t.dispose=="function"&&await ji(t.dispose)}function op(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Kte(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=op(r);return(i,s)=>n.then(a=>s(a.transaction(e,i).objectStore(e)))}let rC;function _w(){return rC||(rC=Kte("keyval-store","keyval")),rC}function CB(t,e=_w()){return e("readonly",r=>op(r.get(t)))}function dUe(t,e,r=_w()){return r("readwrite",n=>(n.put(e,t),op(n.transaction)))}function fUe(t,e=_w()){return e("readwrite",r=>(r.delete(t),op(r.transaction)))}function hUe(t=_w()){return t("readwrite",e=>(e.clear(),op(e.transaction)))}function pUe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},op(t.transaction)}function gUe(t=_w()){return t("readonly",e=>{if(e.getAllKeys)return op(e.getAllKeys());const r=[];return pUe(e,n=>r.push(n.key)).then(()=>r)})}const mUe="idb-keyval";var yUe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Kte(t.dbName,t.storeName)),{name:mUe,options:t,async hasItem(i){return!(typeof await CB(r(i),n)>"u")},async getItem(i){return await CB(r(i),n)??null},setItem(i,s){return dUe(r(i),s,n)},removeItem(i){return fUe(r(i),n)},getKeys(){return gUe(n)},clear(){return hUe(n)}}};const vUe="WALLET_CONNECT_V2_INDEXED_DB",wUe="keyvaluestorage";let bUe=class{constructor(){this.indexedDb=uUe({driver:yUe({dbName:vUe,storeName:wUe})})}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,Sd(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var nC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},F5={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 nC<"u"&&nC.localStorage?F5.exports=nC.localStorage:typeof window<"u"&&window.localStorage?F5.exports=window.localStorage:F5.exports=new e})();function _Ue(t){var e;return[t[0],M0((e=t[1])!=null?e:"")]}let xUe=class{constructor(){this.localStorage=F5.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(_Ue)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return M0(r)}async setItem(e,r){this.localStorage.setItem(e,Sd(r))}async removeItem(e){this.localStorage.removeItem(e)}};const EUe="wc_storage_version",AB=1,CUe=async(t,e,r)=>{const n=EUe,i=await e.getItem(n);if(i&&i>=AB){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const a=[];for(;s.length;){const o=s.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),a.push(o)}}await e.setItem(n,AB),r(e),AUe(t,a)},AUe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let SUe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new xUe;this.storage=e;try{const r=new bUe;CUe(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 IUe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var TUe=$Ue;function $Ue(t,e,r){var n=r&&r.stringify||IUe,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var a=new Array(s);a[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&&(s=!1);const a=["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=hv),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:a,timestamp:jUe(t)};l.levels=Qc.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=hv,l.serializers=n,l._serialize=i,l._stdErrSerialize=s,l.child=g,e&&(l._logEvent=BI());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,qp(c,l,"error","log"),qp(c,l,"fatal","error"),qp(c,l,"warn","error"),qp(c,l,"info","log"),qp(c,l,"debug","log"),qp(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 E=w.serializers;if(i&&E){var v=Object.assign({},n,E),_=t.browser.serialize===!0?Object.keys(v):i;delete m.serializers,q_([m],_,v,this._stdErrSerialize)}function A(C){this._childLevel=(C._childLevel|0)+1,this.error=Vp(C,m,"error"),this.fatal=Vp(C,m,"fatal"),this.warn=Vp(C,m,"warn"),this.info=Vp(C,m,"info"),this.debug=Vp(C,m,"debug"),this.trace=Vp(C,m,"trace"),v&&(this.serializers=v,this._serialize=_),e&&(this._logEvent=BI([].concat(C._logEvent.bindings,m)))}return A.prototype=this,new A(this)}return l}Qc.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"}};Qc.stdSerializers=kUe;Qc.stdTimeFunctions=Object.assign({},{nullTime:Yte,epochTime:Zte,unixTime:LUe,isoTime:DUe});function qp(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?hv:i[r]?i[r]:fv[r]||fv[n]||hv,PUe(t,e,r)}function PUe(t,e,r){!t.transmit&&e[r]===hv||(e[r]=function(n){return function(){const s=t.timestamp(),a=new Array(arguments.length),o=Object.getPrototypeOf&&Object.getPrototypeOf(this)===fv?fv:this;for(var l=0;l-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function Vp(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}}}}},Jte=class{constructor(e,r=GN){this.level=e??"error",this.levelValue=e1.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new IB(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===e1.levels.values.error?console.error(e):r===e1.levels.values.warn?console.warn(e):r===e1.levels.values.debug?console.debug(e):r===e1.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Sd({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 IB(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Sd({extraMetadata:e})),new Blob(r,{type:"application/json"})}},WUe=class{constructor(e,r=GN){this.baseChunkLogger=new Jte(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)}},zUe=class{constructor(e,r=GN){this.baseChunkLogger=new Jte(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 HUe=Object.defineProperty,qUe=Object.defineProperties,VUe=Object.getOwnPropertyDescriptors,TB=Object.getOwnPropertySymbols,GUe=Object.prototype.hasOwnProperty,KUe=Object.prototype.propertyIsEnumerable,$B=(t,e,r)=>e in t?HUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u6=(t,e)=>{for(var r in e||(e={}))GUe.call(e,r)&&$B(t,r,e[r]);if(TB)for(var r of TB(e))KUe.call(e,r)&&$B(t,r,e[r]);return t},d6=(t,e)=>qUe(t,VUe(e));function V_(t){return d6(u6({},t),{level:(t==null?void 0:t.level)||UUe.level})}function YUe(t,e=Ew){return t[e]||""}function ZUe(t,e,r=Ew){return t[r]=e,t}function Wa(t,e=Ew){let r="";return typeof t.bindings>"u"?r=YUe(t,e):r=t.bindings().context||"",r}function JUe(t,e,r=Ew){const n=Wa(t,r);return n.trim()?`${n}/${e}`:e}function oa(t,e,r=Ew){const n=JUe(t,e,r),i=t.child({context:n});return ZUe(i,n,r)}function QUe(t){var e,r;const n=new WUe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:xw(d6(u6({},t.opts),{level:"trace",browser:d6(u6({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function XUe(t){var e;const r=new zUe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:xw(d6(u6({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function eBe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?QUe(t):XUe(t)}let tBe=class extends ap{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},rBe=class extends ap{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},nBe=class{constructor(e,r){this.logger=e,this.core=r}},iBe=class extends ap{constructor(e,r){super(),this.relayer=e,this.logger=r}},sBe=class extends ap{constructor(e){super()}},aBe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},oBe=class extends ap{constructor(e,r){super(),this.relayer=e,this.logger=r}},lBe=class extends ap{constructor(e,r){super(),this.core=e,this.logger=r}},cBe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},uBe=class{constructor(e,r){this.projectId=e,this.logger=r}},dBe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},fBe=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},hBe=class{constructor(e){this.client=e}};const pBe="PARSE_ERROR",gBe="INVALID_REQUEST",mBe="METHOD_NOT_FOUND",yBe="INVALID_PARAMS",Qte="INTERNAL_ERROR",KN="SERVER_ERROR",vBe=[-32700,-32600,-32601,-32602,-32603],Xy={[pBe]:{code:-32700,message:"Parse error"},[gBe]:{code:-32600,message:"Invalid Request"},[mBe]:{code:-32601,message:"Method not found"},[yBe]:{code:-32602,message:"Invalid params"},[Qte]:{code:-32603,message:"Internal error"},[KN]:{code:-32e3,message:"Server error"}},Xte=KN;function wBe(t){return vBe.includes(t)}function kB(t){return Object.keys(Xy).includes(t)?Xy[t]:Xy[Xte]}function bBe(t){const e=Object.values(Xy).find(r=>r.code===t);return e||Xy[Xte]}function ere(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var tre={};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -162,58 +189,58 @@ 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 OI=function(t,e){return OI=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])},OI(t,e)};function xUe(t,e){OI(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var jI=function(){return jI=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function AUe(t,e){return function(r,n){e(r,n,t)}}function SUe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function IUe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(f){o(f)}}function l(u){try{c(n.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})}function TUe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(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&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=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(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[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 Nte(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function NUe(){for(var t=[],e=0;e1||a(h,g)})})}function a(h,g){try{l(n[h](g))}catch(m){f(s[0][3],m)}}function l(h){h.value instanceof dv?Promise.resolve(h.value.v).then(c,u):f(s[0][2],h)}function c(h){a("next",h)}function u(h){a("throw",h)}function f(h,g){h(g),s.shift(),s.length&&a(s[0][0],s[0][1])}}function MUe(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,s){e[i]=t[i]?function(o){return(r=!r)?{value:dv(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function OUe(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 DI=="function"?DI(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}}function jUe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function DUe(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 LUe(t){return t&&t.__esModule?t:{default:t}}function FUe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function UUe(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 BUe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return jI},__asyncDelegator:MUe,__asyncGenerator:RUe,__asyncValues:OUe,__await:dv,__awaiter:IUe,__classPrivateFieldGet:FUe,__classPrivateFieldSet:UUe,__createBinding:$Ue,__decorate:CUe,__exportStar:kUe,__extends:xUe,__generator:TUe,__importDefault:LUe,__importStar:DUe,__makeTemplateObject:jUe,__metadata:SUe,__param:AUe,__read:Nte,__rest:EUe,__spread:NUe,__spreadArrays:PUe,__values:DI},Symbol.toStringTag,{value:"Module"})),WUe=qf(BUe);var Ru={},fB;function zUe(){if(fB)return Ru;fB=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.isBrowserCryptoAvailable=Ru.getSubtleCrypto=Ru.getBrowerCrypto=void 0;function t(){return(Xt==null?void 0:Xt.crypto)||(Xt==null?void 0:Xt.msCrypto)||{}}Ru.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Ru.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Ru.isBrowserCryptoAvailable=r,Ru}var Mu={},hB;function HUe(){if(hB)return Mu;hB=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.isBrowser=Mu.isNode=Mu.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Mu.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Mu.isNode=e;function r(){return!t()&&!e()}return Mu.isBrowser=r,Mu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=WUe;e.__exportStar(zUe(),t),e.__exportStar(HUe(),t)})(kte);function Bu(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Kh(t=6){return BigInt(Bu(t))}function vf(t,e,r){return{id:r||Bu(),jsonrpc:"2.0",method:t,params:e}}function B_(t,e){return{id:t,jsonrpc:"2.0",result:e}}function W_(t,e,r){return{id:t,jsonrpc:"2.0",error:qUe(e)}}function qUe(t,e){return typeof t>"u"?dB(Ite):(typeof t=="string"&&(t=Object.assign(Object.assign({},dB(DN)),{message:t})),bUe(t.code)&&(t=_Ue(t.code)),t)}let VUe=class{},GUe=class extends VUe{constructor(){super()}},KUe=class extends GUe{constructor(e){super()}};const YUe="^https?:",ZUe="^wss?:";function JUe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Pte(t,e){const r=JUe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function pB(t){return Pte(t,YUe)}function gB(t){return Pte(t,ZUe)}function QUe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Rte(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function LN(t){return Rte(t)&&"method"in t}function z_(t){return Rte(t)&&(Ic(t)||za(t))}function Ic(t){return"result"in t}function za(t){return"error"in t}let fl=class extends KUe{constructor(e){super(e),this.events=new oo.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(vf(e.method,e.params||[],e.id||Kh().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{za(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),z_(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 XUe=()=>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"),eBe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",mB=t=>t.split("?")[0],yB=10,tBe=XUe();let rBe=class{constructor(e){if(this.url=e,this.events=new oo.EventEmitter,this.registering=!1,!gB(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(Cd(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!gB(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",s=>{this.resetMaxListeners(),i(s)}),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=kte.isReactNative()?void 0:{rejectUnauthorized:!QUe(e)},s=new tBe(e,[],i);eBe()?s.onerror=o=>{const a=o;n(this.emitError(a.error))}:s.on("error",o=>{n(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),r(s)}})}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"?N0(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=W_(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return $te(e,mB(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>yB&&this.events.setMaxListeners(yB)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${mB(this.url)}`));return this.events.emit("register_error",r),r}};var a4={exports:{}};a4.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[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]",E="[object Number]",v="[object Null]",_="[object Object]",A="[object Promise]",C="[object Proxy]",R="[object RegExp]",B="[object Set]",S="[object String]",U="[object Symbol]",G="[object Undefined]",oe="[object WeakMap]",K="[object ArrayBuffer]",N="[object DataView]",k="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",P="[object Int16Array]",L="[object Int32Array]",O="[object Uint8Array]",j="[object Uint8ClampedArray]",I="[object Uint16Array]",D="[object Uint32Array]",M=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,H={};H[k]=H[b]=H[x]=H[P]=H[L]=H[O]=H[j]=H[I]=H[D]=!0,H[a]=H[l]=H[K]=H[u]=H[N]=H[f]=H[h]=H[g]=H[w]=H[E]=H[_]=H[R]=H[B]=H[S]=H[oe]=!1;var ee=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,Z=typeof self=="object"&&self&&self.Object===Object&&self,te=ee||Z||Function("return this")(),re=e&&!e.nodeType&&e,W=re&&!0&&t&&!t.nodeType&&t,q=W&&W.exports===re,J=q&&ee.process,me=function(){try{return J&&J.binding&&J.binding("util")}catch{}}(),be=me&&me.isTypedArray;function Ce(ge,$e){for(var Xe=-1,St=ge==null?0:ge.length,pn=0,gr=[];++Xe-1}function ue(ge,$e){var Xe=this.__data__,St=cc(Xe,ge);return St<0?(++this.size,Xe.push([ge,$e])):Xe[St][1]=$e,this}cr.prototype.clear=br,cr.prototype.delete=Q,cr.prototype.get=se,cr.prototype.has=de,cr.prototype.set=ue;function we(ge){var $e=-1,Xe=ge==null?0:ge.length;for(this.clear();++$edi))return!1;var gn=gr.get(ge);if(gn&&gr.get($e))return gn==$e;var ni=-1,uo=!0,fi=Xe&s?new Pt:void 0;for(gr.set(ge,$e),gr.set($e,ge);++ni-1&&ge%1==0&&ge<$e}function qw(ge){var $e=typeof ge;return $e=="string"||$e=="number"||$e=="symbol"||$e=="boolean"?ge!=="__proto__":ge===null}function Vw(ge){return!!pe&&pe in ge}function Gw(ge){var $e=ge&&ge.constructor,Xe=typeof $e=="function"&&$e.prototype||Y;return ge===Xe}function D7(ge){return ve.call(ge)}function vu(ge){if(ge!=null){try{return z.call(ge)}catch{}try{return ge+""}catch{}}return""}function Kw(ge,$e){return ge===$e||ge!==ge&&$e!==$e}var Yw=mm(function(){return arguments}())?mm:function(ge){return fh(ge)&&ie.call(ge,"callee")&&!it.call(ge,"callee")},mp=Array.isArray;function L7(ge){return ge!=null&&Zw(ge.length)&&!yp(ge)}var ym=Wt||cn;function F7(ge,$e){return dh(ge,$e)}function yp(ge){if(!Jw(ge))return!1;var $e=yu(ge);return $e==g||$e==m||$e==c||$e==C}function Zw(ge){return typeof ge=="number"&&ge>-1&&ge%1==0&&ge<=o}function Jw(ge){var $e=typeof ge;return ge!=null&&($e=="object"||$e=="function")}function fh(ge){return ge!=null&&typeof ge=="object"}var Qw=be?lt(be):Fw;function U7(ge){return L7(ge)?Ho(ge):Uw(ge)}function hn(){return[]}function cn(){return!1}t.exports=F7})(a4,a4.exports);var nBe=a4.exports;const iBe=wa(nBe),Mte="wc",Ote=2,l4="core",su=`${Mte}@2:${l4}:`,sBe={name:l4,logger:"error"},oBe={database:":memory:"},aBe="crypto",vB="client_ed25519_seed",lBe=ct.ONE_DAY,cBe="keychain",uBe="0.3",dBe="messages",fBe="0.3",wB=ct.SIX_HOURS,hBe="publisher",jte="irn",pBe="error",Dte="wss://relay.walletconnect.org",gBe="relayer",Hi={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"},mBe="_subscription",Fa={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},yBe=.1,LI="2.17.3",_n={link_mode:"link_mode",relay:"relay"},vBe="0.3",wBe="WALLETCONNECT_CLIENT_ID",bB="WALLETCONNECT_LINK_MODE_APPS",Xo={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},bBe="subscription",_Be="0.3",xBe=ct.FIVE_SECONDS*1e3,EBe="pairing",CBe="0.3",sy={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}}},Uh={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},xl={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},ABe="history",SBe="0.3",IBe="expirer",Ba={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},TBe="0.3",$Be="verify-api",kBe="https://verify.walletconnect.com",Lte="https://verify.walletconnect.org",Qy=Lte,NBe=`${Qy}/v3`,PBe=[kBe,Lte],RBe="echo",MBe="https://echo.walletconnect.com",xc={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"},ju={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"},El={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"},Sh={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"},Ih={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"},oy={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"},OBe=.1,jBe="event-client",DBe=86400,LBe="https://pulse.walletconnect.org/batch";function FBe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,C=new Uint8Array(A);v!==_;){for(var R=m[v],B=0,S=A-1;(R!==0||B>>0,C[S]=R%a>>>0,R=R/a>>>0;if(R!==0)throw new Error("Non-zero carry");E=B,v++}for(var U=A-E;U!==A&&C[U]===0;)U++;for(var G=l.repeat(w);U>>0,A=new Uint8Array(_);m[w];){var C=r[m.charCodeAt(w)];if(C===255)return;for(var R=0,B=_-1;(C!==0||R>>0,A[B]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");v=R,w++}if(m[w]!==" "){for(var S=_-v;S!==_&&A[S]===0;)S++;for(var U=new Uint8Array(E+(_-S)),G=E;S!==_;)U[G++]=A[S++];return U}}}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 UBe=FBe,BBe=UBe;const Fte=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")},WBe=t=>new TextEncoder().encode(t),zBe=t=>new TextDecoder().decode(t);class HBe{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 qBe{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 Ute(this,e)}}class VBe{constructor(e){this.decoders=e}or(e){return Ute(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 Ute=(t,e)=>new VBe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class GBe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new HBe(e,r,n),this.decoder=new qBe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const H_=({name:t,prefix:e,encode:r,decode:n})=>new GBe(t,e,r,n),_w=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=BBe(r,e);return H_({prefix:t,name:e,encode:n,decode:s=>Fte(i(s))})},KBe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(a-=8,o[c++]=255&l>>a)}if(a>=r||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return o},YBe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<H_({prefix:e,name:t,encode(i){return YBe(i,n,r)},decode(i){return KBe(i,n,r,t)}}),ZBe=H_({prefix:"\0",name:"identity",encode:t=>zBe(t),decode:t=>WBe(t)});var JBe=Object.freeze({__proto__:null,identity:ZBe});const QBe=gs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var XBe=Object.freeze({__proto__:null,base2:QBe});const eWe=gs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var tWe=Object.freeze({__proto__:null,base8:eWe});const rWe=_w({prefix:"9",name:"base10",alphabet:"0123456789"});var nWe=Object.freeze({__proto__:null,base10:rWe});const iWe=gs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),sWe=gs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var oWe=Object.freeze({__proto__:null,base16:iWe,base16upper:sWe});const aWe=gs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),lWe=gs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),cWe=gs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),uWe=gs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),dWe=gs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),fWe=gs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),hWe=gs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),pWe=gs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),gWe=gs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var mWe=Object.freeze({__proto__:null,base32:aWe,base32upper:lWe,base32pad:cWe,base32padupper:uWe,base32hex:dWe,base32hexupper:fWe,base32hexpad:hWe,base32hexpadupper:pWe,base32z:gWe});const yWe=_w({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),vWe=_w({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var wWe=Object.freeze({__proto__:null,base36:yWe,base36upper:vWe});const bWe=_w({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),_We=_w({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var xWe=Object.freeze({__proto__:null,base58btc:bWe,base58flickr:_We});const EWe=gs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),CWe=gs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),AWe=gs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),SWe=gs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var IWe=Object.freeze({__proto__:null,base64:EWe,base64pad:CWe,base64url:AWe,base64urlpad:SWe});const Bte=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),TWe=Bte.reduce((t,e,r)=>(t[r]=e,t),[]),$We=Bte.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function kWe(t){return t.reduce((e,r)=>(e+=TWe[r],e),"")}function NWe(t){const e=[];for(const r of t){const n=$We[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const PWe=H_({prefix:"🚀",name:"base256emoji",encode:kWe,decode:NWe});var RWe=Object.freeze({__proto__:null,base256emoji:PWe}),MWe=Wte,_B=128,OWe=127,jWe=~OWe,DWe=Math.pow(2,31);function Wte(t,e,r){e=e||[],r=r||0;for(var n=r;t>=DWe;)e[r++]=t&255|_B,t/=128;for(;t&jWe;)e[r++]=t&255|_B,t>>>=7;return e[r]=t|0,Wte.bytes=r-n+1,e}var LWe=FI,FWe=128,xB=127;function FI(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw FI.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&xB)<=FWe);return FI.bytes=s-n,r}var UWe=Math.pow(2,7),BWe=Math.pow(2,14),WWe=Math.pow(2,21),zWe=Math.pow(2,28),HWe=Math.pow(2,35),qWe=Math.pow(2,42),VWe=Math.pow(2,49),GWe=Math.pow(2,56),KWe=Math.pow(2,63),YWe=function(t){return t(zte.encode(t,e,r),e),CB=t=>zte.encodingLength(t),UI=(t,e)=>{const r=e.byteLength,n=CB(t),i=n+CB(r),s=new Uint8Array(i+r);return EB(t,s,0),EB(r,s,n),s.set(e,i),new JWe(t,r,e,s)};let JWe=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};const Hte=({name:t,code:e,encode:r})=>new QWe(t,e,r);let QWe=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?UI(this.code,r):r.then(n=>UI(this.code,n))}else throw Error("Unknown type, must be binary type")}};const qte=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),XWe=Hte({name:"sha2-256",code:18,encode:qte("SHA-256")}),eze=Hte({name:"sha2-512",code:19,encode:qte("SHA-512")});var tze=Object.freeze({__proto__:null,sha256:XWe,sha512:eze});const Vte=0,rze="identity",Gte=Fte,nze=t=>UI(Vte,Gte(t)),ize={code:Vte,name:rze,encode:Gte,digest:nze};var sze=Object.freeze({__proto__:null,identity:ize});new TextEncoder,new TextDecoder;const AB={...JBe,...XBe,...tWe,...nWe,...oWe,...mWe,...wWe,...xWe,...IWe,...RWe};({...tze,...sze});function oze(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Kte(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const SB=Kte("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),QE=Kte("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=oze(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:s}=ht("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=ao(r,this.name)}get context(){return zo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,lte(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?cte(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 uze{constructor(e,r,n){this.core=e,this.logger=r,this.name=aBe,this.randomSessionIdentifier=PI(),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(),s=$U(i);return ite(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=JDe();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=$U(s),a=this.randomSessionIdentifier;return await iDe(a,i,lBe,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),l=QDe(a,s);return this.setSymKey(l,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||M5(i);return await this.keychain.set(o,i),o},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,s,o)=>{this.isInitialized();const a=wte(o),l=Cd(s);if(HU(a))return eLe(l,o==null?void 0:o.encoding);if(zU(a)){const h=a.senderPublicKey,g=a.receiverPublicKey;i=await this.generateSharedKey(h,g)}const c=this.getSymKey(i),{type:u,senderPublicKey:f}=a;return XDe({type:u,symKey:c,message:l,senderPublicKey:f,encoding:o==null?void 0:o.encoding})},this.decode=async(i,s,o)=>{this.isInitialized();const a=nLe(s,o);if(HU(a)){const l=rLe(s,o==null?void 0:o.encoding);return N0(l)}if(zU(a)){const l=a.receiverPublicKey,c=a.senderPublicKey;i=await this.generateSharedKey(l,c)}try{const l=this.getSymKey(i),c=tLe({symKey:l,encoded:s,encoding:o==null?void 0:o.encoding});return N0(c)}catch(l){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}},this.getPayloadType=(i,s=yf)=>{const o=av({encoded:i,encoding:s});return R0(o.type)},this.getPayloadSenderPublicKey=(i,s=yf)=>{const o=av({encoded:i,encoding:s});return o.senderPublicKey?Ji(o.senderPublicKey,Xs):void 0},this.core=e,this.logger=ao(r,this.name),this.keychain=n||new cze(this.core,this.logger)}get context(){return zo(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(vB)}catch{e=PI(),await this.keychain.set(vB,e)}return lze(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 dze extends iUe{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=dBe,this.version=fBe,this.initialized=!1,this.storagePrefix=su,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 s=Zu(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[s]<"u"||(o[s]=i,this.messages.set(n,o),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),o=Zu(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=ao(e,this.name),this.core=r}get context(){return zo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,lte(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?cte(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 fze=Object.defineProperty,hze=Object.defineProperties,pze=Object.getOwnPropertyDescriptors,IB=Object.getOwnPropertySymbols,gze=Object.prototype.hasOwnProperty,mze=Object.prototype.propertyIsEnumerable,TB=(t,e,r)=>e in t?fze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$B=(t,e)=>{for(var r in e||(e={}))gze.call(e,r)&&TB(t,r,e[r]);if(IB)for(var r of IB(e))mze.call(e,r)&&TB(t,r,e[r]);return t},kB=(t,e)=>hze(t,pze(e));class yze extends sUe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new oo.EventEmitter,this.name=hBe,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,s)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});const a=(s==null?void 0:s.ttl)||wB,l=n4(s),c=(s==null?void 0:s.prompt)||!1,u=(s==null?void 0:s.tag)||0,f=(s==null?void 0:s.id)||Kh().toString(),h={topic:n,message:i,opts:{ttl:a,relay:l,prompt:c,tag:u,id:f,attestation:s==null?void 0:s.attestation}},g=`Failed to publish payload, please try again. id:${f} tag:${u}`;try{const m=new Promise(async w=>{const E=({id:_})=>{h.opts.id===_&&(this.removeRequestFromQueue(_),this.relayer.events.removeListener(Hi.publish,E),w(h))};this.relayer.events.on(Hi.publish,E);const v=mf(new Promise((_,A)=>{this.rpcPublish({topic:n,message:i,ttl:a,prompt:c,tag:u,id:f,attestation:s==null?void 0:s.attestation}).then(_).catch(C=>{this.logger.warn(C,C==null?void 0:C.message),A(C)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${f} tag:${u}`);try{await v,this.events.removeListener(Hi.publish,E)}catch(_){this.queue.set(f,kB($B({},h),{attempt:1})),this.logger.warn(_,_==null?void 0:_.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,topic:n,message:i,opts:s}}),await mf(m,this.publishTimeout,g)}catch(m){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(m),(o=s==null?void 0:s.internal)!=null&&o.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=ao(r,this.name),this.registerEventListeners()}get context(){return zo(this.logger)}async rpcPublish(e){var r,n,i,s;const{topic:o,message:a,ttl:l=wB,prompt:c,tag:u,id:f,attestation:h}=e,g={method:Ay(n4().protocol).publish,params:{topic:o,message:a,ttl:l,prompt:c,tag:u,attestation:h},id:f};Io((r=g.params)==null?void 0:r.prompt)&&((n=g.params)==null||delete n.prompt),Io((i=g.params)==null?void 0:i.tag)&&((s=g.params)==null||delete s.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(Hi.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,kB($B({},e),{attempt:n}));const{topic:i,message:s,opts:o,attestation:a}=e;this.logger.warn({},`Publisher: queue->publishing: ${e.opts.id}, tag: ${e.opts.tag}, attempt: ${n}`),await this.rpcPublish({topic:i,message:s,ttl:o.ttl,prompt:o.prompt,tag:o.tag,id:o.id,attestation:a}),this.logger.warn({},`Publisher: queue->published: ${e.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(im.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Hi.connection_stalled);return}this.checkQueue()}),this.relayer.on(Hi.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class vze{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(s=>s!==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 wze=Object.defineProperty,bze=Object.defineProperties,_ze=Object.getOwnPropertyDescriptors,NB=Object.getOwnPropertySymbols,xze=Object.prototype.hasOwnProperty,Eze=Object.prototype.propertyIsEnumerable,PB=(t,e,r)=>e in t?wze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ay=(t,e)=>{for(var r in e||(e={}))xze.call(e,r)&&PB(t,r,e[r]);if(NB)for(var r of NB(e))Eze.call(e,r)&&PB(t,r,e[r]);return t},XE=(t,e)=>bze(t,_ze(e));class Cze extends lUe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new vze,this.events=new oo.EventEmitter,this.name=bBe,this.version=_Be,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=su,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 s=n4(i),o={topic:n,relay:s,transportType:i==null?void 0:i.transportType};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s,i);return typeof a=="string"&&(this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},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((s,o)=>{const a=new ct.Watch;a.start(i);const l=setInterval(()=>{(!this.pending.has(n)&&this.topics.includes(n)||this.cached.some(c=>c.topic===n))&&(clearInterval(l),a.stop(i),s(!0)),a.elapsed(i)>=xBe&&(clearInterval(l),a.stop(i),o(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(im.pulse,async()=>{await this.checkPending()}),this.events.on(Xo.created,async n=>{const i=Xo.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()}),this.events.on(Xo.deleted,async n=>{const i=Xo.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()})},this.relayer=e,this.logger=ao(r,this.name),this.clientId=""}get context(){return zo(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=n4(n);await this.rpcUnsubscribe(e,r,i);const s=sn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),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)===_n.relay&&await this.restartToComplete();const s={method:Ay(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const o=(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;try{const a=this.getSubscriptionId(e);if((n==null?void 0:n.transportType)===_n.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(u=>this.logger.warn(u))},ct.toMiliseconds(ct.ONE_SECOND)),a;const l=new Promise(async u=>{const f=h=>{h.topic===e&&(this.events.removeListener(Xo.created,f),u(h.id))};this.events.on(Xo.created,f);try{const h=await mf(new Promise((g,m)=>{this.relayer.request(s).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(Xo.created,f),u(h)}catch{}}),c=await mf(l,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!c&&o)throw new Error(`Subscribing to ${e} failed, please try again`);return c?a:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Hi.connection_stalled),o)throw a}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:Ay(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 mf(new Promise(i=>{this.relayer.request(n).catch(s=>this.logger.warn(s)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(Hi.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:Ay(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await mf(new Promise((s,o)=>{this.relayer.request(n).catch(a=>{this.logger.warn(a),o(a)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(Hi.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:Ay(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,XE(ay({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,ay({},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,ay({},r)),this.topicMap.set(r.topic,e),this.events.emit(Xo.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(Xo.deleted,XE(ay({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Xo.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=>XE(ay({},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 SDe(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 Zu(e+this.clientId)}}var Aze=Object.defineProperty,RB=Object.getOwnPropertySymbols,Sze=Object.prototype.hasOwnProperty,Ize=Object.prototype.propertyIsEnumerable,MB=(t,e,r)=>e in t?Aze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,OB=(t,e)=>{for(var r in e||(e={}))Sze.call(e,r)&&MB(t,r,e[r]);if(RB)for(var r of RB(e))Ize.call(e,r)&&MB(t,r,e[r]);return t};class Tze extends oUe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new oo.EventEmitter,this.name=gBe,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 s=r.id||Kh().toString();await this.toEstablishConnection();try{this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - publishing...");const o=`${s}:${((i=r.params)==null?void 0:i.tag)||""}`;this.requestsInFlight.push(o);const a=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(l=>l!==o),a}catch(o){throw this.logger.debug(`Failed to Publish Request: ${s}`),o}},this.resetPingTimeout=()=>{if(t4())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(Hi.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(Hi.error,r),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Fa.payload,this.onPayloadHandler),this.provider.on(Fa.connect,this.onConnectHandler),this.provider.on(Fa.disconnect,this.onDisconnectHandler),this.provider.on(Fa.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?ao(e.logger,this.name):ww(U_({level:e.logger||pBe})),this.messages=new dze(this.logger,e.core),this.subscriber=new Cze(this,this.logger),this.publisher=new yze(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Dte,this.projectId=e.projectId,hDe()?this.packageName=MU():pDe()&&(this.bundleId=MU()),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 zo(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:_n.relay})}async subscribe(e,r){var n,i,s;this.isInitialized(),(!(r!=null&&r.transportType)||(r==null?void 0:r.transportType)==="relay")&&await this.toEstablishConnection();const o=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 a=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",l;const c=u=>{u.topic===e&&(this.subscriber.off(Xo.created,c),l())};return await Promise.all([new Promise(u=>{l=u,this.subscriber.on(Xo.created,c)}),new Promise(async(u,f)=>{a=await this.subscriber.subscribe(e,OB({internal:{throwOnFailedPublish:o}},r)).catch(h=>{o&&f(h)})||a,u()})]),a}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 mf(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 tB())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=Ci(ct.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(Hi.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 s=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Fa.disconnect,s),await mf(new Promise((o,a)=>{this.provider.connect().then(o).catch(a)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{i(o)}).finally(()=>{this.provider.off(Fa.disconnect,s),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),await new Promise(async(o,a)=>{const l=()=>{a(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Fa.disconnect,l),await this.subscriber.start().then(o).catch(a).finally(()=>{this.provider.off(Fa.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,s;if(t4())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||s.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o,o==null?void 0:o.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new fl(new rBe(vDe({sdkVersion:LI,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}),LN(e)){if(!e.method.endsWith(mBe))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:o}=r.data,a={topic:n,message:i,publishedAt:s,transportType:_n.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(OB({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else z_(e)&&this.events.emit(Hi.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Hi.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=B_(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Fa.payload,this.onPayloadHandler),this.provider.off(Fa.connect,this.onConnectHandler),this.provider.off(Fa.disconnect,this.onDisconnectHandler),this.provider.off(Fa.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await tB();ZLe(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(Hi.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(yBe))))}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 $ze=Object.defineProperty,jB=Object.getOwnPropertySymbols,kze=Object.prototype.hasOwnProperty,Nze=Object.prototype.propertyIsEnumerable,DB=(t,e,r)=>e in t?$ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,LB=(t,e)=>{for(var r in e||(e={}))kze.call(e,r)&&DB(t,r,e[r]);if(jB)for(var r of jB(e))Nze.call(e,r)&&DB(t,r,e[r]);return t};class sp extends aUe{constructor(e,r,n,i=su,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=vBe,this.cached=[],this.initialized=!1,this.storagePrefix=su,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!Io(o)?this.map.set(this.getKey(o),o):ILe(o)?this.map.set(o.id,o):TLe(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},this.set=async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(l=>iBe(a[l],o[l]))):this.values),this.update=async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const l=LB(LB({},this.getData(o)),a);this.map.set(o,l),await this.persist()},this.delete=async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())},this.logger=ao(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return zo(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 Pze{constructor(e,r){this.core=e,this.logger=r,this.name=EBe,this.version=CBe,this.events=new Rk,this.initialized=!1,this.storagePrefix=su,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=PI(),s=await this.core.crypto.setSymKey(i),o=Ci(ct.FIVE_MINUTES),a={protocol:jte},l={topic:s,expiry:o,relay:a,active:!1,methods:n==null?void 0:n.methods},c=YU({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:a,expiryTimestamp:o,methods:n==null?void 0:n.methods});return this.events.emit(Uh.create,l),this.core.expirer.set(s,o),await this.pairings.set(s,l),await this.core.relayer.subscribe(s,{transportType:n==null?void 0:n.transportType}),{topic:s,uri:c}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[xc.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:l,methods:c}=KU(n.uri);i.props.properties.topic=s,i.addTrace(xc.pairing_uri_validation_success),i.addTrace(xc.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(s)){if(u=this.pairings.get(s),i.addTrace(xc.existing_pairing),u.active)throw i.setError(ju.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(xc.pairing_not_expired)}const f=l||Ci(ct.FIVE_MINUTES),h={topic:s,relay:a,expiry:f,active:!1,methods:c};this.core.expirer.set(s,f),await this.pairings.set(s,h),i.addTrace(xc.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(Uh.create,h),i.addTrace(xc.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(xc.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(ju.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(g){throw i.setError(ju.subscribe_pairing_topic_failure),g}return i.addTrace(xc.subscribe_pairing_topic_success),h},this.activate=async({topic:n})=>{this.isInitialized();const i=Ci(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 s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:l}=Ph();this.events.once(Nr("pairing_ping",s),({error:c})=>{c?l(c):a()}),await o()}},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",sn("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:s,expiry:o,methods:a}=n,l=this.core.crypto.keychain.get(i);return YU({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:l,relay:s,expiryTimestamp:o,methods:a})},this.sendRequest=async(n,i,s)=>{const o=vf(i,s),a=await this.core.crypto.encode(n,o),l=sy[i].req;return this.core.history.set(n,o),this.core.relayer.publish(n,a,l),o.id},this.sendResult=async(n,i,s)=>{const o=B_(n,s),a=await this.core.crypto.encode(i,o),l=await this.core.history.get(i,n),c=sy[l.request.method].res;await this.core.relayer.publish(i,a,c),await this.core.history.resolve(o)},this.sendError=async(n,i,s)=>{const o=W_(n,s),a=await this.core.crypto.encode(i,o),l=await this.core.history.get(i,n),c=sy[l.request.method]?sy[l.request.method].res:sy.unregistered_method.res;await this.core.relayer.publish(i,a,c),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,sn("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=>sf(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(Uh.ping,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{Ic(i)?this.events.emit(Nr("pairing_ping",s),{}):za(i)&&this.events.emit(Nr("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(Uh.delete,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=sn("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(sn("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var s;if(!_o(n)){const{message:a}=ht("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(ju.malformed_pairing_uri),new Error(a)}if(!SLe(n.uri)){const{message:a}=ht("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(ju.malformed_pairing_uri),new Error(a)}const o=KU(n==null?void 0:n.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=ht("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(ju.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=ht("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(ju.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&ct.toMiliseconds(o==null?void 0:o.expiryTimestamp){if(!_o(n)){const{message:s}=ht("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!_o(n)){const{message:s}=ht("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!li(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(sf(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=ao(r,this.name),this.pairings=new sp(this.core,this.logger,this.name,this.storagePrefix)}get context(){return zo(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Hi.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===_n.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const s=await this.core.crypto.decode(r,n);try{LN(s)?(this.core.history.set(r,s),this.onRelayEventRequest({topic:r,payload:s})):z_(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id))}catch(o){this.logger.error(o)}})}registerExpirerEvents(){this.core.expirer.on(Ba.expired,async e=>{const{topic:r}=dte(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Uh.expire,{topic:r}))})}}class Rze extends nUe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new oo.EventEmitter,this.name=ABe,this.version=SBe,this.cached=[],this.initialized=!1,this.storagePrefix=su,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,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:Ci(ct.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(xl.created,o)},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=za(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(xl.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(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(xl.deleted,s)}}),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=ao(r,this.name)}get context(){return zo(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:vf(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(xl.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(xl.created,e=>{const r=xl.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xl.updated,e=>{const r=xl.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xl.deleted,e=>{const r=xl.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(im.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(xl.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 Mze extends cUe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new oo.EventEmitter,this.name=IBe,this.version=TBe,this.cached=[],this.initialized=!1,this.storagePrefix=su,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 s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Ba.created,{target:s,expiration:o})},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),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Ba.deleted,{target:i,expiration:s})}},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=ao(r,this.name)}get context(){return zo(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 wDe(e);if(typeof e=="number")return bDe(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(Ba.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(Ba.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(im.pulse,()=>this.checkExpirations()),this.events.on(Ba.created,e=>{const r=Ba.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Ba.expired,e=>{const r=Ba.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Ba.deleted,e=>{const r=Ba.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 Oze extends uUe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=$Be,this.verifyUrlV3=NBe,this.storagePrefix=su,this.version=Ote,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(!pw()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:a}=i,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;try{const c=lw(),u=this.startAbortTimer(ct.ONE_SECOND*5),f=await new Promise((h,g)=>{const m=()=>{window.removeEventListener("message",E),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 E=v=>{if(v.data&&typeof v.data=="string")try{const _=JSON.parse(v.data);if(_.type==="verify_attestation"){if(kI(_.attestation).payload.id!==o)return;clearInterval(u),c.body.removeChild(w),this.abortController.signal.removeEventListener("abort",m),window.removeEventListener("message",E),h(_.attestation===null?"":_.attestation)}}catch(_){this.logger.warn(_)}};c.body.appendChild(w),window.addEventListener("message",E,{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:s,hash:o,encryptedId:a}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(kI(s).payload.id!==a)return;const c=await this.isValidJwtAttestation(s);if(c){if(!c.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return c}}if(!o)return;const l=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,l)},this.fetchAttestation=async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const o=this.startAbortTimer(ct.ONE_SECOND*5),a=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0},this.getVerifyUrl=i=>{let s=i||Qy;return PBe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${Qy}`),s=Qy),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(ct.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.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 s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(a){this.logger.error(a),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 s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,s)=>{const o=aLe(i,s.publicKey),a={hasExpired:ct.toMiliseconds(o.exp)this.abortController.abort(),ct.toMiliseconds(e))}}class jze extends dUe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=RBe,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,l=`${MBe}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})},this.logger=ao(r,this.context)}}var Dze=Object.defineProperty,FB=Object.getOwnPropertySymbols,Lze=Object.prototype.hasOwnProperty,Fze=Object.prototype.propertyIsEnumerable,UB=(t,e,r)=>e in t?Dze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ly=(t,e)=>{for(var r in e||(e={}))Lze.call(e,r)&&UB(t,r,e[r]);if(FB)for(var r of FB(e))Fze.call(e,r)&&UB(t,r,e[r]);return t};class Uze extends fUe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=jBe,this.storagePrefix=su,this.storageVersion=OBe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!NN())try{const i={eventId:jU(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:ate(this.core.relayer.protocol,this.core.relayer.version,LI)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:l}}=i,c=jU(),u=this.core.projectId||"",f=Date.now(),h=ly({eventId:c,timestamp:f,props:{event:s,type:o,properties:{topic:a,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:s,topic:o}=i;if(s)return this.events.get(s);const a=Array.from(this.events.values()).find(l=>l.props.properties.topic===o);if(a)return ly(ly({},a),this.setMethods(a.eventId))},this.deleteEvent=i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(im.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{ct.fromMiliseconds(Date.now())-ct.fromMiliseconds(i.timestamp)>DBe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)}),this.addTrace=(i,s)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(s),this.events.set(i,o),this.shouldPersist=!0)},this.setError=(i,s)=>{const o=this.events.get(i);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(i,o),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(s=>{this.events.set(s.eventId,ly(ly({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.sendEvent=async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${LBe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${LI}${s}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>ote().url,this.logger=ao(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 Bze=Object.defineProperty,BB=Object.getOwnPropertySymbols,Wze=Object.prototype.hasOwnProperty,zze=Object.prototype.propertyIsEnumerable,WB=(t,e,r)=>e in t?Bze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zB=(t,e)=>{for(var r in e||(e={}))Wze.call(e,r)&&WB(t,r,e[r]);if(BB)for(var r of BB(e))zze.call(e,r)&&WB(t,r,e[r]);return t};let Hze=class Yte extends rUe{constructor(e){var r;super(e),this.protocol=Mte,this.version=Ote,this.name=l4,this.events=new oo.EventEmitter,this.initialized=!1,this.on=(o,a)=>this.events.on(o,a),this.once=(o,a)=>this.events.once(o,a),this.off=(o,a)=>this.events.off(o,a),this.removeListener=(o,a)=>this.events.removeListener(o,a),this.dispatchEnvelope=({topic:o,message:a,sessionExists:l})=>{if(!o||!a)return;const c={topic:o,message:a,publishedAt:Date.now(),transportType:_n.link_mode};this.relayer.onLinkMessageEvent(c,{sessionExists:l})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Dte,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=U_({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:sBe.logger,name:l4}),{logger:i,chunkLoggerController:s}=tUe({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=s,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,a;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((a=this.logChunkController)==null||a.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=ao(i,this.name),this.heartbeat=new eFe,this.crypto=new uze(this,this.logger,e==null?void 0:e.keychain),this.history=new Rze(this,this.logger),this.expirer=new Mze(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new IFe(zB(zB({},oBe),e==null?void 0:e.storageOptions)),this.relayer=new Tze({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Pze(this,this.logger),this.verify=new Oze(this,this.logger,this.storage),this.echoClient=new jze(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new Uze(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new Yte(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(wBe,n),r}get context(){return zo(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(bB,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(bB)||[],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 qze=Hze,Zte="wc",Jte=2,Qte="client",FN=`${Zte}@${Jte}:${Qte}:`,eC={name:Qte,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},HB="WALLETCONNECT_DEEPLINK_CHOICE",Vze="proposal",Xte="Proposal expired",Gze="session",qp=ct.SEVEN_DAYS,Kze="engine",Ri={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}}},tC={min:ct.FIVE_MINUTES,max:ct.SEVEN_DAYS},bc={idle:"IDLE",active:"ACTIVE"},Yze="request",Zze=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],Jze="wc",Qze="auth",Xze="authKeys",eHe="pairingTopics",tHe="requests",q_=`${Jze}@${1.5}:${Qze}:`,D5=`${q_}:PUB_KEY`;var rHe=Object.defineProperty,nHe=Object.defineProperties,iHe=Object.getOwnPropertyDescriptors,qB=Object.getOwnPropertySymbols,sHe=Object.prototype.hasOwnProperty,oHe=Object.prototype.propertyIsEnumerable,VB=(t,e,r)=>e in t?rHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zn=(t,e)=>{for(var r in e||(e={}))sHe.call(e,r)&&VB(t,r,e[r]);if(qB)for(var r of qB(e))oHe.call(e,r)&&VB(t,r,e[r]);return t},Cl=(t,e)=>nHe(t,iHe(e));class aHe extends pUe{constructor(e){super(e),this.name=Kze,this.events=new Rk,this.initialized=!1,this.requestQueue={state:bc.idle,queue:[]},this.sessionRequestQueue={state:bc.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(Ri)}),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=Cl(Zn({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:l}=n;let c=i,u,f=!1;try{c&&(f=this.client.core.pairing.pairings.get(c).active)}catch(C){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),C}if(!c||!f){const{topic:C,uri:R}=await this.client.core.pairing.create();c=C,u=R}if(!c){const{message:C}=ht("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(C)}const h=await this.client.core.crypto.generateKeyPair(),g=Ri.wc_sessionPropose.req.ttl||ct.FIVE_MINUTES,m=Ci(g),w=Zn({requiredNamespaces:s,optionalNamespaces:o,relays:l??[{protocol:jte}],proposer:{publicKey:h,metadata:this.client.metadata},expiryTimestamp:m,pairingTopic:c},a&&{sessionProperties:a}),{reject:E,resolve:v,done:_}=Ph(g,Xte);this.events.once(Nr("session_connect"),async({error:C,session:R})=>{if(C)E(C);else if(R){R.self.publicKey=h;const B=Cl(Zn({},R),{pairingTopic:w.pairingTopic,requiredNamespaces:w.requiredNamespaces,optionalNamespaces:w.optionalNamespaces,transportType:_n.relay});await this.client.session.set(R.topic,B),await this.setExpiry(R.topic,R.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:R.peer.metadata}),this.cleanupDuplicatePairings(B),v(B)}});const A=await this.sendRequest({topic:c,method:"wc_sessionPropose",params:w,throwOnFailedPublish:!0});return await this.setProposal(A,Zn({id:A},w)),{uri:u,approval:_}},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,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[El.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(U){throw o.setError(Sh.no_internet_connection),U}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(U){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(Sh.proposal_not_found),U}try{await this.isValidApprove(r)}catch(U){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(Sh.session_approve_namespace_validation_failure),U}const{id:a,relayProtocol:l,namespaces:c,sessionProperties:u,sessionConfig:f}=r,h=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:g,proposer:m,requiredNamespaces:w,optionalNamespaces:E}=h;let v=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});v||(v=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:El.session_approve_started,properties:{topic:g,trace:[El.session_approve_started,El.session_namespaces_validation_success]}}));const _=await this.client.core.crypto.generateKeyPair(),A=m.publicKey,C=await this.client.core.crypto.generateSharedKey(_,A),R=Zn(Zn({relay:{protocol:l??"irn"},namespaces:c,controller:{publicKey:_,metadata:this.client.metadata},expiry:Ci(qp)},u&&{sessionProperties:u}),f&&{sessionConfig:f}),B=_n.relay;v.addTrace(El.subscribing_session_topic);try{await this.client.core.relayer.subscribe(C,{transportType:B})}catch(U){throw v.setError(Sh.subscribe_session_topic_failure),U}v.addTrace(El.subscribe_session_topic_success);const S=Cl(Zn({},R),{topic:C,requiredNamespaces:w,optionalNamespaces:E,pairingTopic:g,acknowledged:!1,self:R.controller,peer:{publicKey:m.publicKey,metadata:m.metadata},controller:_,transportType:_n.relay});await this.client.session.set(C,S),v.addTrace(El.store_session);try{v.addTrace(El.publishing_session_settle),await this.sendRequest({topic:C,method:"wc_sessionSettle",params:R,throwOnFailedPublish:!0}).catch(U=>{throw v==null||v.setError(Sh.session_settle_publish_failure),U}),v.addTrace(El.session_settle_publish_success),v.addTrace(El.publishing_session_approve),await this.sendResult({id:a,topic:g,result:{relay:{protocol:l??"irn"},responderPublicKey:_},throwOnFailedPublish:!0}).catch(U=>{throw v==null||v.setError(Sh.session_approve_publish_failure),U}),v.addTrace(El.session_approve_publish_success)}catch(U){throw this.client.logger.error(U),this.client.session.delete(C,sn("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(C),U}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(a,sn("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(C,Ci(qp)),{topic:C,acknowledged:()=>Promise.resolve(this.client.session.get(C))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:n,reason:i}=r;let s;try{s=this.client.proposal.get(n).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),o}s&&(await this.sendError({id:n,topic:s,error:i,rpcOpts:Ri.wc_sessionPropose.reject}),await this.client.proposal.delete(n,sn("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:s,resolve:o,reject:a}=Ph(),l=Bu(),c=Kh().toString(),u=this.client.session.get(n).namespaces;return this.events.once(Nr("session_update",l),({error:f})=>{f?a(f):o()}),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}),a(f)}),{acknowledged:s}},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=Bu(),{done:s,resolve:o,reject:a}=Ph();return this.events.once(Nr("session_extend",i),({error:l})=>{l?a(l):o()}),await this.setExpiry(n,Ci(qp)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(l=>{a(l)}),{acknowledged:s}},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:s,expiry:o=Ri.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);(a==null?void 0:a.transportType)===_n.relay&&await this.confirmOnlineStateOrThrow();const l=Bu(),c=Kh().toString(),{done:u,resolve:f,reject:h}=Ph(o,"Request expired. Please try again.");this.events.once(Nr("session_request",l),({error:m,result:w})=>{m?h(m):f(w)});const g=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);return g?(await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:s,method:"wc_sessionRequest",params:{request:Cl(Zn({},i),{expiryTimestamp:Ci(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:g}).catch(m=>h(m)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:l}),await u()):await Promise.all([new Promise(async m=>{await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:s,method:"wc_sessionRequest",params:{request:Cl(Zn({},i),{expiryTimestamp:Ci(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0}).catch(w=>h(w)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:l}),m()}),new Promise(async m=>{var w;if(!((w=a.sessionConfig)!=null&&w.disableDeepLink)){const E=await EDe(this.client.core.storage,HB);await _De({id:l,topic:s,wcDeepLink:E})}m()}),u()]).then(m=>m[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i,o=this.client.session.get(n);o.transportType===_n.relay&&await this.confirmOnlineStateOrThrow();const a=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);Ic(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:a}):za(i)&&await this.sendError({id:s,topic:n,error:i.error,appLink:a}),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=Bu(),s=Kh().toString(),{done:o,resolve:a,reject:l}=Ph();this.events.once(Nr("session_ping",i),({error:c})=>{c?l(c):a()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),o()])}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:s}=r,o=Kh().toString(),a=Bu();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:a})},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:sn("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=>CLe(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const s=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=s?_n.link_mode:_n.relay;o===_n.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:l="",uri:c,domain:u,nonce:f,type:h,exp:g,nbf:m,methods:w=[],expiry:E}=r,v=[...r.resources||[]],{topic:_,uri:A}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:_,uri:A}});const C=await this.client.core.crypto.generateKeyPair(),R=M5(C);if(await Promise.all([this.client.auth.authKeys.set(D5,{responseTopic:R,publicKey:C}),this.client.auth.pairingTopics.set(R,{topic:R,pairingTopic:_})]),await this.client.core.relayer.subscribe(R,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${_}`),w.length>0){const{namespace:O}=L1(a[0]);let j=qDe(O,"request",w);R5(v)&&(j=GDe(j,v.pop())),v.push(j)}const B=E&&E>Ri.wc_sessionAuthenticate.req.ttl?E:Ri.wc_sessionAuthenticate.req.ttl,S={authPayload:{type:h??"caip122",chains:a,statement:l,aud:c,domain:u,version:"1",nonce:f,iat:new Date().toISOString(),exp:g,nbf:m,resources:v},requester:{publicKey:C,metadata:this.client.metadata},expiryTimestamp:Ci(B)},U={eip155:{chains:a,methods:[...new Set(["personal_sign",...w])],events:["chainChanged","accountsChanged"]}},G={requiredNamespaces:{},optionalNamespaces:U,relays:[{protocol:"irn"}],pairingTopic:_,proposer:{publicKey:C,metadata:this.client.metadata},expiryTimestamp:Ci(Ri.wc_sessionPropose.req.ttl)},{done:oe,resolve:K,reject:N}=Ph(B,"Request expired"),k=async({error:O,session:j})=>{if(this.events.off(Nr("session_request",x),b),O)N(O);else if(j){j.self.publicKey=C,await this.client.session.set(j.topic,j),await this.setExpiry(j.topic,j.expiry),_&&await this.client.core.pairing.updateMetadata({topic:_,metadata:j.peer.metadata});const I=this.client.session.get(j.topic);await this.deleteProposal(P),K({session:I})}},b=async O=>{var j,I,D;if(await this.deletePendingAuthRequest(x,{message:"fulfilled",code:0}),O.error){const te=sn("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return O.error.code===te.code?void 0:(this.events.off(Nr("session_connect"),k),N(O.error.message))}await this.deleteProposal(P),this.events.off(Nr("session_connect"),k);const{cacaos:M,responder:X}=O.result,le=[],H=[];for(const te of M){await FU({cacao:te,projectId:this.client.core.projectId})||(this.client.logger.error(te,"Signature verification failed"),N(sn("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:re}=te,W=R5(re.resources),q=[NI(re.iss)],J=r4(re.iss);if(W){const me=UU(W),be=BU(W);le.push(...me),q.push(...be)}for(const me of q)H.push(`${me}:${J}`)}const ee=await this.client.core.crypto.generateSharedKey(C,X.publicKey);let Z;le.length>0&&(Z={topic:ee,acknowledged:!0,self:{publicKey:C,metadata:this.client.metadata},peer:X,controller:X.publicKey,expiry:Ci(qp),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:_,namespaces:ZU([...new Set(le)],[...new Set(H)]),transportType:o},await this.client.core.relayer.subscribe(ee,{transportType:o}),await this.client.session.set(ee,Z),_&&await this.client.core.pairing.updateMetadata({topic:_,metadata:X.metadata}),Z=this.client.session.get(ee)),(j=this.client.metadata.redirect)!=null&&j.linkMode&&(I=X.metadata.redirect)!=null&&I.linkMode&&(D=X.metadata.redirect)!=null&&D.universal&&n&&(this.client.core.addLinkModeSupportedApp(X.metadata.redirect.universal),this.client.session.update(ee,{transportType:_n.link_mode})),K({auths:M,session:Z})},x=Bu(),P=Bu();this.events.once(Nr("session_connect"),k),this.events.once(Nr("session_request",x),b);let L;try{if(s){const O=vf("wc_sessionAuthenticate",S,x);this.client.core.history.set(_,O);const j=await this.client.core.crypto.encode("",O,{type:yw,encoding:ny});L=Pb(n,_,j)}else await Promise.all([this.sendRequest({topic:_,method:"wc_sessionAuthenticate",params:S,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:x}),this.sendRequest({topic:_,method:"wc_sessionPropose",params:G,expiry:Ri.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:P})])}catch(O){throw this.events.off(Nr("session_connect"),k),this.events.off(Nr("session_request",x),b),O}return await this.setProposal(P,Zn({id:P},G)),await this.setAuthRequest(x,{request:Cl(Zn({},S),{verifyContext:{}}),pairingTopic:_,transportType:o}),{uri:L??A,response:oe}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[Ih.authenticated_session_approve_started]}});try{this.isInitialized()}catch(E){throw s.setError(oy.no_internet_connection),E}const o=this.getPendingAuthRequest(n);if(!o)throw s.setError(oy.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const a=o.transportType||_n.relay;a===_n.relay&&await this.confirmOnlineStateOrThrow();const l=o.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),u=M5(l),f={type:ad,receiverPublicKey:l,senderPublicKey:c},h=[],g=[];for(const E of i){if(!await FU({cacao:E,projectId:this.client.core.projectId})){s.setError(oy.invalid_cacao);const R=sn("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:R,encodeOpts:f}),new Error(R.message)}s.addTrace(Ih.cacaos_verified);const{p:v}=E,_=R5(v.resources),A=[NI(v.iss)],C=r4(v.iss);if(_){const R=UU(_),B=BU(_);h.push(...R),A.push(...B)}for(const R of A)g.push(`${R}:${C}`)}const m=await this.client.core.crypto.generateSharedKey(c,l);s.addTrace(Ih.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:o.requester.metadata},controller:l,expiry:Ci(qp),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:ZU([...new Set(h)],[...new Set(g)]),transportType:a},s.addTrace(Ih.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(m,{transportType:a})}catch(E){throw s.setError(oy.subscribe_authenticated_session_topic_failure),E}s.addTrace(Ih.subscribe_authenticated_session_topic_success),await this.client.session.set(m,w),s.addTrace(Ih.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace(Ih.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(o.requester.metadata,a)})}catch(E){throw s.setError(oy.authenticated_session_approve_publish_failure),E}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:w}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===_n.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),l=M5(o),c={type:ad,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:n,topic:l,error:i,encodeOpts:c,rpcOpts:Ri.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,sn("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return hte(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(s=>{var o,a;return((o=s.peerMetadata)==null?void 0:o.url)&&((a=s.peerMetadata)==null?void 0:a.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.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:s=!1,emitEvent:o=!0,id:a=0}=r,{self:l}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,sn("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),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(HB).catch(c=>this.client.logger.warn(c)),this.getPendingSessionRequests().forEach(c=>{c.topic===i&&this.deletePendingSessionRequest(c.id,sn("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=bc.idle),o&&this.client.events.emit("session_delete",{id:a,topic:i})},this.deleteProposal=async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(Sh.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,sn("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(s=>s.id!==r),i&&(this.sessionRequestQueue.state=bc.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,Ci(Ri.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:s,transportType:o=_n.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:s,verifyContext:i.verifyContext,transportType:o})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:s,verifyContext:o}=r,a=s.request.expiryTimestamp||Ci(Ri.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,a),await this.client.pendingRequest.set(n,{id:n,topic:i,params:s,verifyContext:o})},this.sendRequest=async r=>{const{topic:n,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:l,throwOnFailedPublish:c,appLink:u}=r,f=vf(i,s,l);let h;const g=!!u;try{const E=g?ny:yf;h=await this.client.core.crypto.encode(n,f,{encoding:E})}catch(E){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),E}let m;if(Zze.includes(i)){const E=Zu(JSON.stringify(f)),v=Zu(h);m=await this.client.core.verify.register({id:v,decryptedId:E})}const w=Ri[i].req;if(w.attestation=m,o&&(w.ttl=o),a&&(w.id=a),this.client.core.history.set(n,f),g){const E=Pb(u,n,h);await global.Linking.openURL(E,this.client.name)}else{const E=Ri[i].req;o&&(E.ttl=o),a&&(E.id=a),c?(E.internal=Cl(Zn({},E.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,h,E)):this.client.core.relayer.publish(n,h,E).catch(v=>this.client.logger.error(v))}return f.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:l}=r,c=B_(n,s);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?ny:yf;u=await this.client.core.crypto.encode(i,c,Cl(Zn({},a||{}),{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=Pb(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=Ri[h.request.method].res;o?(g.internal=Cl(Zn({},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:s,encodeOpts:o,rpcOpts:a,appLink:l}=r,c=W_(n,s);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?ny:yf;u=await this.client.core.crypto.encode(i,c,Cl(Zn({},o||{}),{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=Pb(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=a||Ri[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 s=!1;sf(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{sf(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===bc.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=bc.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=bc.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:s,transportType:o,encryptedId:a}=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:s,encryptedId:a});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:s,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${l}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:s}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,s);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 ${o}`)}},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,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:s,encryptedId:o}=r,{params:a,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(ju.proposal_listener_not_found)),this.isValidConnect(Zn({},i.params));const u=a.expiryTimestamp||Ci(Ri.wc_sessionPropose.req.ttl),f=Zn({id:l,pairingTopic:n,expiryTimestamp:u},a);await this.setProposal(l,f);const h=await this.getVerifyContext({attestationId:s,hash:Zu(JSON.stringify(i)),encryptedId:o,metadata:f.proposer.metadata});c==null||c.addTrace(xc.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:Ri.wc_sessionPropose.autoReject}),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:s}=n;if(Ic(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const l=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const c=o.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(za(n)){await this.client.proposal.delete(s,sn("USER_DISCONNECTED"));const o=Nr("session_connect");if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(Nr("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:l,namespaces:c,sessionProperties:u,sessionConfig:f}=n.params,h=Cl(Zn(Zn({topic:r,relay:o,expiry:l,namespaces:c,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},u&&{sessionProperties:u}),f&&{sessionConfig:f}),{transportType:_n.relay}),g=Nr("session_connect");if(this.events.listenerCount(g)===0)throw new Error(`emitting ${g} without any listeners 997`);this.events.emit(Nr("session_connect"),{session:h}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Ic(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Nr("session_approve",i),{})):za(n)&&(await this.client.session.delete(r,sn("USER_DISCONNECTED")),this.events.emit(Nr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=iy.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:sn("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Zn({topic:r},i));try{iy.set(o,s),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(l){throw iy.delete(o),l}this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError({id:s,topic:r,error:o}),this.client.logger.error(o)}},this.isRequestOutOfSync=(r,n)=>n.toString().slice(0,-3){const{id:i}=n,s=Nr("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Ic(n)?this.events.emit(Nr("session_update",i),{}):za(n)&&this.events.emit(Nr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Ci(qp)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,s=Nr("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Ic(n)?this.events.emit(Nr("session_extend",i),{}):za(n)&&this.events.emit(Nr("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(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,s=Nr("session_ping",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{Ic(n)?this.events.emit(Nr("session_ping",i),{}):za(n)&&this.events.emit(Nr("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(s=>{this.client.core.relayer.once(Hi.publish,async()=>{s(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:sn("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{var n,i,s;const{topic:o,payload:a,attestation:l,encryptedId:c,transportType:u}=r,{id:f,params:h}=a;try{await this.isValidRequest(Zn({topic:o},h));const g=this.client.session.get(o),m=await this.getVerifyContext({attestationId:l,hash:Zu(JSON.stringify(vf("wc_sessionRequest",h,f))),encryptedId:c,metadata:g.peer.metadata,transportType:u}),w={id:f,topic:o,params:h,verifyContext:m};await this.setPendingSessionRequest(w),u===_n.link_mode&&(n=g.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(w):(this.addSessionRequestToSessionRequestQueue(w),this.processSessionRequestQueue())}catch(g){await this.sendError({id:f,topic:o,error:g}),this.client.logger.error(g)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,s=Nr("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Ic(n)?this.events.emit(Nr("session_request",i),{result:n.result}):za(n)&&this.events.emit(Nr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{const o=`${r}_session_event_${s.event.name}`,a=iy.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Zn({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),iy.set(o,i)}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),Ic(n)?this.events.emit(Nr("session_request",i),{result:n.result}):za(n)&&this.events.emit(Nr("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:l}=r;try{const{requester:c,authPayload:u,expiryTimestamp:f}=s.params,h=await this.getVerifyContext({attestationId:o,hash:Zu(JSON.stringify(s)),encryptedId:a,metadata:c.metadata,transportType:l}),g={requester:c,pairingTopic:i,id:s.id,authPayload:u,verifyContext:h,expiryTimestamp:f};await this.setAuthRequest(s.id,{request:g,pairingTopic:i,transportType:l}),l===_n.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:s.params,id:s.id,verifyContext:h})}catch(c){this.client.logger.error(c);const u=s.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),h=this.getAppLinkIfEnabled(s.params.requester.metadata,l),g={type:ad,receiverPublicKey:u,senderPublicKey:f};await this.sendError({id:s.id,topic:i,error:c,encodeOpts:g,rpcOpts:Ri.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=bc.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(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const o=s.request.id,a=Nr("session_request",o);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);this.events.emit(Nr("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===bc.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=bc.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:vf("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!_o(r)){const{message:l}=ht("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(Io(n)||await this.isValidPairingTopic(n),!jLe(a)){const{message:l}=ht("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(l)}!Io(i)&&lv(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Io(s)&&lv(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Io(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=OLe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!_o(r))throw new Error(ht("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const a=this.client.proposal.get(n),l=GE(i,"approve()");if(l)throw new Error(l.message);const c=XU(a.requiredNamespaces,i,"approve()");if(c)throw new Error(c.message);if(!li(s,!0)){const{message:u}=ht("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(u)}Io(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!_o(r)){const{message:s}=ht("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!LLe(i)){const{message:s}=ht("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!_o(r)){const{message:c}=ht("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(c)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!_te(n)){const{message:c}=ht("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(c)}const a=$Le(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const l=GE(s,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(sf(o)){const{message:c}=ht("EXPIRED","onSessionSettleRequest()");throw new Error(c)}},this.isValidUpdate=async r=>{if(!_o(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 s=this.client.session.get(n),o=GE(i,"update()");if(o)throw new Error(o.message);const a=XU(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!_o(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(!_o(r)){const{message:l}=ht("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(l)}const{topic:n,request:i,chainId:s,expiry:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!QU(a,s)){const{message:l}=ht("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(l)}if(!FLe(i)){const{message:l}=ht("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(l)}if(!WLe(a,s,i.method)){const{message:l}=ht("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(l)}if(o&&!VLe(o,tC)){const{message:l}=ht("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${tC.min} and ${tC.max}`);throw new Error(l)}},this.isValidRespond=async r=>{var n;if(!_o(r)){const{message:o}=ht("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:i,response:s}=r;try{await this.isValidSessionTopic(i)}catch(o){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),o}if(!ULe(s)){const{message:o}=ht("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!_o(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(!_o(r)){const{message:a}=ht("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!QU(o,s)){const{message:a}=ht("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!BLe(i)){const{message:a}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!zLe(o,s,i.name)){const{message:a}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!_o(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:s,nonce:o}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!li(i,!1))throw new Error("uri is required parameter");if(!li(s,!1))throw new Error("domain is required parameter");if(!li(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(l=>L1(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=L1(n[0]);if(a!=="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:s,metadata:o,transportType:a}=r,l={verified:{verifyUrl:o.verifyUrl||Qy,validation:"UNKNOWN",origin:o.url||""}};try{if(a===_n.link_mode){const u=this.getAppLinkIfEnabled(o,a);return l.verified.validation=u&&new URL(u).origin===new URL(o.url).origin?"VALID":"INVALID",l}const c=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:s,verifyUrl:o.verifyUrl});c&&(l.verified.origin=c.origin,l.verified.isScam=c.isScam,l.verified.validation=c.origin===new URL(o.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(!li(i,!1)){const{message:s}=ht("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})},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 s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(o)}}},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,s,o,a,l,c,u,f,h;return!r||n!==_n.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.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=OU(r,"topic")||"",i=decodeURIComponent(OU(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:_n.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})},this.registerLinkModeListeners=async()=>{var r;if(NN()||oh()&&(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(Hi.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:s}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(D5)?this.client.auth.authKeys.get(D5):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:s===_n.link_mode?ny:yf});try{LN(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:i,transportType:s,encryptedId:Zu(n)})):z_(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a,transportType:s}),this.client.core.history.delete(r,a.id)):this.onRelayEventUnknownPayload({topic:r,payload:a,transportType:s})}catch(l){this.client.logger.error(l)}}registerExpirerEvents(){this.client.core.expirer.on(Ba.expired,async e=>{const{topic:r,id:n}=dte(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(Uh.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Uh.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!li(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(sf(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=ht("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!li(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(sf(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(li(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(!DLe(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(sf(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=ht("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class lHe extends sp{constructor(e,r){super(e,r,Vze,FN),this.core=e,this.logger=r}}let cHe=class extends sp{constructor(e,r){super(e,r,Gze,FN),this.core=e,this.logger=r}};class uHe extends sp{constructor(e,r){super(e,r,Yze,FN,n=>n.id),this.core=e,this.logger=r}}class dHe extends sp{constructor(e,r){super(e,r,Xze,q_,()=>D5),this.core=e,this.logger=r}}class fHe extends sp{constructor(e,r){super(e,r,eHe,q_),this.core=e,this.logger=r}}class hHe extends sp{constructor(e,r){super(e,r,tHe,q_,n=>n.id),this.core=e,this.logger=r}}class pHe{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new dHe(this.core,this.logger),this.pairingTopics=new fHe(this.core,this.logger),this.requests=new hHe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}let gHe=class ere extends hUe{constructor(e){super(e),this.protocol=Zte,this.version=Jte,this.name=eC.name,this.events=new oo.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(s){throw this.logger.error(s.message),s}},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)||eC.name,this.metadata=(e==null?void 0:e.metadata)||ote(),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:ww(U_({level:(e==null?void 0:e.logger)||eC.logger}));this.core=(e==null?void 0:e.core)||new qze(e),this.logger=ao(r,this.name),this.session=new cHe(this.core,this.logger),this.proposal=new lHe(this.core,this.logger),this.pendingRequest=new uHe(this.core,this.logger),this.engine=new aHe(this),this.auth=new pHe(this.core,this.logger)}static async init(e){const r=new ere(e);return await r.initialize(),r}get context(){return zo(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 c4={exports:{}};/** +***************************************************************************** */var WI=function(t,e){return WI=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])},WI(t,e)};function _Be(t,e){WI(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var zI=function(){return zI=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function CBe(t,e){return function(r,n){e(r,n,t)}}function ABe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function SBe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(n.next(u))}catch(f){a(f)}}function l(u){try{c(n.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})}function IBe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;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&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=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(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[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 rre(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function kBe(){for(var t=[],e=0;e1||o(h,g)})})}function o(h,g){try{l(n[h](g))}catch(m){f(s[0][3],m)}}function l(h){h.value instanceof pv?Promise.resolve(h.value.v).then(c,u):f(s[0][2],h)}function c(h){o("next",h)}function u(h){o("throw",h)}function f(h,g){h(g),s.shift(),s.length&&o(s[0][0],s[0][1])}}function RBe(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,s){e[i]=t[i]?function(a){return(r=!r)?{value:pv(t[i](a)),done:i==="return"}:s?s(a):a}:s}}function MBe(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 HI=="function"?HI(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(a){return new Promise(function(o,l){a=t[s](a),i(o,l,a.done,a.value)})}}function i(s,a,o,l){Promise.resolve(l).then(function(c){s({value:c,done:o})},a)}}function OBe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function jBe(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 LBe(t){return t&&t.__esModule?t:{default:t}}function DBe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function FBe(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 UBe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return zI},__asyncDelegator:RBe,__asyncGenerator:PBe,__asyncValues:MBe,__await:pv,__awaiter:SBe,__classPrivateFieldGet:DBe,__classPrivateFieldSet:FBe,__createBinding:TBe,__decorate:EBe,__exportStar:$Be,__extends:_Be,__generator:IBe,__importDefault:LBe,__importStar:jBe,__makeTemplateObject:OBe,__metadata:ABe,__param:CBe,__read:rre,__rest:xBe,__spread:kBe,__spreadArrays:NBe,__values:HI},Symbol.toStringTag,{value:"Module"})),BBe=Kf(UBe);var Ou={},NB;function WBe(){if(NB)return Ou;NB=1,Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.isBrowserCryptoAvailable=Ou.getSubtleCrypto=Ou.getBrowerCrypto=void 0;function t(){return(Xt==null?void 0:Xt.crypto)||(Xt==null?void 0:Xt.msCrypto)||{}}Ou.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Ou.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Ou.isBrowserCryptoAvailable=r,Ou}var ju={},PB;function zBe(){if(PB)return ju;PB=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.isBrowser=ju.isNode=ju.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}ju.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}ju.isNode=e;function r(){return!t()&&!e()}return ju.isBrowser=r,ju}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=BBe;e.__exportStar(WBe(),t),e.__exportStar(zBe(),t)})(tre);function zu(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Qh(t=6){return BigInt(zu(t))}function bf(t,e,r){return{id:r||zu(),jsonrpc:"2.0",method:t,params:e}}function G_(t,e){return{id:t,jsonrpc:"2.0",result:e}}function K_(t,e,r){return{id:t,jsonrpc:"2.0",error:HBe(e)}}function HBe(t,e){return typeof t>"u"?kB(Qte):(typeof t=="string"&&(t=Object.assign(Object.assign({},kB(KN)),{message:t})),wBe(t.code)&&(t=bBe(t.code)),t)}let qBe=class{},VBe=class extends qBe{constructor(){super()}},GBe=class extends VBe{constructor(e){super()}};const KBe="^https?:",YBe="^wss?:";function ZBe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function nre(t,e){const r=ZBe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function RB(t){return nre(t,KBe)}function MB(t){return nre(t,YBe)}function JBe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function ire(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function YN(t){return ire(t)&&"method"in t}function Y_(t){return ire(t)&&(Tc(t)||zo(t))}function Tc(t){return"result"in t}function zo(t){return"error"in t}let fl=class extends GBe{constructor(e){super(e),this.events=new aa.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(bf(e.method,e.params||[],e.id||Qh().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{zo(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Y_(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 QBe=()=>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"),XBe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",OB=t=>t.split("?")[0],jB=10,eWe=QBe();let tWe=class{constructor(e){if(this.url=e,this.events=new aa.EventEmitter,this.registering=!1,!MB(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(Sd(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!MB(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",s=>{this.resetMaxListeners(),i(s)}),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=tre.isReactNative()?void 0:{rejectUnauthorized:!JBe(e)},s=new eWe(e,[],i);XBe()?s.onerror=a=>{const o=a;n(this.emitError(o.error))}:s.on("error",a=>{n(this.emitError(a))}),s.onopen=()=>{this.onOpen(s),r(s)}})}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"?M0(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=K_(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return ere(e,OB(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>jB&&this.events.setMaxListeners(jB)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${OB(this.url)}`));return this.events.emit("register_error",r),r}};var f6={exports:{}};f6.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,a=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]",E="[object Number]",v="[object Null]",_="[object Object]",A="[object Promise]",C="[object Proxy]",R="[object RegExp]",B="[object Set]",S="[object String]",U="[object Symbol]",G="[object Undefined]",ae="[object WeakMap]",K="[object ArrayBuffer]",N="[object DataView]",k="[object Float32Array]",b="[object Float64Array]",x="[object Int8Array]",P="[object Int16Array]",D="[object Int32Array]",O="[object Uint8Array]",j="[object Uint8ClampedArray]",T="[object Uint16Array]",L="[object Uint32Array]",M=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,H={};H[k]=H[b]=H[x]=H[P]=H[D]=H[O]=H[j]=H[T]=H[L]=!0,H[o]=H[l]=H[K]=H[u]=H[N]=H[f]=H[h]=H[g]=H[w]=H[E]=H[_]=H[R]=H[B]=H[S]=H[ae]=!1;var ee=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,Z=typeof self=="object"&&self&&self.Object===Object&&self,te=ee||Z||Function("return this")(),re=e&&!e.nodeType&&e,W=re&&!0&&t&&!t.nodeType&&t,q=W&&W.exports===re,J=q&&ee.process,me=function(){try{return J&&J.binding&&J.binding("util")}catch{}}(),be=me&&me.isTypedArray;function Ce(ge,$e){for(var Xe=-1,St=ge==null?0:ge.length,pn=0,gr=[];++Xe-1}function ue(ge,$e){var Xe=this.__data__,St=uc(Xe,ge);return St<0?(++this.size,Xe.push([ge,$e])):Xe[St][1]=$e,this}cr.prototype.clear=br,cr.prototype.delete=Q,cr.prototype.get=se,cr.prototype.has=de,cr.prototype.set=ue;function we(ge){var $e=-1,Xe=ge==null?0:ge.length;for(this.clear();++$edi))return!1;var gn=gr.get(ge);if(gn&&gr.get($e))return gn==$e;var ni=-1,ua=!0,fi=Xe&s?new Pt:void 0;for(gr.set(ge,$e),gr.set($e,ge);++ni-1&&ge%1==0&&ge<$e}function Kw(ge){var $e=typeof ge;return $e=="string"||$e=="number"||$e=="symbol"||$e=="boolean"?ge!=="__proto__":ge===null}function Yw(ge){return!!pe&&pe in ge}function Zw(ge){var $e=ge&&ge.constructor,Xe=typeof $e=="function"&&$e.prototype||Y;return ge===Xe}function zx(ge){return ve.call(ge)}function bu(ge){if(ge!=null){try{return z.call(ge)}catch{}try{return ge+""}catch{}}return""}function Jw(ge,$e){return ge===$e||ge!==ge&&$e!==$e}var Qw=vm(function(){return arguments}())?vm:function(ge){return gh(ge)&&ie.call(ge,"callee")&&!it.call(ge,"callee")},vp=Array.isArray;function Hx(ge){return ge!=null&&Xw(ge.length)&&!wp(ge)}var wm=Wt||cn;function qx(ge,$e){return ph(ge,$e)}function wp(ge){if(!e3(ge))return!1;var $e=wu(ge);return $e==g||$e==m||$e==c||$e==C}function Xw(ge){return typeof ge=="number"&&ge>-1&&ge%1==0&&ge<=a}function e3(ge){var $e=typeof ge;return ge!=null&&($e=="object"||$e=="function")}function gh(ge){return ge!=null&&typeof ge=="object"}var t3=be?lt(be):Ww;function Vx(ge){return Hx(ge)?za(ge):zw(ge)}function hn(){return[]}function cn(){return!1}t.exports=qx})(f6,f6.exports);var rWe=f6.exports;const nWe=wo(rWe),sre="wc",are=2,h6="core",ou=`${sre}@2:${h6}:`,iWe={name:h6,logger:"error"},sWe={database:":memory:"},aWe="crypto",LB="client_ed25519_seed",oWe=ct.ONE_DAY,lWe="keychain",cWe="0.3",uWe="messages",dWe="0.3",DB=ct.SIX_HOURS,fWe="publisher",ore="irn",hWe="error",lre="wss://relay.walletconnect.org",pWe="relayer",Hi={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"},gWe="_subscription",Fo={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},mWe=.1,qI="2.17.3",_n={link_mode:"link_mode",relay:"relay"},yWe="0.3",vWe="WALLETCONNECT_CLIENT_ID",FB="WALLETCONNECT_LINK_MODE_APPS",Qa={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},wWe="subscription",bWe="0.3",_We=ct.FIVE_SECONDS*1e3,xWe="pairing",EWe="0.3",oy={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}}},zh={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},xl={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},CWe="history",AWe="0.3",SWe="expirer",Bo={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},IWe="0.3",TWe="verify-api",$We="https://verify.walletconnect.com",cre="https://verify.walletconnect.org",e2=cre,kWe=`${e2}/v3`,NWe=[$We,cre],PWe="echo",RWe="https://echo.walletconnect.com",Ec={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"},Du={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"},El={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"},$h={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"},kh={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"},ly={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"},MWe=.1,OWe="event-client",jWe=86400,LWe="https://pulse.walletconnect.org/batch";function DWe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,C=new Uint8Array(A);v!==_;){for(var R=m[v],B=0,S=A-1;(R!==0||B>>0,C[S]=R%o>>>0,R=R/o>>>0;if(R!==0)throw new Error("Non-zero carry");E=B,v++}for(var U=A-E;U!==A&&C[U]===0;)U++;for(var G=l.repeat(w);U>>0,A=new Uint8Array(_);m[w];){var C=r[m.charCodeAt(w)];if(C===255)return;for(var R=0,B=_-1;(C!==0||R>>0,A[B]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");v=R,w++}if(m[w]!==" "){for(var S=_-v;S!==_&&A[S]===0;)S++;for(var U=new Uint8Array(E+(_-S)),G=E;S!==_;)U[G++]=A[S++];return U}}}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 FWe=DWe,UWe=FWe;const ure=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")},BWe=t=>new TextEncoder().encode(t),WWe=t=>new TextDecoder().decode(t);class zWe{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 HWe{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 dre(this,e)}}class qWe{constructor(e){this.decoders=e}or(e){return dre(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 dre=(t,e)=>new qWe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class VWe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new zWe(e,r,n),this.decoder=new HWe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Z_=({name:t,prefix:e,encode:r,decode:n})=>new VWe(t,e,r,n),Cw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=UWe(r,e);return Z_({prefix:t,name:e,encode:n,decode:s=>ure(i(s))})},GWe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(o-=8,a[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return a},KWe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)a-=r,s+=e[i&o>>a];if(a&&(s+=e[i&o<Z_({prefix:e,name:t,encode(i){return KWe(i,n,r)},decode(i){return GWe(i,n,r,t)}}),YWe=Z_({prefix:"\0",name:"identity",encode:t=>WWe(t),decode:t=>BWe(t)});var ZWe=Object.freeze({__proto__:null,identity:YWe});const JWe=gs({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var QWe=Object.freeze({__proto__:null,base2:JWe});const XWe=gs({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var eze=Object.freeze({__proto__:null,base8:XWe});const tze=Cw({prefix:"9",name:"base10",alphabet:"0123456789"});var rze=Object.freeze({__proto__:null,base10:tze});const nze=gs({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ize=gs({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var sze=Object.freeze({__proto__:null,base16:nze,base16upper:ize});const aze=gs({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),oze=gs({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),lze=gs({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),cze=gs({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),uze=gs({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),dze=gs({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),fze=gs({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),hze=gs({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),pze=gs({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var gze=Object.freeze({__proto__:null,base32:aze,base32upper:oze,base32pad:lze,base32padupper:cze,base32hex:uze,base32hexupper:dze,base32hexpad:fze,base32hexpadupper:hze,base32z:pze});const mze=Cw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),yze=Cw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var vze=Object.freeze({__proto__:null,base36:mze,base36upper:yze});const wze=Cw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),bze=Cw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var _ze=Object.freeze({__proto__:null,base58btc:wze,base58flickr:bze});const xze=gs({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Eze=gs({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Cze=gs({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Aze=gs({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Sze=Object.freeze({__proto__:null,base64:xze,base64pad:Eze,base64url:Cze,base64urlpad:Aze});const fre=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Ize=fre.reduce((t,e,r)=>(t[r]=e,t),[]),Tze=fre.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function $ze(t){return t.reduce((e,r)=>(e+=Ize[r],e),"")}function kze(t){const e=[];for(const r of t){const n=Tze[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Nze=Z_({prefix:"🚀",name:"base256emoji",encode:$ze,decode:kze});var Pze=Object.freeze({__proto__:null,base256emoji:Nze}),Rze=hre,UB=128,Mze=127,Oze=~Mze,jze=Math.pow(2,31);function hre(t,e,r){e=e||[],r=r||0;for(var n=r;t>=jze;)e[r++]=t&255|UB,t/=128;for(;t&Oze;)e[r++]=t&255|UB,t>>>=7;return e[r]=t|0,hre.bytes=r-n+1,e}var Lze=VI,Dze=128,BB=127;function VI(t,n){var r=0,n=n||0,i=0,s=n,a,o=t.length;do{if(s>=o)throw VI.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=i<28?(a&BB)<=Dze);return VI.bytes=s-n,r}var Fze=Math.pow(2,7),Uze=Math.pow(2,14),Bze=Math.pow(2,21),Wze=Math.pow(2,28),zze=Math.pow(2,35),Hze=Math.pow(2,42),qze=Math.pow(2,49),Vze=Math.pow(2,56),Gze=Math.pow(2,63),Kze=function(t){return t(pre.encode(t,e,r),e),zB=t=>pre.encodingLength(t),GI=(t,e)=>{const r=e.byteLength,n=zB(t),i=n+zB(r),s=new Uint8Array(i+r);return WB(t,s,0),WB(r,s,n),s.set(e,i),new Zze(t,r,e,s)};let Zze=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};const gre=({name:t,code:e,encode:r})=>new Jze(t,e,r);let Jze=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?GI(this.code,r):r.then(n=>GI(this.code,n))}else throw Error("Unknown type, must be binary type")}};const mre=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Qze=gre({name:"sha2-256",code:18,encode:mre("SHA-256")}),Xze=gre({name:"sha2-512",code:19,encode:mre("SHA-512")});var eHe=Object.freeze({__proto__:null,sha256:Qze,sha512:Xze});const yre=0,tHe="identity",vre=ure,rHe=t=>GI(yre,vre(t)),nHe={code:yre,name:tHe,encode:vre,digest:rHe};var iHe=Object.freeze({__proto__:null,identity:nHe});new TextEncoder,new TextDecoder;const HB={...ZWe,...QWe,...eze,...rze,...sze,...gze,...vze,..._ze,...Sze,...Pze};({...eHe,...iHe});function sHe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function wre(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const qB=wre("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),sC=wre("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=sHe(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:s}=ht("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=oa(r,this.name)}get context(){return Wa(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Rte(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Mte(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 cHe{constructor(e,r,n){this.core=e,this.logger=r,this.name=aWe,this.randomSessionIdentifier=FI(),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(),s=KU(i);return $te(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=ZDe();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),a=KU(s),o=this.randomSessionIdentifier;return await nDe(o,i,oWe,a)},this.generateSharedKey=(i,s,a)=>{this.isInitialized();const o=this.getPrivateKey(i),l=JDe(o,s);return this.setSymKey(l,a)},this.setSymKey=async(i,s)=>{this.isInitialized();const a=s||L5(i);return await this.keychain.set(a,i),a},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,s,a)=>{this.isInitialized();const o=Hte(a),l=Sd(s);if(cB(o))return XDe(l,a==null?void 0:a.encoding);if(lB(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 QDe({type:u,symKey:c,message:l,senderPublicKey:f,encoding:a==null?void 0:a.encoding})},this.decode=async(i,s,a)=>{this.isInitialized();const o=rFe(s,a);if(cB(o)){const l=tFe(s,a==null?void 0:a.encoding);return M0(l)}if(lB(o)){const l=o.receiverPublicKey,c=o.senderPublicKey;i=await this.generateSharedKey(l,c)}try{const l=this.getSymKey(i),c=eFe({symKey:l,encoded:s,encoding:a==null?void 0:a.encoding});return M0(c)}catch(l){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}},this.getPayloadType=(i,s=wf)=>{const a=uv({encoded:i,encoding:s});return j0(a.type)},this.getPayloadSenderPublicKey=(i,s=wf)=>{const a=uv({encoded:i,encoding:s});return a.senderPublicKey?Ji(a.senderPublicKey,Xs):void 0},this.core=e,this.logger=oa(r,this.name),this.keychain=n||new lHe(this.core,this.logger)}get context(){return Wa(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(LB)}catch{e=FI(),await this.keychain.set(LB,e)}return oHe(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 uHe extends nBe{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=uWe,this.version=dWe,this.initialized=!1,this.storagePrefix=ou,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 s=Qu(i);let a=this.messages.get(n);return typeof a>"u"&&(a={}),typeof a[s]<"u"||(a[s]=i,this.messages.set(n,a),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),a=Qu(i);return typeof s[a]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=oa(e,this.name),this.core=r}get context(){return Wa(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Rte(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Mte(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 dHe=Object.defineProperty,fHe=Object.defineProperties,hHe=Object.getOwnPropertyDescriptors,VB=Object.getOwnPropertySymbols,pHe=Object.prototype.hasOwnProperty,gHe=Object.prototype.propertyIsEnumerable,GB=(t,e,r)=>e in t?dHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,KB=(t,e)=>{for(var r in e||(e={}))pHe.call(e,r)&&GB(t,r,e[r]);if(VB)for(var r of VB(e))gHe.call(e,r)&&GB(t,r,e[r]);return t},YB=(t,e)=>fHe(t,hHe(e));class mHe extends iBe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new aa.EventEmitter,this.name=fWe,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,s)=>{var a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});const o=(s==null?void 0:s.ttl)||DB,l=l6(s),c=(s==null?void 0:s.prompt)||!1,u=(s==null?void 0:s.tag)||0,f=(s==null?void 0:s.id)||Qh().toString(),h={topic:n,message:i,opts:{ttl:o,relay:l,prompt:c,tag:u,id:f,attestation:s==null?void 0:s.attestation}},g=`Failed to publish payload, please try again. id:${f} tag:${u}`;try{const m=new Promise(async w=>{const E=({id:_})=>{h.opts.id===_&&(this.removeRequestFromQueue(_),this.relayer.events.removeListener(Hi.publish,E),w(h))};this.relayer.events.on(Hi.publish,E);const v=vf(new Promise((_,A)=>{this.rpcPublish({topic:n,message:i,ttl:o,prompt:c,tag:u,id:f,attestation:s==null?void 0:s.attestation}).then(_).catch(C=>{this.logger.warn(C,C==null?void 0:C.message),A(C)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${f} tag:${u}`);try{await v,this.events.removeListener(Hi.publish,E)}catch(_){this.queue.set(f,YB(KB({},h),{attempt:1})),this.logger.warn(_,_==null?void 0:_.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,topic:n,message:i,opts:s}}),await vf(m,this.publishTimeout,g)}catch(m){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(m),(a=s==null?void 0:s.internal)!=null&&a.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=oa(r,this.name),this.registerEventListeners()}get context(){return Wa(this.logger)}async rpcPublish(e){var r,n,i,s;const{topic:a,message:o,ttl:l=DB,prompt:c,tag:u,id:f,attestation:h}=e,g={method:Iy(l6().protocol).publish,params:{topic:a,message:o,ttl:l,prompt:c,tag:u,attestation:h},id:f};Sa((r=g.params)==null?void 0:r.prompt)&&((n=g.params)==null||delete n.prompt),Sa((i=g.params)==null?void 0:i.tag)&&((s=g.params)==null||delete s.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(Hi.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,YB(KB({},e),{attempt:n}));const{topic:i,message:s,opts:a,attestation:o}=e;this.logger.warn({},`Publisher: queue->publishing: ${e.opts.id}, tag: ${e.opts.tag}, attempt: ${n}`),await this.rpcPublish({topic:i,message:s,ttl:a.ttl,prompt:a.prompt,tag:a.tag,id:a.id,attestation:o}),this.logger.warn({},`Publisher: queue->published: ${e.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(am.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Hi.connection_stalled);return}this.checkQueue()}),this.relayer.on(Hi.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class yHe{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(s=>s!==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 vHe=Object.defineProperty,wHe=Object.defineProperties,bHe=Object.getOwnPropertyDescriptors,ZB=Object.getOwnPropertySymbols,_He=Object.prototype.hasOwnProperty,xHe=Object.prototype.propertyIsEnumerable,JB=(t,e,r)=>e in t?vHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cy=(t,e)=>{for(var r in e||(e={}))_He.call(e,r)&&JB(t,r,e[r]);if(ZB)for(var r of ZB(e))xHe.call(e,r)&&JB(t,r,e[r]);return t},aC=(t,e)=>wHe(t,bHe(e));class EHe extends oBe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new yHe,this.events=new aa.EventEmitter,this.name=wWe,this.version=bWe,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=ou,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 s=l6(i),a={topic:n,relay:s,transportType:i==null?void 0:i.transportType};this.pending.set(n,a);const o=await this.rpcSubscribe(n,s,i);return typeof o=="string"&&(this.onSubscribe(o,a),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),o}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},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((s,a)=>{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),s(!0)),o.elapsed(i)>=_We&&(clearInterval(l),o.stop(i),a(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(am.pulse,async()=>{await this.checkPending()}),this.events.on(Qa.created,async n=>{const i=Qa.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()}),this.events.on(Qa.deleted,async n=>{const i=Qa.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()})},this.relayer=e,this.logger=oa(r,this.name),this.clientId=""}get context(){return Wa(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=l6(n);await this.rpcUnsubscribe(e,r,i);const s=sn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),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)===_n.relay&&await this.restartToComplete();const s={method:Iy(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const a=(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)===_n.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).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(Qa.created,f),u(h.id))};this.events.on(Qa.created,f);try{const h=await vf(new Promise((g,m)=>{this.relayer.request(s).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(Qa.created,f),u(h)}catch{}}),c=await vf(l,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!c&&a)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(Hi.connection_stalled),a)throw o}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:Iy(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 vf(new Promise(i=>{this.relayer.request(n).catch(s=>this.logger.warn(s)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(Hi.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:Iy(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await vf(new Promise((s,a)=>{this.relayer.request(n).catch(o=>{this.logger.warn(o),a(o)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(Hi.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:Iy(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,aC(cy({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,cy({},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,cy({},r)),this.topicMap.set(r.topic,e),this.events.emit(Qa.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(Qa.deleted,aC(cy({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Qa.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=>aC(cy({},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 ADe(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 Qu(e+this.clientId)}}var CHe=Object.defineProperty,QB=Object.getOwnPropertySymbols,AHe=Object.prototype.hasOwnProperty,SHe=Object.prototype.propertyIsEnumerable,XB=(t,e,r)=>e in t?CHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,eW=(t,e)=>{for(var r in e||(e={}))AHe.call(e,r)&&XB(t,r,e[r]);if(QB)for(var r of QB(e))SHe.call(e,r)&&XB(t,r,e[r]);return t};class IHe extends sBe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new aa.EventEmitter,this.name=pWe,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 s=r.id||Qh().toString();await this.toEstablishConnection();try{this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - publishing...");const a=`${s}:${((i=r.params)==null?void 0:i.tag)||""}`;this.requestsInFlight.push(a);const o=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(l=>l!==a),o}catch(a){throw this.logger.debug(`Failed to Publish Request: ${s}`),a}},this.resetPingTimeout=()=>{if(a6())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(Hi.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(Hi.error,r),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Fo.payload,this.onPayloadHandler),this.provider.on(Fo.connect,this.onConnectHandler),this.provider.on(Fo.disconnect,this.onDisconnectHandler),this.provider.on(Fo.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?oa(e.logger,this.name):xw(V_({level:e.logger||hWe})),this.messages=new uHe(this.logger,e.core),this.subscriber=new EHe(this,this.logger),this.publisher=new mHe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||lre,this.projectId=e.projectId,fDe()?this.packageName=XU():hDe()&&(this.bundleId=XU()),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 Wa(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:_n.relay})}async subscribe(e,r){var n,i,s;this.isInitialized(),(!(r!=null&&r.transportType)||(r==null?void 0:r.transportType)==="relay")&&await this.toEstablishConnection();const a=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=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",l;const c=u=>{u.topic===e&&(this.subscriber.off(Qa.created,c),l())};return await Promise.all([new Promise(u=>{l=u,this.subscriber.on(Qa.created,c)}),new Promise(async(u,f)=>{o=await this.subscriber.subscribe(e,eW({internal:{throwOnFailedPublish:a}},r)).catch(h=>{a&&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 vf(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 bB())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=Ci(ct.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(Hi.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 s=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Fo.disconnect,s),await vf(new Promise((a,o)=>{this.provider.connect().then(a).catch(o)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(a=>{i(a)}).finally(()=>{this.provider.off(Fo.disconnect,s),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),await new Promise(async(a,o)=>{const l=()=>{o(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Fo.disconnect,l),await this.subscriber.start().then(a).catch(o).finally(()=>{this.provider.off(Fo.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,s;if(a6())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||s.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(a){this.logger.warn(a,a==null?void 0:a.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new fl(new tWe(yDe({sdkVersion:qI,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}),YN(e)){if(!e.method.endsWith(gWe))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:a}=r.data,o={topic:n,message:i,publishedAt:s,transportType:_n.relay,attestation:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(eW({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else Y_(e)&&this.events.emit(Hi.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Hi.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=G_(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Fo.payload,this.onPayloadHandler),this.provider.off(Fo.connect,this.onConnectHandler),this.provider.off(Fo.disconnect,this.onDisconnectHandler),this.provider.off(Fo.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await bB();YFe(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(Hi.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(mWe))))}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 THe=Object.defineProperty,tW=Object.getOwnPropertySymbols,$He=Object.prototype.hasOwnProperty,kHe=Object.prototype.propertyIsEnumerable,rW=(t,e,r)=>e in t?THe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,nW=(t,e)=>{for(var r in e||(e={}))$He.call(e,r)&&rW(t,r,e[r]);if(tW)for(var r of tW(e))kHe.call(e,r)&&rW(t,r,e[r]);return t};class lp extends aBe{constructor(e,r,n,i=ou,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=yWe,this.cached=[],this.initialized=!1,this.storagePrefix=ou,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(a=>{this.getKey&&a!==null&&!Sa(a)?this.map.set(this.getKey(a),a):SFe(a)?this.map.set(a.id,a):IFe(a)&&this.map.set(a.topic,a)}),this.cached=[],this.initialized=!0)},this.set=async(a,o)=>{this.isInitialized(),this.map.has(a)?await this.update(a,o):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:a,value:o}),this.map.set(a,o),await this.persist())},this.get=a=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:a}),this.getData(a)),this.getAll=a=>(this.isInitialized(),a?this.values.filter(o=>Object.keys(a).every(l=>nWe(o[l],a[l]))):this.values),this.update=async(a,o)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:a,update:o});const l=nW(nW({},this.getData(a)),o);this.map.set(a,l),await this.persist()},this.delete=async(a,o)=>{this.isInitialized(),this.map.has(a)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:a,reason:o}),this.map.delete(a),this.addToRecentlyDeleted(a),await this.persist())},this.logger=oa(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return Wa(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 NHe{constructor(e,r){this.core=e,this.logger=r,this.name=xWe,this.version=EWe,this.events=new Hk,this.initialized=!1,this.storagePrefix=ou,this.ignoredPayloadTypes=[cd],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=FI(),s=await this.core.crypto.setSymKey(i),a=Ci(ct.FIVE_MINUTES),o={protocol:ore},l={topic:s,expiry:a,relay:o,active:!1,methods:n==null?void 0:n.methods},c=pB({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:o,expiryTimestamp:a,methods:n==null?void 0:n.methods});return this.events.emit(zh.create,l),this.core.expirer.set(s,a),await this.pairings.set(s,l),await this.core.relayer.subscribe(s,{transportType:n==null?void 0:n.transportType}),{topic:s,uri:c}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[Ec.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:a,relay:o,expiryTimestamp:l,methods:c}=hB(n.uri);i.props.properties.topic=s,i.addTrace(Ec.pairing_uri_validation_success),i.addTrace(Ec.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(s)){if(u=this.pairings.get(s),i.addTrace(Ec.existing_pairing),u.active)throw i.setError(Du.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(Ec.pairing_not_expired)}const f=l||Ci(ct.FIVE_MINUTES),h={topic:s,relay:o,expiry:f,active:!1,methods:c};this.core.expirer.set(s,f),await this.pairings.set(s,h),i.addTrace(Ec.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(zh.create,h),i.addTrace(Ec.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(a,s),i.addTrace(Ec.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(Du.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:o})}catch(g){throw i.setError(Du.subscribe_pairing_topic_failure),g}return i.addTrace(Ec.subscribe_pairing_topic_success),h},this.activate=async({topic:n})=>{this.isInitialized();const i=Ci(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 s=await this.sendRequest(i,"wc_pairingPing",{}),{done:a,resolve:o,reject:l}=Oh();this.events.once(Nr("pairing_ping",s),({error:c})=>{c?l(c):o()}),await a()}},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",sn("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:s,expiry:a,methods:o}=n,l=this.core.crypto.keychain.get(i);return pB({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:l,relay:s,expiryTimestamp:a,methods:o})},this.sendRequest=async(n,i,s)=>{const a=bf(i,s),o=await this.core.crypto.encode(n,a),l=oy[i].req;return this.core.history.set(n,a),this.core.relayer.publish(n,o,l),a.id},this.sendResult=async(n,i,s)=>{const a=G_(n,s),o=await this.core.crypto.encode(i,a),l=await this.core.history.get(i,n),c=oy[l.request.method].res;await this.core.relayer.publish(i,o,c),await this.core.history.resolve(a)},this.sendError=async(n,i,s)=>{const a=K_(n,s),o=await this.core.crypto.encode(i,a),l=await this.core.history.get(i,n),c=oy[l.request.method]?oy[l.request.method].res:oy.unregistered_method.res;await this.core.relayer.publish(i,o,c),await this.core.history.resolve(a)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,sn("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=>of(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,a=(await this.core.history.get(i,s.id)).request.method;switch(a){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(a)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(zh.ping,{id:s,topic:n})}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{Tc(i)?this.events.emit(Nr("pairing_ping",s),{}):zo(i)&&this.events.emit(Nr("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(zh.delete,{id:s,topic:n})}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:a}=i;try{if(this.registeredMethods.includes(a))return;const o=sn("WC_METHOD_UNSUPPORTED",a);await this.sendError(s,n,o),this.logger.error(o)}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(sn("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var s;if(!ba(n)){const{message:o}=ht("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(Du.malformed_pairing_uri),new Error(o)}if(!AFe(n.uri)){const{message:o}=ht("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(Du.malformed_pairing_uri),new Error(o)}const a=hB(n==null?void 0:n.uri);if(!((s=a==null?void 0:a.relay)!=null&&s.protocol)){const{message:o}=ht("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(Du.malformed_pairing_uri),new Error(o)}if(!(a!=null&&a.symKey)){const{message:o}=ht("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(Du.malformed_pairing_uri),new Error(o)}if(a!=null&&a.expiryTimestamp&&ct.toMiliseconds(a==null?void 0:a.expiryTimestamp){if(!ba(n)){const{message:s}=ht("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!ba(n)){const{message:s}=ht("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!li(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(of(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=oa(r,this.name),this.pairings=new lp(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Wa(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Hi.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===_n.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const s=await this.core.crypto.decode(r,n);try{YN(s)?(this.core.history.set(r,s),this.onRelayEventRequest({topic:r,payload:s})):Y_(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id))}catch(a){this.logger.error(a)}})}registerExpirerEvents(){this.core.expirer.on(Bo.expired,async e=>{const{topic:r}=jte(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(zh.expire,{topic:r}))})}}class PHe extends rBe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new aa.EventEmitter,this.name=CWe,this.version=AWe,this.cached=[],this.initialized=!1,this.storagePrefix=ou,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,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const a={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:Ci(ct.THIRTY_DAYS)};this.records.set(a.id,a),this.persist(),this.events.emit(xl.created,a)},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=zo(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(xl.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(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(xl.deleted,s)}}),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=oa(r,this.name)}get context(){return Wa(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:bf(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(xl.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(xl.created,e=>{const r=xl.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xl.updated,e=>{const r=xl.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xl.deleted,e=>{const r=xl.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(am.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(xl.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 RHe extends lBe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new aa.EventEmitter,this.name=SWe,this.version=IWe,this.cached=[],this.initialized=!1,this.storagePrefix=ou,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 s=this.formatTarget(n),a={target:s,expiry:i};this.expirations.set(s,a),this.checkExpiry(s,a),this.events.emit(Bo.created,{target:s,expiration:a})},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),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Bo.deleted,{target:i,expiration:s})}},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=oa(r,this.name)}get context(){return Wa(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 vDe(e);if(typeof e=="number")return wDe(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(Bo.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(Bo.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(am.pulse,()=>this.checkExpirations()),this.events.on(Bo.created,e=>{const r=Bo.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Bo.expired,e=>{const r=Bo.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Bo.deleted,e=>{const r=Bo.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 MHe extends cBe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=TWe,this.verifyUrlV3=kWe,this.storagePrefix=ou,this.version=are,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(!yw()||this.isDevEnv)return;const s=window.location.origin,{id:a,decryptedId:o}=i,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${a}&decryptedId=${o}`;try{const c=dw(),u=this.startAbortTimer(ct.ONE_SECOND*5),f=await new Promise((h,g)=>{const m=()=>{window.removeEventListener("message",E),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 E=v=>{if(v.data&&typeof v.data=="string")try{const _=JSON.parse(v.data);if(_.type==="verify_attestation"){if(LI(_.attestation).payload.id!==a)return;clearInterval(u),c.body.removeChild(w),this.abortController.signal.removeEventListener("abort",m),window.removeEventListener("message",E),h(_.attestation===null?"":_.attestation)}}catch(_){this.logger.warn(_)}};c.body.appendChild(w),window.addEventListener("message",E,{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:s,hash:a,encryptedId:o}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(LI(s).payload.id!==o)return;const c=await this.isValidJwtAttestation(s);if(c){if(!c.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return c}}if(!a)return;const l=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(a,l)},this.fetchAttestation=async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const a=this.startAbortTimer(ct.ONE_SECOND*5),o=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(a),o.status===200?await o.json():void 0},this.getVerifyUrl=i=>{let s=i||e2;return NWe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${e2}`),s=e2),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(ct.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.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 s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}const a=await this.fetchAndPersistPublicKey();try{if(a)return this.validateAttestation(i,a)}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 s=>{const a=await this.fetchPublicKey();a&&(await this.persistPublicKey(a),s(a))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,s)=>{const a=aFe(i,s.publicKey),o={hasExpired:ct.toMiliseconds(a.exp)this.abortController.abort(),ct.toMiliseconds(e))}}class OHe extends uBe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=PWe,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:a,enableEncrypted:o=!1}=n,l=`${RWe}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:a,token:s,always_raw:o})})},this.logger=oa(r,this.context)}}var jHe=Object.defineProperty,iW=Object.getOwnPropertySymbols,LHe=Object.prototype.hasOwnProperty,DHe=Object.prototype.propertyIsEnumerable,sW=(t,e,r)=>e in t?jHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,uy=(t,e)=>{for(var r in e||(e={}))LHe.call(e,r)&&sW(t,r,e[r]);if(iW)for(var r of iW(e))DHe.call(e,r)&&sW(t,r,e[r]);return t};class FHe extends dBe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=OWe,this.storagePrefix=ou,this.storageVersion=MWe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!WN())try{const i={eventId:tB(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Pte(this.core.relayer.protocol,this.core.relayer.version,qI)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:s="ERROR",type:a="",properties:{topic:o,trace:l}}=i,c=tB(),u=this.core.projectId||"",f=Date.now(),h=uy({eventId:c,timestamp:f,props:{event:s,type:a,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:s,topic:a}=i;if(s)return this.events.get(s);const o=Array.from(this.events.values()).find(l=>l.props.properties.topic===a);if(o)return uy(uy({},o),this.setMethods(o.eventId))},this.deleteEvent=i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(am.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{ct.fromMiliseconds(Date.now())-ct.fromMiliseconds(i.timestamp)>jWe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)}),this.addTrace=(i,s)=>{const a=this.events.get(i);a&&(a.props.properties.trace.push(s),this.events.set(i,a),this.shouldPersist=!0)},this.setError=(i,s)=>{const a=this.events.get(i);a&&(a.props.type=s,a.timestamp=Date.now(),this.events.set(i,a),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(s=>{this.events.set(s.eventId,uy(uy({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,a]of this.events)a.props.type&&i.push(a);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.sendEvent=async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${LWe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${qI}${s}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>Nte().url,this.logger=oa(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 UHe=Object.defineProperty,aW=Object.getOwnPropertySymbols,BHe=Object.prototype.hasOwnProperty,WHe=Object.prototype.propertyIsEnumerable,oW=(t,e,r)=>e in t?UHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lW=(t,e)=>{for(var r in e||(e={}))BHe.call(e,r)&&oW(t,r,e[r]);if(aW)for(var r of aW(e))WHe.call(e,r)&&oW(t,r,e[r]);return t};let zHe=class bre extends tBe{constructor(e){var r;super(e),this.protocol=sre,this.version=are,this.name=h6,this.events=new aa.EventEmitter,this.initialized=!1,this.on=(a,o)=>this.events.on(a,o),this.once=(a,o)=>this.events.once(a,o),this.off=(a,o)=>this.events.off(a,o),this.removeListener=(a,o)=>this.events.removeListener(a,o),this.dispatchEnvelope=({topic:a,message:o,sessionExists:l})=>{if(!a||!o)return;const c={topic:a,message:o,publishedAt:Date.now(),transportType:_n.link_mode};this.relayer.onLinkMessageEvent(c,{sessionExists:l})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||lre,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=V_({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:iWe.logger,name:h6}),{logger:i,chunkLoggerController:s}=eBe({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=s,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,o;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((o=this.logChunkController)==null||o.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=oa(i,this.name),this.heartbeat=new XFe,this.crypto=new cHe(this,this.logger,e==null?void 0:e.keychain),this.history=new PHe(this,this.logger),this.expirer=new RHe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new SUe(lW(lW({},sWe),e==null?void 0:e.storageOptions)),this.relayer=new IHe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new NHe(this,this.logger),this.verify=new MHe(this,this.logger,this.storage),this.echoClient=new OHe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new FHe(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new bre(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(vWe,n),r}get context(){return Wa(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(FB,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(FB)||[],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 HHe=zHe,_re="wc",xre=2,Ere="client",ZN=`${_re}@${xre}:${Ere}:`,oC={name:Ere,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},cW="WALLETCONNECT_DEEPLINK_CHOICE",qHe="proposal",Cre="Proposal expired",VHe="session",Gp=ct.SEVEN_DAYS,GHe="engine",Ri={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}}},lC={min:ct.FIVE_MINUTES,max:ct.SEVEN_DAYS},_c={idle:"IDLE",active:"ACTIVE"},KHe="request",YHe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],ZHe="wc",JHe="auth",QHe="authKeys",XHe="pairingTopics",eqe="requests",J_=`${ZHe}@${1.5}:${JHe}:`,U5=`${J_}:PUB_KEY`;var tqe=Object.defineProperty,rqe=Object.defineProperties,nqe=Object.getOwnPropertyDescriptors,uW=Object.getOwnPropertySymbols,iqe=Object.prototype.hasOwnProperty,sqe=Object.prototype.propertyIsEnumerable,dW=(t,e,r)=>e in t?tqe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zn=(t,e)=>{for(var r in e||(e={}))iqe.call(e,r)&&dW(t,r,e[r]);if(uW)for(var r of uW(e))sqe.call(e,r)&&dW(t,r,e[r]);return t},Cl=(t,e)=>rqe(t,nqe(e));class aqe extends hBe{constructor(e){super(e),this.name=GHe,this.events=new Hk,this.initialized=!1,this.requestQueue={state:_c.idle,queue:[]},this.sessionRequestQueue={state:_c.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(Ri)}),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=Cl(Zn({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:a,sessionProperties:o,relays:l}=n;let c=i,u,f=!1;try{c&&(f=this.client.core.pairing.pairings.get(c).active)}catch(C){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),C}if(!c||!f){const{topic:C,uri:R}=await this.client.core.pairing.create();c=C,u=R}if(!c){const{message:C}=ht("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(C)}const h=await this.client.core.crypto.generateKeyPair(),g=Ri.wc_sessionPropose.req.ttl||ct.FIVE_MINUTES,m=Ci(g),w=Zn({requiredNamespaces:s,optionalNamespaces:a,relays:l??[{protocol:ore}],proposer:{publicKey:h,metadata:this.client.metadata},expiryTimestamp:m,pairingTopic:c},o&&{sessionProperties:o}),{reject:E,resolve:v,done:_}=Oh(g,Cre);this.events.once(Nr("session_connect"),async({error:C,session:R})=>{if(C)E(C);else if(R){R.self.publicKey=h;const B=Cl(Zn({},R),{pairingTopic:w.pairingTopic,requiredNamespaces:w.requiredNamespaces,optionalNamespaces:w.optionalNamespaces,transportType:_n.relay});await this.client.session.set(R.topic,B),await this.setExpiry(R.topic,R.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:R.peer.metadata}),this.cleanupDuplicatePairings(B),v(B)}});const A=await this.sendRequest({topic:c,method:"wc_sessionPropose",params:w,throwOnFailedPublish:!0});return await this.setProposal(A,Zn({id:A},w)),{uri:u,approval:_}},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,s;const a=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[El.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(U){throw a.setError($h.no_internet_connection),U}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(U){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),a.setError($h.proposal_not_found),U}try{await this.isValidApprove(r)}catch(U){throw this.client.logger.error("approve() -> isValidApprove() failed"),a.setError($h.session_approve_namespace_validation_failure),U}const{id:o,relayProtocol:l,namespaces:c,sessionProperties:u,sessionConfig:f}=r,h=this.client.proposal.get(o);this.client.core.eventClient.deleteEvent({eventId:a.eventId});const{pairingTopic:g,proposer:m,requiredNamespaces:w,optionalNamespaces:E}=h;let v=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});v||(v=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:El.session_approve_started,properties:{topic:g,trace:[El.session_approve_started,El.session_namespaces_validation_success]}}));const _=await this.client.core.crypto.generateKeyPair(),A=m.publicKey,C=await this.client.core.crypto.generateSharedKey(_,A),R=Zn(Zn({relay:{protocol:l??"irn"},namespaces:c,controller:{publicKey:_,metadata:this.client.metadata},expiry:Ci(Gp)},u&&{sessionProperties:u}),f&&{sessionConfig:f}),B=_n.relay;v.addTrace(El.subscribing_session_topic);try{await this.client.core.relayer.subscribe(C,{transportType:B})}catch(U){throw v.setError($h.subscribe_session_topic_failure),U}v.addTrace(El.subscribe_session_topic_success);const S=Cl(Zn({},R),{topic:C,requiredNamespaces:w,optionalNamespaces:E,pairingTopic:g,acknowledged:!1,self:R.controller,peer:{publicKey:m.publicKey,metadata:m.metadata},controller:_,transportType:_n.relay});await this.client.session.set(C,S),v.addTrace(El.store_session);try{v.addTrace(El.publishing_session_settle),await this.sendRequest({topic:C,method:"wc_sessionSettle",params:R,throwOnFailedPublish:!0}).catch(U=>{throw v==null||v.setError($h.session_settle_publish_failure),U}),v.addTrace(El.session_settle_publish_success),v.addTrace(El.publishing_session_approve),await this.sendResult({id:o,topic:g,result:{relay:{protocol:l??"irn"},responderPublicKey:_},throwOnFailedPublish:!0}).catch(U=>{throw v==null||v.setError($h.session_approve_publish_failure),U}),v.addTrace(El.session_approve_publish_success)}catch(U){throw this.client.logger.error(U),this.client.session.delete(C,sn("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(C),U}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,sn("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(C,Ci(Gp)),{topic:C,acknowledged:()=>Promise.resolve(this.client.session.get(C))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(a){throw this.client.logger.error("reject() -> isValidReject() failed"),a}const{id:n,reason:i}=r;let s;try{s=this.client.proposal.get(n).pairingTopic}catch(a){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),a}s&&(await this.sendError({id:n,topic:s,error:i,rpcOpts:Ri.wc_sessionPropose.reject}),await this.client.proposal.delete(n,sn("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:s,resolve:a,reject:o}=Oh(),l=zu(),c=Qh().toString(),u=this.client.session.get(n).namespaces;return this.events.once(Nr("session_update",l),({error:f})=>{f?o(f):a()}),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:s}},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=zu(),{done:s,resolve:a,reject:o}=Oh();return this.events.once(Nr("session_extend",i),({error:l})=>{l?o(l):a()}),await this.setExpiry(n,Ci(Gp)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(l=>{o(l)}),{acknowledged:s}},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:s,expiry:a=Ri.wc_sessionRequest.req.ttl}=r,o=this.client.session.get(s);(o==null?void 0:o.transportType)===_n.relay&&await this.confirmOnlineStateOrThrow();const l=zu(),c=Qh().toString(),{done:u,resolve:f,reject:h}=Oh(a,"Request expired. Please try again.");this.events.once(Nr("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:s,method:"wc_sessionRequest",params:{request:Cl(Zn({},i),{expiryTimestamp:Ci(a)}),chainId:n},expiry:a,throwOnFailedPublish:!0,appLink:g}).catch(m=>h(m)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:l}),await u()):await Promise.all([new Promise(async m=>{await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:s,method:"wc_sessionRequest",params:{request:Cl(Zn({},i),{expiryTimestamp:Ci(a)}),chainId:n},expiry:a,throwOnFailedPublish:!0}).catch(w=>h(w)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:l}),m()}),new Promise(async m=>{var w;if(!((w=o.sessionConfig)!=null&&w.disableDeepLink)){const E=await xDe(this.client.core.storage,cW);await bDe({id:l,topic:s,wcDeepLink:E})}m()}),u()]).then(m=>m[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i,a=this.client.session.get(n);a.transportType===_n.relay&&await this.confirmOnlineStateOrThrow();const o=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);Tc(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:o}):zo(i)&&await this.sendError({id:s,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=zu(),s=Qh().toString(),{done:a,resolve:o,reject:l}=Oh();this.events.once(Nr("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:s}),a()])}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:s}=r,a=Qh().toString(),o=zu();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:a,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:sn("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=>EFe(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const s=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),a=s?_n.link_mode:_n.relay;a===_n.relay&&await this.confirmOnlineStateOrThrow();const{chains:o,statement:l="",uri:c,domain:u,nonce:f,type:h,exp:g,nbf:m,methods:w=[],expiry:E}=r,v=[...r.resources||[]],{topic:_,uri:A}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:a});this.client.logger.info({message:"Generated new pairing",pairing:{topic:_,uri:A}});const C=await this.client.core.crypto.generateKeyPair(),R=L5(C);if(await Promise.all([this.client.auth.authKeys.set(U5,{responseTopic:R,publicKey:C}),this.client.auth.pairingTopics.set(R,{topic:R,pairingTopic:_})]),await this.client.core.relayer.subscribe(R,{transportType:a}),this.client.logger.info(`sending request to new pairing topic: ${_}`),w.length>0){const{namespace:O}=U1(o[0]);let j=HDe(O,"request",w);j5(v)&&(j=VDe(j,v.pop())),v.push(j)}const B=E&&E>Ri.wc_sessionAuthenticate.req.ttl?E:Ri.wc_sessionAuthenticate.req.ttl,S={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:C,metadata:this.client.metadata},expiryTimestamp:Ci(B)},U={eip155:{chains:o,methods:[...new Set(["personal_sign",...w])],events:["chainChanged","accountsChanged"]}},G={requiredNamespaces:{},optionalNamespaces:U,relays:[{protocol:"irn"}],pairingTopic:_,proposer:{publicKey:C,metadata:this.client.metadata},expiryTimestamp:Ci(Ri.wc_sessionPropose.req.ttl)},{done:ae,resolve:K,reject:N}=Oh(B,"Request expired"),k=async({error:O,session:j})=>{if(this.events.off(Nr("session_request",x),b),O)N(O);else if(j){j.self.publicKey=C,await this.client.session.set(j.topic,j),await this.setExpiry(j.topic,j.expiry),_&&await this.client.core.pairing.updateMetadata({topic:_,metadata:j.peer.metadata});const T=this.client.session.get(j.topic);await this.deleteProposal(P),K({session:T})}},b=async O=>{var j,T,L;if(await this.deletePendingAuthRequest(x,{message:"fulfilled",code:0}),O.error){const te=sn("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return O.error.code===te.code?void 0:(this.events.off(Nr("session_connect"),k),N(O.error.message))}await this.deleteProposal(P),this.events.off(Nr("session_connect"),k);const{cacaos:M,responder:X}=O.result,le=[],H=[];for(const te of M){await iB({cacao:te,projectId:this.client.core.projectId})||(this.client.logger.error(te,"Signature verification failed"),N(sn("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:re}=te,W=j5(re.resources),q=[DI(re.iss)],J=o6(re.iss);if(W){const me=sB(W),be=aB(W);le.push(...me),q.push(...be)}for(const me of q)H.push(`${me}:${J}`)}const ee=await this.client.core.crypto.generateSharedKey(C,X.publicKey);let Z;le.length>0&&(Z={topic:ee,acknowledged:!0,self:{publicKey:C,metadata:this.client.metadata},peer:X,controller:X.publicKey,expiry:Ci(Gp),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:_,namespaces:gB([...new Set(le)],[...new Set(H)]),transportType:a},await this.client.core.relayer.subscribe(ee,{transportType:a}),await this.client.session.set(ee,Z),_&&await this.client.core.pairing.updateMetadata({topic:_,metadata:X.metadata}),Z=this.client.session.get(ee)),(j=this.client.metadata.redirect)!=null&&j.linkMode&&(T=X.metadata.redirect)!=null&&T.linkMode&&(L=X.metadata.redirect)!=null&&L.universal&&n&&(this.client.core.addLinkModeSupportedApp(X.metadata.redirect.universal),this.client.session.update(ee,{transportType:_n.link_mode})),K({auths:M,session:Z})},x=zu(),P=zu();this.events.once(Nr("session_connect"),k),this.events.once(Nr("session_request",x),b);let D;try{if(s){const O=bf("wc_sessionAuthenticate",S,x);this.client.core.history.set(_,O);const j=await this.client.core.crypto.encode("",O,{type:bw,encoding:sy});D=Ob(n,_,j)}else await Promise.all([this.sendRequest({topic:_,method:"wc_sessionAuthenticate",params:S,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:x}),this.sendRequest({topic:_,method:"wc_sessionPropose",params:G,expiry:Ri.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:P})])}catch(O){throw this.events.off(Nr("session_connect"),k),this.events.off(Nr("session_request",x),b),O}return await this.setProposal(P,Zn({id:P},G)),await this.setAuthRequest(x,{request:Cl(Zn({},S),{verifyContext:{}}),pairingTopic:_,transportType:a}),{uri:D??A,response:ae}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[kh.authenticated_session_approve_started]}});try{this.isInitialized()}catch(E){throw s.setError(ly.no_internet_connection),E}const a=this.getPendingAuthRequest(n);if(!a)throw s.setError(ly.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const o=a.transportType||_n.relay;o===_n.relay&&await this.confirmOnlineStateOrThrow();const l=a.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),u=L5(l),f={type:cd,receiverPublicKey:l,senderPublicKey:c},h=[],g=[];for(const E of i){if(!await iB({cacao:E,projectId:this.client.core.projectId})){s.setError(ly.invalid_cacao);const R=sn("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:R,encodeOpts:f}),new Error(R.message)}s.addTrace(kh.cacaos_verified);const{p:v}=E,_=j5(v.resources),A=[DI(v.iss)],C=o6(v.iss);if(_){const R=sB(_),B=aB(_);h.push(...R),A.push(...B)}for(const R of A)g.push(`${R}:${C}`)}const m=await this.client.core.crypto.generateSharedKey(c,l);s.addTrace(kh.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:a.requester.metadata},controller:l,expiry:Ci(Gp),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:a.pairingTopic,namespaces:gB([...new Set(h)],[...new Set(g)]),transportType:o},s.addTrace(kh.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(m,{transportType:o})}catch(E){throw s.setError(ly.subscribe_authenticated_session_topic_failure),E}s.addTrace(kh.subscribe_authenticated_session_topic_success),await this.client.session.set(m,w),s.addTrace(kh.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:a.pairingTopic,metadata:a.requester.metadata})}s.addTrace(kh.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(a.requester.metadata,o)})}catch(E){throw s.setError(ly.authenticated_session_approve_publish_failure),E}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:a.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:w}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===_n.relay&&await this.confirmOnlineStateOrThrow();const a=s.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),l=L5(a),c={type:cd,receiverPublicKey:a,senderPublicKey:o};await this.sendError({id:n,topic:l,error:i,encodeOpts:c,rpcOpts:Ri.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,sn("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return Dte(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(s=>{var a,o;return((a=s.peerMetadata)==null?void 0:a.url)&&((o=s.peerMetadata)==null?void 0:o.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.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:s=!1,emitEvent:a=!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,sn("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),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(cW).catch(c=>this.client.logger.warn(c)),this.getPendingSessionRequests().forEach(c=>{c.topic===i&&this.deletePendingSessionRequest(c.id,sn("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=_c.idle),a&&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),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError($h.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,sn("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(s=>s.id!==r),i&&(this.sessionRequestQueue.state=_c.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,Ci(Ri.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:s,transportType:a=_n.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:s,verifyContext:i.verifyContext,transportType:a})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:s,verifyContext:a}=r,o=s.request.expiryTimestamp||Ci(Ri.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,o),await this.client.pendingRequest.set(n,{id:n,topic:i,params:s,verifyContext:a})},this.sendRequest=async r=>{const{topic:n,method:i,params:s,expiry:a,relayRpcId:o,clientRpcId:l,throwOnFailedPublish:c,appLink:u}=r,f=bf(i,s,l);let h;const g=!!u;try{const E=g?sy:wf;h=await this.client.core.crypto.encode(n,f,{encoding:E})}catch(E){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),E}let m;if(YHe.includes(i)){const E=Qu(JSON.stringify(f)),v=Qu(h);m=await this.client.core.verify.register({id:v,decryptedId:E})}const w=Ri[i].req;if(w.attestation=m,a&&(w.ttl=a),o&&(w.id=o),this.client.core.history.set(n,f),g){const E=Ob(u,n,h);await global.Linking.openURL(E,this.client.name)}else{const E=Ri[i].req;a&&(E.ttl=a),o&&(E.id=o),c?(E.internal=Cl(Zn({},E.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,h,E)):this.client.core.relayer.publish(n,h,E).catch(v=>this.client.logger.error(v))}return f.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:a,encodeOpts:o,appLink:l}=r,c=G_(n,s);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?sy:wf;u=await this.client.core.crypto.encode(i,c,Cl(Zn({},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=Ob(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=Ri[h.request.method].res;a?(g.internal=Cl(Zn({},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:s,encodeOpts:a,rpcOpts:o,appLink:l}=r,c=K_(n,s);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?sy:wf;u=await this.client.core.crypto.encode(i,c,Cl(Zn({},a||{}),{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=Ob(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=o||Ri[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 s=!1;of(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{of(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===_c.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=_c.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=_c.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:s,transportType:a,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:s,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:s,encryptedId:o,transportType:a});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:s,encryptedId:o,transportType:a});default:return this.client.logger.info(`Unsupported request method ${l}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:s}=r,a=(await this.client.core.history.get(n,i.id)).request.method;switch(a){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,s);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 ${a}`)}},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,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:s,encryptedId:a}=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(Du.proposal_listener_not_found)),this.isValidConnect(Zn({},i.params));const u=o.expiryTimestamp||Ci(Ri.wc_sessionPropose.req.ttl),f=Zn({id:l,pairingTopic:n,expiryTimestamp:u},o);await this.setProposal(l,f);const h=await this.getVerifyContext({attestationId:s,hash:Qu(JSON.stringify(i)),encryptedId:a,metadata:f.proposer.metadata});c==null||c.addTrace(Ec.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:Ri.wc_sessionPropose.autoReject}),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:s}=n;if(Tc(n)){const{result:a}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const o=this.client.proposal.get(s);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=a.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(zo(n)){await this.client.proposal.delete(s,sn("USER_DISCONNECTED"));const a=Nr("session_connect");if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners, 954`);this.events.emit(Nr("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:a,controller:o,expiry:l,namespaces:c,sessionProperties:u,sessionConfig:f}=n.params,h=Cl(Zn(Zn({topic:r,relay:a,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:_n.relay}),g=Nr("session_connect");if(this.events.listenerCount(g)===0)throw new Error(`emitting ${g} without any listeners 997`);this.events.emit(Nr("session_connect"),{session:h}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Tc(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Nr("session_approve",i),{})):zo(n)&&(await this.client.session.delete(r,sn("USER_DISCONNECTED")),this.events.emit(Nr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const a=`${r}_session_update`,o=ay.get(a);if(o&&this.isRequestOutOfSync(o,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:sn("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Zn({topic:r},i));try{ay.set(a,s),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(l){throw ay.delete(a),l}this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(a){await this.sendError({id:s,topic:r,error:a}),this.client.logger.error(a)}},this.isRequestOutOfSync=(r,n)=>n.toString().slice(0,-3){const{id:i}=n,s=Nr("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Tc(n)?this.events.emit(Nr("session_update",i),{}):zo(n)&&this.events.emit(Nr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Ci(Gp)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,s=Nr("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Tc(n)?this.events.emit(Nr("session_extend",i),{}):zo(n)&&this.events.emit(Nr("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(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,s=Nr("session_ping",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{Tc(n)?this.events.emit(Nr("session_ping",i),{}):zo(n)&&this.events.emit(Nr("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(s=>{this.client.core.relayer.once(Hi.publish,async()=>{s(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:sn("USER_DISCONNECTED")})]).catch(s=>this.client.logger.error(s))}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{var n,i,s;const{topic:a,payload:o,attestation:l,encryptedId:c,transportType:u}=r,{id:f,params:h}=o;try{await this.isValidRequest(Zn({topic:a},h));const g=this.client.session.get(a),m=await this.getVerifyContext({attestationId:l,hash:Qu(JSON.stringify(bf("wc_sessionRequest",h,f))),encryptedId:c,metadata:g.peer.metadata,transportType:u}),w={id:f,topic:a,params:h,verifyContext:m};await this.setPendingSessionRequest(w),u===_n.link_mode&&(n=g.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(w):(this.addSessionRequestToSessionRequestQueue(w),this.processSessionRequestQueue())}catch(g){await this.sendError({id:f,topic:a,error:g}),this.client.logger.error(g)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,s=Nr("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Tc(n)?this.events.emit(Nr("session_request",i),{result:n.result}):zo(n)&&this.events.emit(Nr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{const a=`${r}_session_event_${s.event.name}`,o=ay.get(a);if(o&&this.isRequestOutOfSync(o,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Zn({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),ay.set(a,i)}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),Tc(n)?this.events.emit(Nr("session_request",i),{result:n.result}):zo(n)&&this.events.emit(Nr("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:s,attestation:a,encryptedId:o,transportType:l}=r;try{const{requester:c,authPayload:u,expiryTimestamp:f}=s.params,h=await this.getVerifyContext({attestationId:a,hash:Qu(JSON.stringify(s)),encryptedId:o,metadata:c.metadata,transportType:l}),g={requester:c,pairingTopic:i,id:s.id,authPayload:u,verifyContext:h,expiryTimestamp:f};await this.setAuthRequest(s.id,{request:g,pairingTopic:i,transportType:l}),l===_n.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:s.params,id:s.id,verifyContext:h})}catch(c){this.client.logger.error(c);const u=s.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),h=this.getAppLinkIfEnabled(s.params.requester.metadata,l),g={type:cd,receiverPublicKey:u,senderPublicKey:f};await this.sendError({id:s.id,topic:i,error:c,encodeOpts:g,rpcOpts:Ri.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=_c.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(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const a=s.request.id,o=Nr("session_request",a);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);this.events.emit(Nr("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===_c.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=_c.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:bf("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!ba(r)){const{message:l}=ht("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:a,relays:o}=r;if(Sa(n)||await this.isValidPairingTopic(n),!OFe(o)){const{message:l}=ht("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(l)}!Sa(i)&&dv(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Sa(s)&&dv(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Sa(a)||this.validateSessionProps(a,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=MFe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!ba(r))throw new Error(ht("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:a}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const o=this.client.proposal.get(n),l=eC(i,"approve()");if(l)throw new Error(l.message);const c=vB(o.requiredNamespaces,i,"approve()");if(c)throw new Error(c.message);if(!li(s,!0)){const{message:u}=ht("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(u)}Sa(a)||this.validateSessionProps(a,"sessionProperties")},this.isValidReject=async r=>{if(!ba(r)){const{message:s}=ht("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!LFe(i)){const{message:s}=ht("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!ba(r)){const{message:c}=ht("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(c)}const{relay:n,controller:i,namespaces:s,expiry:a}=r;if(!Vte(n)){const{message:c}=ht("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(c)}const o=TFe(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);const l=eC(s,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(of(a)){const{message:c}=ht("EXPIRED","onSessionSettleRequest()");throw new Error(c)}},this.isValidUpdate=async r=>{if(!ba(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 s=this.client.session.get(n),a=eC(i,"update()");if(a)throw new Error(a.message);const o=vB(s.requiredNamespaces,i,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async r=>{if(!ba(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(!ba(r)){const{message:l}=ht("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(l)}const{topic:n,request:i,chainId:s,expiry:a}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!yB(o,s)){const{message:l}=ht("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(l)}if(!DFe(i)){const{message:l}=ht("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(l)}if(!BFe(o,s,i.method)){const{message:l}=ht("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(l)}if(a&&!qFe(a,lC)){const{message:l}=ht("MISSING_OR_INVALID",`request() expiry: ${a}. Expiry must be a number (in seconds) between ${lC.min} and ${lC.max}`);throw new Error(l)}},this.isValidRespond=async r=>{var n;if(!ba(r)){const{message:a}=ht("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(a)}const{topic:i,response:s}=r;try{await this.isValidSessionTopic(i)}catch(a){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),a}if(!FFe(s)){const{message:a}=ht("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(a)}},this.isValidPing=async r=>{if(!ba(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(!ba(r)){const{message:o}=ht("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(o)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!yB(a,s)){const{message:o}=ht("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(o)}if(!UFe(i)){const{message:o}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}if(!WFe(a,s,i.name)){const{message:o}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidDisconnect=async r=>{if(!ba(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:s,nonce:a}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!li(i,!1))throw new Error("uri is required parameter");if(!li(s,!1))throw new Error("domain is required parameter");if(!li(a,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(l=>U1(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:o}=U1(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:s,metadata:a,transportType:o}=r,l={verified:{verifyUrl:a.verifyUrl||e2,validation:"UNKNOWN",origin:a.url||""}};try{if(o===_n.link_mode){const u=this.getAppLinkIfEnabled(a,o);return l.verified.validation=u&&new URL(u).origin===new URL(a.url).origin?"VALID":"INVALID",l}const c=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:s,verifyUrl:a.verifyUrl});c&&(l.verified.origin=c.origin,l.verified.isScam=c.isScam,l.verified.validation=c.origin===new URL(a.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(!li(i,!1)){const{message:s}=ht("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})},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 s=this.recentlyDeletedLimit/2;for(const a of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(a)}}},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,s,a,o,l,c,u,f,h;return!r||n!==_n.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((o=(a=this.client.metadata)==null?void 0:a.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=eB(r,"topic")||"",i=decodeURIComponent(eB(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:_n.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})},this.registerLinkModeListeners=async()=>{var r;if(WN()||ch()&&(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(Hi.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:s}=e,{publicKey:a}=this.client.auth.authKeys.keys.includes(U5)?this.client.auth.authKeys.get(U5):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(r,n,{receiverPublicKey:a,encoding:s===_n.link_mode?sy:wf});try{YN(o)?(this.client.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o,attestation:i,transportType:s,encryptedId:Qu(n)})):Y_(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o,transportType:s}),this.client.core.history.delete(r,o.id)):this.onRelayEventUnknownPayload({topic:r,payload:o,transportType:s})}catch(l){this.client.logger.error(l)}}registerExpirerEvents(){this.client.core.expirer.on(Bo.expired,async e=>{const{topic:r,id:n}=jte(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(zh.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(zh.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!li(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(of(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=ht("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!li(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(of(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(li(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(!jFe(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(of(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=ht("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class oqe extends lp{constructor(e,r){super(e,r,qHe,ZN),this.core=e,this.logger=r}}let lqe=class extends lp{constructor(e,r){super(e,r,VHe,ZN),this.core=e,this.logger=r}};class cqe extends lp{constructor(e,r){super(e,r,KHe,ZN,n=>n.id),this.core=e,this.logger=r}}class uqe extends lp{constructor(e,r){super(e,r,QHe,J_,()=>U5),this.core=e,this.logger=r}}class dqe extends lp{constructor(e,r){super(e,r,XHe,J_),this.core=e,this.logger=r}}class fqe extends lp{constructor(e,r){super(e,r,eqe,J_,n=>n.id),this.core=e,this.logger=r}}class hqe{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new uqe(this.core,this.logger),this.pairingTopics=new dqe(this.core,this.logger),this.requests=new fqe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}let pqe=class Are extends fBe{constructor(e){super(e),this.protocol=_re,this.version=xre,this.name=oC.name,this.events=new aa.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(s){throw this.logger.error(s.message),s}},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)||oC.name,this.metadata=(e==null?void 0:e.metadata)||Nte(),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:xw(V_({level:(e==null?void 0:e.logger)||oC.logger}));this.core=(e==null?void 0:e.core)||new HHe(e),this.logger=oa(r,this.name),this.session=new lqe(this.core,this.logger),this.proposal=new oqe(this.core,this.logger),this.pendingRequest=new cqe(this.core,this.logger),this.engine=new aqe(this),this.auth=new hqe(this.core,this.logger)}static async init(e){const r=new Are(e);return await r.initialize(),r}get context(){return Wa(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 p6={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 - */c4.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="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,E=1,v=2,_=4,A=8,C=16,R=32,B=64,S=128,U=256,G=512,oe=30,K="...",N=800,k=16,b=1,x=2,P=3,L=1/0,O=9007199254740991,j=17976931348623157e292,I=NaN,D=4294967295,M=D-1,X=D>>>1,le=[["ary",S],["bind",E],["bindKey",v],["curry",A],["curryRight",C],["flip",G],["partial",R],["partialRight",B],["rearg",U]],H="[object Arguments]",ee="[object Array]",Z="[object AsyncFunction]",te="[object Boolean]",re="[object Date]",W="[object DOMException]",q="[object Error]",J="[object Function]",me="[object GeneratorFunction]",be="[object Map]",Ce="[object Number]",Fe="[object Null]",Ue="[object Object]",Ye="[object Promise]",lt="[object Proxy]",xe="[object RegExp]",He="[object Set]",Ve="[object String]",Ie="[object Symbol]",Ne="[object Undefined]",Oe="[object WeakMap]",Me="[object WeakSet]",Y="[object ArrayBuffer]",F="[object DataView]",z="[object Float32Array]",ie="[object Float64Array]",pe="[object Int8Array]",ve="[object Int16Array]",he="[object Int32Array]",De="[object Uint8Array]",Ze="[object Uint8ClampedArray]",et="[object Uint16Array]",it="[object Uint32Array]",ut=/\b__p \+= '';/g,pt=/\b(__p \+=) '' \+/g,tr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wt=/&(?:amp|lt|gt|quot|#39);/g,At=/[&<>"']/g,mt=RegExp(Wt.source),Ct=RegExp(At.source),dt=/<%-([\s\S]+?)%>/g,Nt=/<%([\s\S]+?)%>/g,jt=/<%=([\s\S]+?)%>/g,gt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vt=/^\w*$/,zt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,at=/[\\^$.*+?()[\]{}|]/g,Gt=RegExp(at.source),Ft=/^\s+/,yt=/\s/,Qe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ot=/\{\n\/\* \[wrapped with (.+)\] \*/,_t=/,? & /,Zt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cr=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,Ar=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cr=/\w*$/,br=/^[-+]0x[0-9a-f]+$/i,Q=/^0b[01]+$/i,se=/^\[object .+?Constructor\]$/,de=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Re=/($^)/,qe=/['\n\r\u2028\u2029\\]/g,Be="\\ud800-\\udfff",tt="\\u0300-\\u036f",wt="\\ufe20-\\ufe2f",Pt="\\u20d0-\\u20ff",Et=tt+wt+Pt,ir="\\u2700-\\u27bf",Qt="a-z\\xdf-\\xf6\\xf8-\\xff",rn="\\xac\\xb1\\xd7\\xf7",Mr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ln="\\u2000-\\u206f",Ds=" \\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",co="A-Z\\xc0-\\xd6\\xd8-\\xde",Ho="\\ufe0e\\ufe0f",cc=rn+Mr+ln+Ds,uh="['’]",yu="["+Be+"]",mm="["+cc+"]",dh="["+Et+"]",Lw="\\d+",O7="["+ir+"]",Fw="["+Qt+"]",Uw="[^"+Be+cc+Lw+ir+Qt+co+"]",pp="\\ud83c[\\udffb-\\udfff]",j7="(?:"+dh+"|"+pp+")",Bw="[^"+Be+"]",gp="(?:\\ud83c[\\udde6-\\uddff]){2}",Md="[\\ud800-\\udbff][\\udc00-\\udfff]",qo="["+co+"]",Ww="\\u200d",zw="(?:"+Fw+"|"+Uw+")",uc="(?:"+qo+"|"+Uw+")",Hw="(?:"+uh+"(?:d|ll|m|re|s|t|ve))?",qw="(?:"+uh+"(?:D|LL|M|RE|S|T|VE))?",Vw=j7+"?",Gw="["+Ho+"]?",D7="(?:"+Ww+"(?:"+[Bw,gp,Md].join("|")+")"+Gw+Vw+")*",vu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kw="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yw=Gw+Vw+D7,mp="(?:"+[O7,gp,Md].join("|")+")"+Yw,L7="(?:"+[Bw+dh+"?",dh,gp,Md,yu].join("|")+")",ym=RegExp(uh,"g"),F7=RegExp(dh,"g"),yp=RegExp(pp+"(?="+pp+")|"+L7+Yw,"g"),Zw=RegExp([qo+"?"+Fw+"+"+Hw+"(?="+[mm,qo,"$"].join("|")+")",uc+"+"+qw+"(?="+[mm,qo+zw,"$"].join("|")+")",qo+"?"+zw+"+"+Hw,qo+"+"+qw,Kw,vu,Lw,mp].join("|"),"g"),Jw=RegExp("["+Ww+Be+Et+Ho+"]"),fh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Qw=["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"],U7=-1,hn={};hn[z]=hn[ie]=hn[pe]=hn[ve]=hn[he]=hn[De]=hn[Ze]=hn[et]=hn[it]=!0,hn[H]=hn[ee]=hn[Y]=hn[te]=hn[F]=hn[re]=hn[q]=hn[J]=hn[be]=hn[Ce]=hn[Ue]=hn[xe]=hn[He]=hn[Ve]=hn[Oe]=!1;var cn={};cn[H]=cn[ee]=cn[Y]=cn[F]=cn[te]=cn[re]=cn[z]=cn[ie]=cn[pe]=cn[ve]=cn[he]=cn[be]=cn[Ce]=cn[Ue]=cn[xe]=cn[He]=cn[Ve]=cn[Ie]=cn[De]=cn[Ze]=cn[et]=cn[it]=!0,cn[q]=cn[J]=cn[Oe]=!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"},$e={"&":"&","<":"<",">":">",'"':""","'":"'"},Xe={"&":"&","<":"<",">":">",""":'"',"'":"'"},St={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pn=parseFloat,gr=parseInt,In=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,di=typeof self=="object"&&self&&self.Object===Object&&self,Lr=In||di||Function("return this")(),gn=e&&!e.nodeType&&e,ni=gn&&!0&&t&&!t.nodeType&&t,uo=ni&&ni.exports===gn,fi=uo&&In.process,Tn=function(){try{var Te=ni&&ni.require&&ni.require("util").types;return Te||fi&&fi.binding&&fi.binding("util")}catch{}}(),Ls=Tn&&Tn.isArrayBuffer,pl=Tn&&Tn.isDate,Ta=Tn&&Tn.isMap,dc=Tn&&Tn.isRegExp,vm=Tn&&Tn.isSet,hh=Tn&&Tn.isTypedArray;function $i(Te,ze,Le){switch(Le.length){case 0:return Te.call(ze);case 1:return Te.call(ze,Le[0]);case 2:return Te.call(ze,Le[0],Le[1]);case 3:return Te.call(ze,Le[0],Le[1],Le[2])}return Te.apply(ze,Le)}function boe(Te,ze,Le,Tt){for(var fr=-1,Jr=Te==null?0:Te.length;++fr-1}function B7(Te,ze,Le){for(var Tt=-1,fr=Te==null?0:Te.length;++Tt-1;);return Le}function jP(Te,ze){for(var Le=Te.length;Le--&&vp(ze,Te[Le],0)>-1;);return Le}function $oe(Te,ze){for(var Le=Te.length,Tt=0;Le--;)Te[Le]===ze&&++Tt;return Tt}var koe=q7(ge),Noe=q7($e);function Poe(Te){return"\\"+St[Te]}function Roe(Te,ze){return Te==null?r:Te[ze]}function wp(Te){return Jw.test(Te)}function Moe(Te){return fh.test(Te)}function Ooe(Te){for(var ze,Le=[];!(ze=Te.next()).done;)Le.push(ze.value);return Le}function Y7(Te){var ze=-1,Le=Array(Te.size);return Te.forEach(function(Tt,fr){Le[++ze]=[fr,Tt]}),Le}function DP(Te,ze){return function(Le){return Te(ze(Le))}}function Dd(Te,ze){for(var Le=-1,Tt=Te.length,fr=0,Jr=[];++Le-1}function xae(p,y){var $=this.__data__,V=m3($,p);return V<0?(++this.size,$.push([p,y])):$[V][1]=y,this}wu.prototype.clear=vae,wu.prototype.delete=wae,wu.prototype.get=bae,wu.prototype.has=_ae,wu.prototype.set=xae;function bu(p){var y=-1,$=p==null?0:p.length;for(this.clear();++y<$;){var V=p[y];this.set(V[0],V[1])}}function Eae(){this.size=0,this.__data__={hash:new gh,map:new(_m||wu),string:new gh}}function Cae(p){var y=T3(this,p).delete(p);return this.size-=y?1:0,y}function Aae(p){return T3(this,p).get(p)}function Sae(p){return T3(this,p).has(p)}function Iae(p,y){var $=T3(this,p),V=$.size;return $.set(p,y),this.size+=$.size==V?0:1,this}bu.prototype.clear=Eae,bu.prototype.delete=Cae,bu.prototype.get=Aae,bu.prototype.has=Sae,bu.prototype.set=Iae;function mh(p){var y=-1,$=p==null?0:p.length;for(this.__data__=new bu;++y<$;)this.add(p[y])}function Tae(p){return this.__data__.set(p,l),this}function $ae(p){return this.__data__.has(p)}mh.prototype.add=mh.prototype.push=Tae,mh.prototype.has=$ae;function ml(p){var y=this.__data__=new wu(p);this.size=y.size}function kae(){this.__data__=new wu,this.size=0}function Nae(p){var y=this.__data__,$=y.delete(p);return this.size=y.size,$}function Pae(p){return this.__data__.get(p)}function Rae(p){return this.__data__.has(p)}function Mae(p,y){var $=this.__data__;if($ instanceof wu){var V=$.__data__;if(!_m||V.length=y?p:y)),p}function Pa(p,y,$,V,ne,ce){var _e,Ae=y&f,ke=y&h,Ge=y&g;if($&&(_e=ne?$(p,V,ne,ce):$(p)),_e!==r)return _e;if(!Un(p))return p;var Ke=mr(p);if(Ke){if(_e=Sle(p),!Ae)return fo(p,_e)}else{var rt=ys(p),bt=rt==J||rt==me;if(zd(p))return wR(p,Ae);if(rt==Ue||rt==H||bt&&!ne){if(_e=ke||bt?{}:LR(p),!Ae)return ke?gle(p,Lae(_e,p)):ple(p,YP(_e,p))}else{if(!cn[rt])return ne?p:{};_e=Ile(p,rt,Ae)}}ce||(ce=new ml);var Ut=ce.get(p);if(Ut)return Ut;ce.set(p,_e),hM(p)?p.forEach(function(or){_e.add(Pa(or,y,$,or,p,ce))}):dM(p)&&p.forEach(function(or,kr){_e.set(kr,Pa(or,y,$,kr,p,ce))});var sr=Ge?ke?_x:bx:ke?po:ki,_r=Ke?r:sr(p);return $a(_r||p,function(or,kr){_r&&(kr=or,or=p[kr]),Am(_e,kr,Pa(or,y,$,kr,p,ce))}),_e}function Fae(p){var y=ki(p);return function($){return ZP($,p,y)}}function ZP(p,y,$){var V=$.length;if(p==null)return!V;for(p=mn(p);V--;){var ne=$[V],ce=y[ne],_e=p[ne];if(_e===r&&!(ne in p)||!ce(_e))return!1}return!0}function JP(p,y,$){if(typeof p!="function")throw new ka(o);return Pm(function(){p.apply(r,$)},y)}function Sm(p,y,$,V){var ne=-1,ce=Xw,_e=!0,Ae=p.length,ke=[],Ge=y.length;if(!Ae)return ke;$&&(y=On(y,Vo($))),V?(ce=B7,_e=!1):y.length>=i&&(ce=wm,_e=!1,y=new mh(y));e:for(;++nene?0:ne+$),V=V===r||V>ne?ne:wr(V),V<0&&(V+=ne),V=$>V?0:gM(V);$0&&$(Ae)?y>1?is(Ae,y-1,$,V,ne):jd(ne,Ae):V||(ne[ne.length]=Ae)}return ne}var rx=AR(),eR=AR(!0);function fc(p,y){return p&&rx(p,y,ki)}function nx(p,y){return p&&eR(p,y,ki)}function v3(p,y){return Od(y,function($){return Au(p[$])})}function vh(p,y){y=Bd(y,p);for(var $=0,V=y.length;p!=null&&$y}function Wae(p,y){return p!=null&&nn.call(p,y)}function zae(p,y){return p!=null&&y in mn(p)}function Hae(p,y,$){return p>=ms(y,$)&&p=120&&Ke.length>=120)?new mh(_e&&Ke):r}Ke=p[0];var rt=-1,bt=Ae[0];e:for(;++rt-1;)Ae!==p&&c3.call(Ae,ke,1),c3.call(p,ke,1);return p}function dR(p,y){for(var $=p?y.length:0,V=$-1;$--;){var ne=y[$];if($==V||ne!==ce){var ce=ne;Cu(ne)?c3.call(p,ne,1):hx(p,ne)}}return p}function ux(p,y){return p+f3(qP()*(y-p+1))}function nle(p,y,$,V){for(var ne=-1,ce=xi(d3((y-p)/($||1)),0),_e=Le(ce);ce--;)_e[V?ce:++ne]=p,p+=$;return _e}function dx(p,y){var $="";if(!p||y<1||y>O)return $;do y%2&&($+=p),y=f3(y/2),y&&(p+=p);while(y);return $}function Sr(p,y){return Tx(BR(p,y,go),p+"")}function ile(p){return KP(kp(p))}function sle(p,y){var $=kp(p);return $3($,yh(y,0,$.length))}function $m(p,y,$,V){if(!Un(p))return p;y=Bd(y,p);for(var ne=-1,ce=y.length,_e=ce-1,Ae=p;Ae!=null&&++nene?0:ne+y),$=$>ne?ne:$,$<0&&($+=ne),ne=y>$?0:$-y>>>0,y>>>=0;for(var ce=Le(ne);++V>>1,_e=p[ce];_e!==null&&!Ko(_e)&&($?_e<=y:_e=i){var Ge=y?null:wle(p);if(Ge)return t3(Ge);_e=!1,ne=wm,ke=new mh}else ke=y?[]:Ae;e:for(;++V=V?p:Ra(p,y,$)}var vR=Zoe||function(p){return Lr.clearTimeout(p)};function wR(p,y){if(y)return p.slice();var $=p.length,V=UP?UP($):new p.constructor($);return p.copy(V),V}function yx(p){var y=new p.constructor(p.byteLength);return new a3(y).set(new a3(p)),y}function ule(p,y){var $=y?yx(p.buffer):p.buffer;return new p.constructor($,p.byteOffset,p.byteLength)}function dle(p){var y=new p.constructor(p.source,cr.exec(p));return y.lastIndex=p.lastIndex,y}function fle(p){return Cm?mn(Cm.call(p)):{}}function bR(p,y){var $=y?yx(p.buffer):p.buffer;return new p.constructor($,p.byteOffset,p.length)}function _R(p,y){if(p!==y){var $=p!==r,V=p===null,ne=p===p,ce=Ko(p),_e=y!==r,Ae=y===null,ke=y===y,Ge=Ko(y);if(!Ae&&!Ge&&!ce&&p>y||ce&&_e&&ke&&!Ae&&!Ge||V&&_e&&ke||!$&&ke||!ne)return 1;if(!V&&!ce&&!Ge&&p=Ae)return ke;var Ge=$[V];return ke*(Ge=="desc"?-1:1)}}return p.index-y.index}function xR(p,y,$,V){for(var ne=-1,ce=p.length,_e=$.length,Ae=-1,ke=y.length,Ge=xi(ce-_e,0),Ke=Le(ke+Ge),rt=!V;++Ae1?$[ne-1]:r,_e=ne>2?$[2]:r;for(ce=p.length>3&&typeof ce=="function"?(ne--,ce):r,_e&&Us($[0],$[1],_e)&&(ce=ne<3?r:ce,ne=1),y=mn(y);++V-1?ne[ce?y[_e]:_e]:r}}function TR(p){return Eu(function(y){var $=y.length,V=$,ne=Na.prototype.thru;for(p&&y.reverse();V--;){var ce=y[V];if(typeof ce!="function")throw new ka(o);if(ne&&!_e&&I3(ce)=="wrapper")var _e=new Na([],!0)}for(V=_e?V:$;++V<$;){ce=y[V];var Ae=I3(ce),ke=Ae=="wrapper"?xx(ce):r;ke&&Sx(ke[0])&&ke[1]==(S|A|R|U)&&!ke[4].length&&ke[9]==1?_e=_e[I3(ke[0])].apply(_e,ke[3]):_e=ce.length==1&&Sx(ce)?_e[Ae]():_e.thru(ce)}return function(){var Ge=arguments,Ke=Ge[0];if(_e&&Ge.length==1&&mr(Ke))return _e.plant(Ke).value();for(var rt=0,bt=$?y[rt].apply(this,Ge):Ke;++rt<$;)bt=y[rt].call(this,bt);return bt}})}function E3(p,y,$,V,ne,ce,_e,Ae,ke,Ge){var Ke=y&S,rt=y&E,bt=y&v,Ut=y&(A|C),sr=y&G,_r=bt?r:km(p);function or(){for(var kr=arguments.length,Fr=Le(kr),Yo=kr;Yo--;)Fr[Yo]=arguments[Yo];if(Ut)var Bs=Tp(or),Zo=$oe(Fr,Bs);if(V&&(Fr=xR(Fr,V,ne,Ut)),ce&&(Fr=ER(Fr,ce,_e,Ut)),kr-=Zo,Ut&&kr1&&Fr.reverse(),Ke&&keAe))return!1;var Ge=ce.get(p),Ke=ce.get(y);if(Ge&&Ke)return Ge==y&&Ke==p;var rt=-1,bt=!0,Ut=$&w?new mh:r;for(ce.set(p,y),ce.set(y,p);++rt1?"& ":"")+y[V],y=y.join($>2?", ":" "),p.replace(Qe,`{ + */p6.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="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,E=1,v=2,_=4,A=8,C=16,R=32,B=64,S=128,U=256,G=512,ae=30,K="...",N=800,k=16,b=1,x=2,P=3,D=1/0,O=9007199254740991,j=17976931348623157e292,T=NaN,L=4294967295,M=L-1,X=L>>>1,le=[["ary",S],["bind",E],["bindKey",v],["curry",A],["curryRight",C],["flip",G],["partial",R],["partialRight",B],["rearg",U]],H="[object Arguments]",ee="[object Array]",Z="[object AsyncFunction]",te="[object Boolean]",re="[object Date]",W="[object DOMException]",q="[object Error]",J="[object Function]",me="[object GeneratorFunction]",be="[object Map]",Ce="[object Number]",Fe="[object Null]",Ue="[object Object]",Ye="[object Promise]",lt="[object Proxy]",xe="[object RegExp]",He="[object Set]",Ve="[object String]",Ie="[object Symbol]",Ne="[object Undefined]",Oe="[object WeakMap]",Me="[object WeakSet]",Y="[object ArrayBuffer]",F="[object DataView]",z="[object Float32Array]",ie="[object Float64Array]",pe="[object Int8Array]",ve="[object Int16Array]",he="[object Int32Array]",Le="[object Uint8Array]",Ze="[object Uint8ClampedArray]",et="[object Uint16Array]",it="[object Uint32Array]",ut=/\b__p \+= '';/g,pt=/\b(__p \+=) '' \+/g,tr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Wt=/&(?:amp|lt|gt|quot|#39);/g,At=/[&<>"']/g,mt=RegExp(Wt.source),Ct=RegExp(At.source),dt=/<%-([\s\S]+?)%>/g,Nt=/<%([\s\S]+?)%>/g,jt=/<%=([\s\S]+?)%>/g,gt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Vt=/^\w*$/,zt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ot=/[\\^$.*+?()[\]{}|]/g,Gt=RegExp(ot.source),Ft=/^\s+/,yt=/\s/,Qe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ot=/\{\n\/\* \[wrapped with (.+)\] \*/,_t=/,? & /,Zt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cr=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,Ar=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cr=/\w*$/,br=/^[-+]0x[0-9a-f]+$/i,Q=/^0b[01]+$/i,se=/^\[object .+?Constructor\]$/,de=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Re=/($^)/,qe=/['\n\r\u2028\u2029\\]/g,Be="\\ud800-\\udfff",tt="\\u0300-\\u036f",wt="\\ufe20-\\ufe2f",Pt="\\u20d0-\\u20ff",Et=tt+wt+Pt,ir="\\u2700-\\u27bf",Qt="a-z\\xdf-\\xf6\\xf8-\\xff",rn="\\xac\\xb1\\xd7\\xf7",Mr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ln="\\u2000-\\u206f",Ls=" \\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",ca="A-Z\\xc0-\\xd6\\xd8-\\xde",za="\\ufe0e\\ufe0f",uc=rn+Mr+ln+Ls,hh="['’]",wu="["+Be+"]",vm="["+uc+"]",ph="["+Et+"]",Bw="\\d+",Bx="["+ir+"]",Ww="["+Qt+"]",zw="[^"+Be+uc+Bw+ir+Qt+ca+"]",mp="\\ud83c[\\udffb-\\udfff]",Wx="(?:"+ph+"|"+mp+")",Hw="[^"+Be+"]",yp="(?:\\ud83c[\\udde6-\\uddff]){2}",jd="[\\ud800-\\udbff][\\udc00-\\udfff]",Ha="["+ca+"]",qw="\\u200d",Vw="(?:"+Ww+"|"+zw+")",dc="(?:"+Ha+"|"+zw+")",Gw="(?:"+hh+"(?:d|ll|m|re|s|t|ve))?",Kw="(?:"+hh+"(?:D|LL|M|RE|S|T|VE))?",Yw=Wx+"?",Zw="["+za+"]?",zx="(?:"+qw+"(?:"+[Hw,yp,jd].join("|")+")"+Zw+Yw+")*",bu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Jw="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qw=Zw+Yw+zx,vp="(?:"+[Bx,yp,jd].join("|")+")"+Qw,Hx="(?:"+[Hw+ph+"?",ph,yp,jd,wu].join("|")+")",wm=RegExp(hh,"g"),qx=RegExp(ph,"g"),wp=RegExp(mp+"(?="+mp+")|"+Hx+Qw,"g"),Xw=RegExp([Ha+"?"+Ww+"+"+Gw+"(?="+[vm,Ha,"$"].join("|")+")",dc+"+"+Kw+"(?="+[vm,Ha+Vw,"$"].join("|")+")",Ha+"?"+Vw+"+"+Gw,Ha+"+"+Kw,Jw,bu,Bw,vp].join("|"),"g"),e3=RegExp("["+qw+Be+Et+za+"]"),gh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,t3=["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"],Vx=-1,hn={};hn[z]=hn[ie]=hn[pe]=hn[ve]=hn[he]=hn[Le]=hn[Ze]=hn[et]=hn[it]=!0,hn[H]=hn[ee]=hn[Y]=hn[te]=hn[F]=hn[re]=hn[q]=hn[J]=hn[be]=hn[Ce]=hn[Ue]=hn[xe]=hn[He]=hn[Ve]=hn[Oe]=!1;var cn={};cn[H]=cn[ee]=cn[Y]=cn[F]=cn[te]=cn[re]=cn[z]=cn[ie]=cn[pe]=cn[ve]=cn[he]=cn[be]=cn[Ce]=cn[Ue]=cn[xe]=cn[He]=cn[Ve]=cn[Ie]=cn[Le]=cn[Ze]=cn[et]=cn[it]=!0,cn[q]=cn[J]=cn[Oe]=!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"},$e={"&":"&","<":"<",">":">",'"':""","'":"'"},Xe={"&":"&","<":"<",">":">",""":'"',"'":"'"},St={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pn=parseFloat,gr=parseInt,Tn=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,di=typeof self=="object"&&self&&self.Object===Object&&self,Dr=Tn||di||Function("return this")(),gn=e&&!e.nodeType&&e,ni=gn&&!0&&t&&!t.nodeType&&t,ua=ni&&ni.exports===gn,fi=ua&&Tn.process,$n=function(){try{var Te=ni&&ni.require&&ni.require("util").types;return Te||fi&&fi.binding&&fi.binding("util")}catch{}}(),Ds=$n&&$n.isArrayBuffer,pl=$n&&$n.isDate,To=$n&&$n.isMap,fc=$n&&$n.isRegExp,bm=$n&&$n.isSet,mh=$n&&$n.isTypedArray;function $i(Te,ze,De){switch(De.length){case 0:return Te.call(ze);case 1:return Te.call(ze,De[0]);case 2:return Te.call(ze,De[0],De[1]);case 3:return Te.call(ze,De[0],De[1],De[2])}return Te.apply(ze,De)}function Gae(Te,ze,De,Tt){for(var fr=-1,Jr=Te==null?0:Te.length;++fr-1}function Gx(Te,ze,De){for(var Tt=-1,fr=Te==null?0:Te.length;++Tt-1;);return De}function GP(Te,ze){for(var De=Te.length;De--&&bp(ze,Te[De],0)>-1;);return De}function roe(Te,ze){for(var De=Te.length,Tt=0;De--;)Te[De]===ze&&++Tt;return Tt}var noe=Jx(ge),ioe=Jx($e);function soe(Te){return"\\"+St[Te]}function aoe(Te,ze){return Te==null?r:Te[ze]}function _p(Te){return e3.test(Te)}function ooe(Te){return gh.test(Te)}function loe(Te){for(var ze,De=[];!(ze=Te.next()).done;)De.push(ze.value);return De}function t7(Te){var ze=-1,De=Array(Te.size);return Te.forEach(function(Tt,fr){De[++ze]=[fr,Tt]}),De}function KP(Te,ze){return function(De){return Te(ze(De))}}function Fd(Te,ze){for(var De=-1,Tt=Te.length,fr=0,Jr=[];++De-1}function Yoe(p,y){var $=this.__data__,V=w3($,p);return V<0?(++this.size,$.push([p,y])):$[V][1]=y,this}_u.prototype.clear=qoe,_u.prototype.delete=Voe,_u.prototype.get=Goe,_u.prototype.has=Koe,_u.prototype.set=Yoe;function xu(p){var y=-1,$=p==null?0:p.length;for(this.clear();++y<$;){var V=p[y];this.set(V[0],V[1])}}function Zoe(){this.size=0,this.__data__={hash:new vh,map:new(Em||_u),string:new vh}}function Joe(p){var y=N3(this,p).delete(p);return this.size-=y?1:0,y}function Qoe(p){return N3(this,p).get(p)}function Xoe(p){return N3(this,p).has(p)}function ele(p,y){var $=N3(this,p),V=$.size;return $.set(p,y),this.size+=$.size==V?0:1,this}xu.prototype.clear=Zoe,xu.prototype.delete=Joe,xu.prototype.get=Qoe,xu.prototype.has=Xoe,xu.prototype.set=ele;function wh(p){var y=-1,$=p==null?0:p.length;for(this.__data__=new xu;++y<$;)this.add(p[y])}function tle(p){return this.__data__.set(p,l),this}function rle(p){return this.__data__.has(p)}wh.prototype.add=wh.prototype.push=tle,wh.prototype.has=rle;function ml(p){var y=this.__data__=new _u(p);this.size=y.size}function nle(){this.__data__=new _u,this.size=0}function ile(p){var y=this.__data__,$=y.delete(p);return this.size=y.size,$}function sle(p){return this.__data__.get(p)}function ale(p){return this.__data__.has(p)}function ole(p,y){var $=this.__data__;if($ instanceof _u){var V=$.__data__;if(!Em||V.length=y?p:y)),p}function Po(p,y,$,V,ne,ce){var _e,Ae=y&f,ke=y&h,Ge=y&g;if($&&(_e=ne?$(p,V,ne,ce):$(p)),_e!==r)return _e;if(!Un(p))return p;var Ke=mr(p);if(Ke){if(_e=Xle(p),!Ae)return da(p,_e)}else{var rt=ys(p),bt=rt==J||rt==me;if(qd(p))return kR(p,Ae);if(rt==Ue||rt==H||bt&&!ne){if(_e=ke||bt?{}:YR(p),!Ae)return ke?Wle(p,dle(_e,p)):Ble(p,aR(_e,p))}else{if(!cn[rt])return ne?p:{};_e=ece(p,rt,Ae)}}ce||(ce=new ml);var Ut=ce.get(p);if(Ut)return Ut;ce.set(p,_e),CM(p)?p.forEach(function(ar){_e.add(Po(ar,y,$,ar,p,ce))}):xM(p)&&p.forEach(function(ar,kr){_e.set(kr,Po(ar,y,$,kr,p,ce))});var sr=Ge?ke?I7:S7:ke?ha:ki,_r=Ke?r:sr(p);return $o(_r||p,function(ar,kr){_r&&(kr=ar,ar=p[kr]),Im(_e,kr,Po(ar,y,$,kr,p,ce))}),_e}function fle(p){var y=ki(p);return function($){return oR($,p,y)}}function oR(p,y,$){var V=$.length;if(p==null)return!V;for(p=mn(p);V--;){var ne=$[V],ce=y[ne],_e=p[ne];if(_e===r&&!(ne in p)||!ce(_e))return!1}return!0}function lR(p,y,$){if(typeof p!="function")throw new ko(a);return Mm(function(){p.apply(r,$)},y)}function Tm(p,y,$,V){var ne=-1,ce=r3,_e=!0,Ae=p.length,ke=[],Ge=y.length;if(!Ae)return ke;$&&(y=On(y,qa($))),V?(ce=Gx,_e=!1):y.length>=i&&(ce=_m,_e=!1,y=new wh(y));e:for(;++nene?0:ne+$),V=V===r||V>ne?ne:wr(V),V<0&&(V+=ne),V=$>V?0:SM(V);$0&&$(Ae)?y>1?is(Ae,y-1,$,V,ne):Dd(ne,Ae):V||(ne[ne.length]=Ae)}return ne}var l7=jR(),dR=jR(!0);function hc(p,y){return p&&l7(p,y,ki)}function c7(p,y){return p&&dR(p,y,ki)}function _3(p,y){return Ld(y,function($){return Iu(p[$])})}function _h(p,y){y=zd(y,p);for(var $=0,V=y.length;p!=null&&$y}function gle(p,y){return p!=null&&nn.call(p,y)}function mle(p,y){return p!=null&&y in mn(p)}function yle(p,y,$){return p>=ms(y,$)&&p=120&&Ke.length>=120)?new wh(_e&&Ke):r}Ke=p[0];var rt=-1,bt=Ae[0];e:for(;++rt-1;)Ae!==p&&f3.call(Ae,ke,1),f3.call(p,ke,1);return p}function xR(p,y){for(var $=p?y.length:0,V=$-1;$--;){var ne=y[$];if($==V||ne!==ce){var ce=ne;Su(ne)?f3.call(p,ne,1):w7(p,ne)}}return p}function m7(p,y){return p+g3(rR()*(y-p+1))}function kle(p,y,$,V){for(var ne=-1,ce=xi(p3((y-p)/($||1)),0),_e=De(ce);ce--;)_e[V?ce:++ne]=p,p+=$;return _e}function y7(p,y){var $="";if(!p||y<1||y>O)return $;do y%2&&($+=p),y=g3(y/2),y&&(p+=p);while(y);return $}function Sr(p,y){return M7(QR(p,y,pa),p+"")}function Nle(p){return sR(Pp(p))}function Ple(p,y){var $=Pp(p);return P3($,bh(y,0,$.length))}function Nm(p,y,$,V){if(!Un(p))return p;y=zd(y,p);for(var ne=-1,ce=y.length,_e=ce-1,Ae=p;Ae!=null&&++nene?0:ne+y),$=$>ne?ne:$,$<0&&($+=ne),ne=y>$?0:$-y>>>0,y>>>=0;for(var ce=De(ne);++V>>1,_e=p[ce];_e!==null&&!Ga(_e)&&($?_e<=y:_e=i){var Ge=y?null:Vle(p);if(Ge)return i3(Ge);_e=!1,ne=_m,ke=new wh}else ke=y?[]:Ae;e:for(;++V=V?p:Ro(p,y,$)}var $R=Eoe||function(p){return Dr.clearTimeout(p)};function kR(p,y){if(y)return p.slice();var $=p.length,V=JP?JP($):new p.constructor($);return p.copy(V),V}function E7(p){var y=new p.constructor(p.byteLength);return new u3(y).set(new u3(p)),y}function Lle(p,y){var $=y?E7(p.buffer):p.buffer;return new p.constructor($,p.byteOffset,p.byteLength)}function Dle(p){var y=new p.constructor(p.source,cr.exec(p));return y.lastIndex=p.lastIndex,y}function Fle(p){return Sm?mn(Sm.call(p)):{}}function NR(p,y){var $=y?E7(p.buffer):p.buffer;return new p.constructor($,p.byteOffset,p.length)}function PR(p,y){if(p!==y){var $=p!==r,V=p===null,ne=p===p,ce=Ga(p),_e=y!==r,Ae=y===null,ke=y===y,Ge=Ga(y);if(!Ae&&!Ge&&!ce&&p>y||ce&&_e&&ke&&!Ae&&!Ge||V&&_e&&ke||!$&&ke||!ne)return 1;if(!V&&!ce&&!Ge&&p=Ae)return ke;var Ge=$[V];return ke*(Ge=="desc"?-1:1)}}return p.index-y.index}function RR(p,y,$,V){for(var ne=-1,ce=p.length,_e=$.length,Ae=-1,ke=y.length,Ge=xi(ce-_e,0),Ke=De(ke+Ge),rt=!V;++Ae1?$[ne-1]:r,_e=ne>2?$[2]:r;for(ce=p.length>3&&typeof ce=="function"?(ne--,ce):r,_e&&Us($[0],$[1],_e)&&(ce=ne<3?r:ce,ne=1),y=mn(y);++V-1?ne[ce?y[_e]:_e]:r}}function FR(p){return Au(function(y){var $=y.length,V=$,ne=No.prototype.thru;for(p&&y.reverse();V--;){var ce=y[V];if(typeof ce!="function")throw new ko(a);if(ne&&!_e&&k3(ce)=="wrapper")var _e=new No([],!0)}for(V=_e?V:$;++V<$;){ce=y[V];var Ae=k3(ce),ke=Ae=="wrapper"?T7(ce):r;ke&&P7(ke[0])&&ke[1]==(S|A|R|U)&&!ke[4].length&&ke[9]==1?_e=_e[k3(ke[0])].apply(_e,ke[3]):_e=ce.length==1&&P7(ce)?_e[Ae]():_e.thru(ce)}return function(){var Ge=arguments,Ke=Ge[0];if(_e&&Ge.length==1&&mr(Ke))return _e.plant(Ke).value();for(var rt=0,bt=$?y[rt].apply(this,Ge):Ke;++rt<$;)bt=y[rt].call(this,bt);return bt}})}function S3(p,y,$,V,ne,ce,_e,Ae,ke,Ge){var Ke=y&S,rt=y&E,bt=y&v,Ut=y&(A|C),sr=y&G,_r=bt?r:Pm(p);function ar(){for(var kr=arguments.length,Fr=De(kr),Ka=kr;Ka--;)Fr[Ka]=arguments[Ka];if(Ut)var Bs=kp(ar),Ya=roe(Fr,Bs);if(V&&(Fr=RR(Fr,V,ne,Ut)),ce&&(Fr=MR(Fr,ce,_e,Ut)),kr-=Ya,Ut&&kr1&&Fr.reverse(),Ke&&keAe))return!1;var Ge=ce.get(p),Ke=ce.get(y);if(Ge&&Ke)return Ge==y&&Ke==p;var rt=-1,bt=!0,Ut=$&w?new wh:r;for(ce.set(p,y),ce.set(y,p);++rt1?"& ":"")+y[V],y=y.join($>2?", ":" "),p.replace(Qe,`{ /* [wrapped with `+y+`] */ -`)}function $le(p){return mr(p)||_h(p)||!!(zP&&p&&p[zP])}function Cu(p,y){var $=typeof p;return y=y??O,!!y&&($=="number"||$!="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 $3(p,y){var $=-1,V=p.length,ne=V-1;for(y=y===r?V:y;++$1?p[y-1]:r;return $=typeof $=="function"?(p.pop(),$):r,XR(p,$)});function eM(p){var y=ae(p);return y.__chain__=!0,y}function Uce(p,y){return y(p),p}function k3(p,y){return y(p)}var Bce=Eu(function(p){var y=p.length,$=y?p[0]:0,V=this.__wrapped__,ne=function(ce){return tx(ce,p)};return y>1||this.__actions__.length||!(V instanceof Or)||!Cu($)?this.thru(ne):(V=V.slice($,+$+(y?1:0)),V.__actions__.push({func:k3,args:[ne],thisArg:r}),new Na(V,this.__chain__).thru(function(ce){return y&&!ce.length&&ce.push(r),ce}))});function Wce(){return eM(this)}function zce(){return new Na(this.value(),this.__chain__)}function Hce(){this.__values__===r&&(this.__values__=pM(this.value()));var p=this.__index__>=this.__values__.length,y=p?r:this.__values__[this.__index__++];return{done:p,value:y}}function qce(){return this}function Vce(p){for(var y,$=this;$ instanceof g3;){var V=GR($);V.__index__=0,V.__values__=r,y?ne.__wrapped__=V:y=V;var ne=V;$=$.__wrapped__}return ne.__wrapped__=p,y}function Gce(){var p=this.__wrapped__;if(p instanceof Or){var y=p;return this.__actions__.length&&(y=new Or(this)),y=y.reverse(),y.__actions__.push({func:k3,args:[$x],thisArg:r}),new Na(y,this.__chain__)}return this.thru($x)}function Kce(){return mR(this.__wrapped__,this.__actions__)}var Yce=x3(function(p,y,$){nn.call(p,$)?++p[$]:_u(p,$,1)});function Zce(p,y,$){var V=mr(p)?$P:Uae;return $&&Us(p,y,$)&&(y=r),V(p,rr(y,3))}function Jce(p,y){var $=mr(p)?Od:XP;return $(p,rr(y,3))}var Qce=IR(KR),Xce=IR(YR);function eue(p,y){return is(N3(p,y),1)}function tue(p,y){return is(N3(p,y),L)}function rue(p,y,$){return $=$===r?1:wr($),is(N3(p,y),$)}function tM(p,y){var $=mr(p)?$a:Fd;return $(p,rr(y,3))}function rM(p,y){var $=mr(p)?_oe:QP;return $(p,rr(y,3))}var nue=x3(function(p,y,$){nn.call(p,$)?p[$].push(y):_u(p,$,[y])});function iue(p,y,$,V){p=ho(p)?p:kp(p),$=$&&!V?wr($):0;var ne=p.length;return $<0&&($=xi(ne+$,0)),j3(p)?$<=ne&&p.indexOf(y,$)>-1:!!ne&&vp(p,y,$)>-1}var sue=Sr(function(p,y,$){var V=-1,ne=typeof y=="function",ce=ho(p)?Le(p.length):[];return Fd(p,function(_e){ce[++V]=ne?$i(y,_e,$):Im(_e,y,$)}),ce}),oue=x3(function(p,y,$){_u(p,$,y)});function N3(p,y){var $=mr(p)?On:sR;return $(p,rr(y,3))}function aue(p,y,$,V){return p==null?[]:(mr(y)||(y=y==null?[]:[y]),$=V?r:$,mr($)||($=$==null?[]:[$]),cR(p,y,$))}var lue=x3(function(p,y,$){p[$?0:1].push(y)},function(){return[[],[]]});function cue(p,y,$){var V=mr(p)?W7:RP,ne=arguments.length<3;return V(p,rr(y,4),$,ne,Fd)}function uue(p,y,$){var V=mr(p)?xoe:RP,ne=arguments.length<3;return V(p,rr(y,4),$,ne,QP)}function due(p,y){var $=mr(p)?Od:XP;return $(p,M3(rr(y,3)))}function fue(p){var y=mr(p)?KP:ile;return y(p)}function hue(p,y,$){($?Us(p,y,$):y===r)?y=1:y=wr(y);var V=mr(p)?Oae:sle;return V(p,y)}function pue(p){var y=mr(p)?jae:ale;return y(p)}function gue(p){if(p==null)return 0;if(ho(p))return j3(p)?bp(p):p.length;var y=ys(p);return y==be||y==He?p.size:ax(p).length}function mue(p,y,$){var V=mr(p)?z7:lle;return $&&Us(p,y,$)&&(y=r),V(p,rr(y,3))}var yue=Sr(function(p,y){if(p==null)return[];var $=y.length;return $>1&&Us(p,y[0],y[1])?y=[]:$>2&&Us(y[0],y[1],y[2])&&(y=[y[0]]),cR(p,is(y,1),[])}),P3=Joe||function(){return Lr.Date.now()};function vue(p,y){if(typeof y!="function")throw new ka(o);return p=wr(p),function(){if(--p<1)return y.apply(this,arguments)}}function nM(p,y,$){return y=$?r:y,y=p&&y==null?p.length:y,xu(p,S,r,r,r,r,y)}function iM(p,y){var $;if(typeof y!="function")throw new ka(o);return p=wr(p),function(){return--p>0&&($=y.apply(this,arguments)),p<=1&&(y=r),$}}var Nx=Sr(function(p,y,$){var V=E;if($.length){var ne=Dd($,Tp(Nx));V|=R}return xu(p,V,y,$,ne)}),sM=Sr(function(p,y,$){var V=E|v;if($.length){var ne=Dd($,Tp(sM));V|=R}return xu(y,V,p,$,ne)});function oM(p,y,$){y=$?r:y;var V=xu(p,A,r,r,r,r,r,y);return V.placeholder=oM.placeholder,V}function aM(p,y,$){y=$?r:y;var V=xu(p,C,r,r,r,r,r,y);return V.placeholder=aM.placeholder,V}function lM(p,y,$){var V,ne,ce,_e,Ae,ke,Ge=0,Ke=!1,rt=!1,bt=!0;if(typeof p!="function")throw new ka(o);y=Oa(y)||0,Un($)&&(Ke=!!$.leading,rt="maxWait"in $,ce=rt?xi(Oa($.maxWait)||0,y):ce,bt="trailing"in $?!!$.trailing:bt);function Ut(si){var vl=V,Iu=ne;return V=ne=r,Ge=si,_e=p.apply(Iu,vl),_e}function sr(si){return Ge=si,Ae=Pm(kr,y),Ke?Ut(si):_e}function _r(si){var vl=si-ke,Iu=si-Ge,IM=y-vl;return rt?ms(IM,ce-Iu):IM}function or(si){var vl=si-ke,Iu=si-Ge;return ke===r||vl>=y||vl<0||rt&&Iu>=ce}function kr(){var si=P3();if(or(si))return Fr(si);Ae=Pm(kr,_r(si))}function Fr(si){return Ae=r,bt&&V?Ut(si):(V=ne=r,_e)}function Yo(){Ae!==r&&vR(Ae),Ge=0,V=ke=ne=Ae=r}function Bs(){return Ae===r?_e:Fr(P3())}function Zo(){var si=P3(),vl=or(si);if(V=arguments,ne=this,ke=si,vl){if(Ae===r)return sr(ke);if(rt)return vR(Ae),Ae=Pm(kr,y),Ut(ke)}return Ae===r&&(Ae=Pm(kr,y)),_e}return Zo.cancel=Yo,Zo.flush=Bs,Zo}var wue=Sr(function(p,y){return JP(p,1,y)}),bue=Sr(function(p,y,$){return JP(p,Oa(y)||0,$)});function _ue(p){return xu(p,G)}function R3(p,y){if(typeof p!="function"||y!=null&&typeof y!="function")throw new ka(o);var $=function(){var V=arguments,ne=y?y.apply(this,V):V[0],ce=$.cache;if(ce.has(ne))return ce.get(ne);var _e=p.apply(this,V);return $.cache=ce.set(ne,_e)||ce,_e};return $.cache=new(R3.Cache||bu),$}R3.Cache=bu;function M3(p){if(typeof p!="function")throw new ka(o);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 xue(p){return iM(2,p)}var Eue=cle(function(p,y){y=y.length==1&&mr(y[0])?On(y[0],Vo(rr())):On(is(y,1),Vo(rr()));var $=y.length;return Sr(function(V){for(var ne=-1,ce=ms(V.length,$);++ne=y}),_h=rR(function(){return arguments}())?rR:function(p){return Yn(p)&&nn.call(p,"callee")&&!WP.call(p,"callee")},mr=Le.isArray,Lue=Ls?Vo(Ls):Vae;function ho(p){return p!=null&&O3(p.length)&&!Au(p)}function ii(p){return Yn(p)&&ho(p)}function Fue(p){return p===!0||p===!1||Yn(p)&&Fs(p)==te}var zd=Xoe||zx,Uue=pl?Vo(pl):Gae;function Bue(p){return Yn(p)&&p.nodeType===1&&!Rm(p)}function Wue(p){if(p==null)return!0;if(ho(p)&&(mr(p)||typeof p=="string"||typeof p.splice=="function"||zd(p)||$p(p)||_h(p)))return!p.length;var y=ys(p);if(y==be||y==He)return!p.size;if(Nm(p))return!ax(p).length;for(var $ in p)if(nn.call(p,$))return!1;return!0}function zue(p,y){return Tm(p,y)}function Hue(p,y,$){$=typeof $=="function"?$:r;var V=$?$(p,y):r;return V===r?Tm(p,y,r,$):!!V}function Rx(p){if(!Yn(p))return!1;var y=Fs(p);return y==q||y==W||typeof p.message=="string"&&typeof p.name=="string"&&!Rm(p)}function que(p){return typeof p=="number"&&HP(p)}function Au(p){if(!Un(p))return!1;var y=Fs(p);return y==J||y==me||y==Z||y==lt}function uM(p){return typeof p=="number"&&p==wr(p)}function O3(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=O}function Un(p){var y=typeof p;return p!=null&&(y=="object"||y=="function")}function Yn(p){return p!=null&&typeof p=="object"}var dM=Ta?Vo(Ta):Yae;function Vue(p,y){return p===y||ox(p,y,Ex(y))}function Gue(p,y,$){return $=typeof $=="function"?$:r,ox(p,y,Ex(y),$)}function Kue(p){return fM(p)&&p!=+p}function Yue(p){if(Ple(p))throw new fr(s);return nR(p)}function Zue(p){return p===null}function Jue(p){return p==null}function fM(p){return typeof p=="number"||Yn(p)&&Fs(p)==Ce}function Rm(p){if(!Yn(p)||Fs(p)!=Ue)return!1;var y=l3(p);if(y===null)return!0;var $=nn.call(y,"constructor")&&y.constructor;return typeof $=="function"&&$ instanceof $&&i3.call($)==Goe}var Mx=dc?Vo(dc):Zae;function Que(p){return uM(p)&&p>=-O&&p<=O}var hM=vm?Vo(vm):Jae;function j3(p){return typeof p=="string"||!mr(p)&&Yn(p)&&Fs(p)==Ve}function Ko(p){return typeof p=="symbol"||Yn(p)&&Fs(p)==Ie}var $p=hh?Vo(hh):Qae;function Xue(p){return p===r}function ede(p){return Yn(p)&&ys(p)==Oe}function tde(p){return Yn(p)&&Fs(p)==Me}var rde=S3(lx),nde=S3(function(p,y){return p<=y});function pM(p){if(!p)return[];if(ho(p))return j3(p)?gl(p):fo(p);if(bm&&p[bm])return Ooe(p[bm]());var y=ys(p),$=y==be?Y7:y==He?t3:kp;return $(p)}function Su(p){if(!p)return p===0?p:0;if(p=Oa(p),p===L||p===-L){var y=p<0?-1:1;return y*j}return p===p?p:0}function wr(p){var y=Su(p),$=y%1;return y===y?$?y-$:y:0}function gM(p){return p?yh(wr(p),0,D):0}function Oa(p){if(typeof p=="number")return p;if(Ko(p))return I;if(Un(p)){var y=typeof p.valueOf=="function"?p.valueOf():p;p=Un(y)?y+"":y}if(typeof p!="string")return p===0?p:+p;p=MP(p);var $=Q.test(p);return $||de.test(p)?gr(p.slice(2),$?2:8):br.test(p)?I:+p}function mM(p){return hc(p,po(p))}function ide(p){return p?yh(wr(p),-O,O):p===0?p:0}function Xr(p){return p==null?"":Go(p)}var sde=Sp(function(p,y){if(Nm(y)||ho(y)){hc(y,ki(y),p);return}for(var $ in y)nn.call(y,$)&&Am(p,$,y[$])}),yM=Sp(function(p,y){hc(y,po(y),p)}),D3=Sp(function(p,y,$,V){hc(y,po(y),p,V)}),ode=Sp(function(p,y,$,V){hc(y,ki(y),p,V)}),ade=Eu(tx);function lde(p,y){var $=Ap(p);return y==null?$:YP($,y)}var cde=Sr(function(p,y){p=mn(p);var $=-1,V=y.length,ne=V>2?y[2]:r;for(ne&&Us(y[0],y[1],ne)&&(V=1);++$1),ce}),hc(p,_x(p),$),V&&($=Pa($,f|h|g,ble));for(var ne=y.length;ne--;)hx($,y[ne]);return $});function Ide(p,y){return wM(p,M3(rr(y)))}var Tde=Eu(function(p,y){return p==null?{}:tle(p,y)});function wM(p,y){if(p==null)return{};var $=On(_x(p),function(V){return[V]});return y=rr(y),uR(p,$,function(V,ne){return y(V,ne[0])})}function $de(p,y,$){y=Bd(y,p);var V=-1,ne=y.length;for(ne||(ne=1,p=r);++Vy){var V=p;p=y,y=V}if($||p%1||y%1){var ne=qP();return ms(p+ne*(y-p+pn("1e-"+((ne+"").length-1))),y)}return ux(p,y)}var Ude=Ip(function(p,y,$){return y=y.toLowerCase(),p+($?xM(y):y)});function xM(p){return Dx(Xr(p).toLowerCase())}function EM(p){return p=Xr(p),p&&p.replace(we,koe).replace(F7,"")}function Bde(p,y,$){p=Xr(p),y=Go(y);var V=p.length;$=$===r?V:yh(wr($),0,V);var ne=$;return $-=y.length,$>=0&&p.slice($,ne)==y}function Wde(p){return p=Xr(p),p&&Ct.test(p)?p.replace(At,Noe):p}function zde(p){return p=Xr(p),p&&Gt.test(p)?p.replace(at,"\\$&"):p}var Hde=Ip(function(p,y,$){return p+($?"-":"")+y.toLowerCase()}),qde=Ip(function(p,y,$){return p+($?" ":"")+y.toLowerCase()}),Vde=SR("toLowerCase");function Gde(p,y,$){p=Xr(p),y=wr(y);var V=y?bp(p):0;if(!y||V>=y)return p;var ne=(y-V)/2;return A3(f3(ne),$)+p+A3(d3(ne),$)}function Kde(p,y,$){p=Xr(p),y=wr(y);var V=y?bp(p):0;return y&&V>>0,$?(p=Xr(p),p&&(typeof y=="string"||y!=null&&!Mx(y))&&(y=Go(y),!y&&wp(p))?Wd(gl(p),0,$):p.split(y,$)):[]}var tfe=Ip(function(p,y,$){return p+($?" ":"")+Dx(y)});function rfe(p,y,$){return p=Xr(p),$=$==null?0:yh(wr($),0,p.length),y=Go(y),p.slice($,$+y.length)==y}function nfe(p,y,$){var V=ae.templateSettings;$&&Us(p,y,$)&&(y=r),p=Xr(p),y=D3({},y,V,RR);var ne=D3({},y.imports,V.imports,RR),ce=ki(ne),_e=K7(ne,ce),Ae,ke,Ge=0,Ke=y.interpolate||Re,rt="__p += '",bt=Z7((y.escape||Re).source+"|"+Ke.source+"|"+(Ke===jt?Ar:Re).source+"|"+(y.evaluate||Re).source+"|$","g"),Ut="//# sourceURL="+(nn.call(y,"sourceURL")?(y.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++U7+"]")+` -`;p.replace(bt,function(or,kr,Fr,Yo,Bs,Zo){return Fr||(Fr=Yo),rt+=p.slice(Ge,Zo).replace(qe,Poe),kr&&(Ae=!0,rt+=`' + +`)}function rce(p){return mr(p)||Ch(p)||!!(eR&&p&&p[eR])}function Su(p,y){var $=typeof p;return y=y??O,!!y&&($=="number"||$!="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 P3(p,y){var $=-1,V=p.length,ne=V-1;for(y=y===r?V:y;++$1?p[y-1]:r;return $=typeof $=="function"?(p.pop(),$):r,uM(p,$)});function dM(p){var y=oe(p);return y.__chain__=!0,y}function hue(p,y){return y(p),p}function R3(p,y){return y(p)}var pue=Au(function(p){var y=p.length,$=y?p[0]:0,V=this.__wrapped__,ne=function(ce){return o7(ce,p)};return y>1||this.__actions__.length||!(V instanceof Or)||!Su($)?this.thru(ne):(V=V.slice($,+$+(y?1:0)),V.__actions__.push({func:R3,args:[ne],thisArg:r}),new No(V,this.__chain__).thru(function(ce){return y&&!ce.length&&ce.push(r),ce}))});function gue(){return dM(this)}function mue(){return new No(this.value(),this.__chain__)}function yue(){this.__values__===r&&(this.__values__=AM(this.value()));var p=this.__index__>=this.__values__.length,y=p?r:this.__values__[this.__index__++];return{done:p,value:y}}function vue(){return this}function wue(p){for(var y,$=this;$ instanceof v3;){var V=iM($);V.__index__=0,V.__values__=r,y?ne.__wrapped__=V:y=V;var ne=V;$=$.__wrapped__}return ne.__wrapped__=p,y}function bue(){var p=this.__wrapped__;if(p instanceof Or){var y=p;return this.__actions__.length&&(y=new Or(this)),y=y.reverse(),y.__actions__.push({func:R3,args:[O7],thisArg:r}),new No(y,this.__chain__)}return this.thru(O7)}function _ue(){return IR(this.__wrapped__,this.__actions__)}var xue=A3(function(p,y,$){nn.call(p,$)?++p[$]:Eu(p,$,1)});function Eue(p,y,$){var V=mr(p)?UP:hle;return $&&Us(p,y,$)&&(y=r),V(p,rr(y,3))}function Cue(p,y){var $=mr(p)?Ld:uR;return $(p,rr(y,3))}var Aue=DR(sM),Sue=DR(aM);function Iue(p,y){return is(M3(p,y),1)}function Tue(p,y){return is(M3(p,y),D)}function $ue(p,y,$){return $=$===r?1:wr($),is(M3(p,y),$)}function fM(p,y){var $=mr(p)?$o:Bd;return $(p,rr(y,3))}function hM(p,y){var $=mr(p)?Kae:cR;return $(p,rr(y,3))}var kue=A3(function(p,y,$){nn.call(p,$)?p[$].push(y):Eu(p,$,[y])});function Nue(p,y,$,V){p=fa(p)?p:Pp(p),$=$&&!V?wr($):0;var ne=p.length;return $<0&&($=xi(ne+$,0)),F3(p)?$<=ne&&p.indexOf(y,$)>-1:!!ne&&bp(p,y,$)>-1}var Pue=Sr(function(p,y,$){var V=-1,ne=typeof y=="function",ce=fa(p)?De(p.length):[];return Bd(p,function(_e){ce[++V]=ne?$i(y,_e,$):$m(_e,y,$)}),ce}),Rue=A3(function(p,y,$){Eu(p,$,y)});function M3(p,y){var $=mr(p)?On:mR;return $(p,rr(y,3))}function Mue(p,y,$,V){return p==null?[]:(mr(y)||(y=y==null?[]:[y]),$=V?r:$,mr($)||($=$==null?[]:[$]),bR(p,y,$))}var Oue=A3(function(p,y,$){p[$?0:1].push(y)},function(){return[[],[]]});function jue(p,y,$){var V=mr(p)?Kx:HP,ne=arguments.length<3;return V(p,rr(y,4),$,ne,Bd)}function Lue(p,y,$){var V=mr(p)?Yae:HP,ne=arguments.length<3;return V(p,rr(y,4),$,ne,cR)}function Due(p,y){var $=mr(p)?Ld:uR;return $(p,L3(rr(y,3)))}function Fue(p){var y=mr(p)?sR:Nle;return y(p)}function Uue(p,y,$){($?Us(p,y,$):y===r)?y=1:y=wr(y);var V=mr(p)?lle:Ple;return V(p,y)}function Bue(p){var y=mr(p)?cle:Mle;return y(p)}function Wue(p){if(p==null)return 0;if(fa(p))return F3(p)?xp(p):p.length;var y=ys(p);return y==be||y==He?p.size:h7(p).length}function zue(p,y,$){var V=mr(p)?Yx:Ole;return $&&Us(p,y,$)&&(y=r),V(p,rr(y,3))}var Hue=Sr(function(p,y){if(p==null)return[];var $=y.length;return $>1&&Us(p,y[0],y[1])?y=[]:$>2&&Us(y[0],y[1],y[2])&&(y=[y[0]]),bR(p,is(y,1),[])}),O3=Coe||function(){return Dr.Date.now()};function que(p,y){if(typeof y!="function")throw new ko(a);return p=wr(p),function(){if(--p<1)return y.apply(this,arguments)}}function pM(p,y,$){return y=$?r:y,y=p&&y==null?p.length:y,Cu(p,S,r,r,r,r,y)}function gM(p,y){var $;if(typeof y!="function")throw new ko(a);return p=wr(p),function(){return--p>0&&($=y.apply(this,arguments)),p<=1&&(y=r),$}}var L7=Sr(function(p,y,$){var V=E;if($.length){var ne=Fd($,kp(L7));V|=R}return Cu(p,V,y,$,ne)}),mM=Sr(function(p,y,$){var V=E|v;if($.length){var ne=Fd($,kp(mM));V|=R}return Cu(y,V,p,$,ne)});function yM(p,y,$){y=$?r:y;var V=Cu(p,A,r,r,r,r,r,y);return V.placeholder=yM.placeholder,V}function vM(p,y,$){y=$?r:y;var V=Cu(p,C,r,r,r,r,r,y);return V.placeholder=vM.placeholder,V}function wM(p,y,$){var V,ne,ce,_e,Ae,ke,Ge=0,Ke=!1,rt=!1,bt=!0;if(typeof p!="function")throw new ko(a);y=Oo(y)||0,Un($)&&(Ke=!!$.leading,rt="maxWait"in $,ce=rt?xi(Oo($.maxWait)||0,y):ce,bt="trailing"in $?!!$.trailing:bt);function Ut(si){var vl=V,$u=ne;return V=ne=r,Ge=si,_e=p.apply($u,vl),_e}function sr(si){return Ge=si,Ae=Mm(kr,y),Ke?Ut(si):_e}function _r(si){var vl=si-ke,$u=si-Ge,DM=y-vl;return rt?ms(DM,ce-$u):DM}function ar(si){var vl=si-ke,$u=si-Ge;return ke===r||vl>=y||vl<0||rt&&$u>=ce}function kr(){var si=O3();if(ar(si))return Fr(si);Ae=Mm(kr,_r(si))}function Fr(si){return Ae=r,bt&&V?Ut(si):(V=ne=r,_e)}function Ka(){Ae!==r&&$R(Ae),Ge=0,V=ke=ne=Ae=r}function Bs(){return Ae===r?_e:Fr(O3())}function Ya(){var si=O3(),vl=ar(si);if(V=arguments,ne=this,ke=si,vl){if(Ae===r)return sr(ke);if(rt)return $R(Ae),Ae=Mm(kr,y),Ut(ke)}return Ae===r&&(Ae=Mm(kr,y)),_e}return Ya.cancel=Ka,Ya.flush=Bs,Ya}var Vue=Sr(function(p,y){return lR(p,1,y)}),Gue=Sr(function(p,y,$){return lR(p,Oo(y)||0,$)});function Kue(p){return Cu(p,G)}function j3(p,y){if(typeof p!="function"||y!=null&&typeof y!="function")throw new ko(a);var $=function(){var V=arguments,ne=y?y.apply(this,V):V[0],ce=$.cache;if(ce.has(ne))return ce.get(ne);var _e=p.apply(this,V);return $.cache=ce.set(ne,_e)||ce,_e};return $.cache=new(j3.Cache||xu),$}j3.Cache=xu;function L3(p){if(typeof p!="function")throw new ko(a);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 Yue(p){return gM(2,p)}var Zue=jle(function(p,y){y=y.length==1&&mr(y[0])?On(y[0],qa(rr())):On(is(y,1),qa(rr()));var $=y.length;return Sr(function(V){for(var ne=-1,ce=ms(V.length,$);++ne=y}),Ch=hR(function(){return arguments}())?hR:function(p){return Yn(p)&&nn.call(p,"callee")&&!XP.call(p,"callee")},mr=De.isArray,dde=Ds?qa(Ds):wle;function fa(p){return p!=null&&D3(p.length)&&!Iu(p)}function ii(p){return Yn(p)&&fa(p)}function fde(p){return p===!0||p===!1||Yn(p)&&Fs(p)==te}var qd=Soe||Y7,hde=pl?qa(pl):ble;function pde(p){return Yn(p)&&p.nodeType===1&&!Om(p)}function gde(p){if(p==null)return!0;if(fa(p)&&(mr(p)||typeof p=="string"||typeof p.splice=="function"||qd(p)||Np(p)||Ch(p)))return!p.length;var y=ys(p);if(y==be||y==He)return!p.size;if(Rm(p))return!h7(p).length;for(var $ in p)if(nn.call(p,$))return!1;return!0}function mde(p,y){return km(p,y)}function yde(p,y,$){$=typeof $=="function"?$:r;var V=$?$(p,y):r;return V===r?km(p,y,r,$):!!V}function F7(p){if(!Yn(p))return!1;var y=Fs(p);return y==q||y==W||typeof p.message=="string"&&typeof p.name=="string"&&!Om(p)}function vde(p){return typeof p=="number"&&tR(p)}function Iu(p){if(!Un(p))return!1;var y=Fs(p);return y==J||y==me||y==Z||y==lt}function _M(p){return typeof p=="number"&&p==wr(p)}function D3(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=O}function Un(p){var y=typeof p;return p!=null&&(y=="object"||y=="function")}function Yn(p){return p!=null&&typeof p=="object"}var xM=To?qa(To):xle;function wde(p,y){return p===y||f7(p,y,$7(y))}function bde(p,y,$){return $=typeof $=="function"?$:r,f7(p,y,$7(y),$)}function _de(p){return EM(p)&&p!=+p}function xde(p){if(sce(p))throw new fr(s);return pR(p)}function Ede(p){return p===null}function Cde(p){return p==null}function EM(p){return typeof p=="number"||Yn(p)&&Fs(p)==Ce}function Om(p){if(!Yn(p)||Fs(p)!=Ue)return!1;var y=d3(p);if(y===null)return!0;var $=nn.call(y,"constructor")&&y.constructor;return typeof $=="function"&&$ instanceof $&&o3.call($)==boe}var U7=fc?qa(fc):Ele;function Ade(p){return _M(p)&&p>=-O&&p<=O}var CM=bm?qa(bm):Cle;function F3(p){return typeof p=="string"||!mr(p)&&Yn(p)&&Fs(p)==Ve}function Ga(p){return typeof p=="symbol"||Yn(p)&&Fs(p)==Ie}var Np=mh?qa(mh):Ale;function Sde(p){return p===r}function Ide(p){return Yn(p)&&ys(p)==Oe}function Tde(p){return Yn(p)&&Fs(p)==Me}var $de=$3(p7),kde=$3(function(p,y){return p<=y});function AM(p){if(!p)return[];if(fa(p))return F3(p)?gl(p):da(p);if(xm&&p[xm])return loe(p[xm]());var y=ys(p),$=y==be?t7:y==He?i3:Pp;return $(p)}function Tu(p){if(!p)return p===0?p:0;if(p=Oo(p),p===D||p===-D){var y=p<0?-1:1;return y*j}return p===p?p:0}function wr(p){var y=Tu(p),$=y%1;return y===y?$?y-$:y:0}function SM(p){return p?bh(wr(p),0,L):0}function Oo(p){if(typeof p=="number")return p;if(Ga(p))return T;if(Un(p)){var y=typeof p.valueOf=="function"?p.valueOf():p;p=Un(y)?y+"":y}if(typeof p!="string")return p===0?p:+p;p=qP(p);var $=Q.test(p);return $||de.test(p)?gr(p.slice(2),$?2:8):br.test(p)?T:+p}function IM(p){return pc(p,ha(p))}function Nde(p){return p?bh(wr(p),-O,O):p===0?p:0}function Xr(p){return p==null?"":Va(p)}var Pde=Tp(function(p,y){if(Rm(y)||fa(y)){pc(y,ki(y),p);return}for(var $ in y)nn.call(y,$)&&Im(p,$,y[$])}),TM=Tp(function(p,y){pc(y,ha(y),p)}),U3=Tp(function(p,y,$,V){pc(y,ha(y),p,V)}),Rde=Tp(function(p,y,$,V){pc(y,ki(y),p,V)}),Mde=Au(o7);function Ode(p,y){var $=Ip(p);return y==null?$:aR($,y)}var jde=Sr(function(p,y){p=mn(p);var $=-1,V=y.length,ne=V>2?y[2]:r;for(ne&&Us(y[0],y[1],ne)&&(V=1);++$1),ce}),pc(p,I7(p),$),V&&($=Po($,f|h|g,Gle));for(var ne=y.length;ne--;)w7($,y[ne]);return $});function efe(p,y){return kM(p,L3(rr(y)))}var tfe=Au(function(p,y){return p==null?{}:Tle(p,y)});function kM(p,y){if(p==null)return{};var $=On(I7(p),function(V){return[V]});return y=rr(y),_R(p,$,function(V,ne){return y(V,ne[0])})}function rfe(p,y,$){y=zd(y,p);var V=-1,ne=y.length;for(ne||(ne=1,p=r);++Vy){var V=p;p=y,y=V}if($||p%1||y%1){var ne=rR();return ms(p+ne*(y-p+pn("1e-"+((ne+"").length-1))),y)}return m7(p,y)}var hfe=$p(function(p,y,$){return y=y.toLowerCase(),p+($?RM(y):y)});function RM(p){return z7(Xr(p).toLowerCase())}function MM(p){return p=Xr(p),p&&p.replace(we,noe).replace(qx,"")}function pfe(p,y,$){p=Xr(p),y=Va(y);var V=p.length;$=$===r?V:bh(wr($),0,V);var ne=$;return $-=y.length,$>=0&&p.slice($,ne)==y}function gfe(p){return p=Xr(p),p&&Ct.test(p)?p.replace(At,ioe):p}function mfe(p){return p=Xr(p),p&&Gt.test(p)?p.replace(ot,"\\$&"):p}var yfe=$p(function(p,y,$){return p+($?"-":"")+y.toLowerCase()}),vfe=$p(function(p,y,$){return p+($?" ":"")+y.toLowerCase()}),wfe=LR("toLowerCase");function bfe(p,y,$){p=Xr(p),y=wr(y);var V=y?xp(p):0;if(!y||V>=y)return p;var ne=(y-V)/2;return T3(g3(ne),$)+p+T3(p3(ne),$)}function _fe(p,y,$){p=Xr(p),y=wr(y);var V=y?xp(p):0;return y&&V>>0,$?(p=Xr(p),p&&(typeof y=="string"||y!=null&&!U7(y))&&(y=Va(y),!y&&_p(p))?Hd(gl(p),0,$):p.split(y,$)):[]}var Tfe=$p(function(p,y,$){return p+($?" ":"")+z7(y)});function $fe(p,y,$){return p=Xr(p),$=$==null?0:bh(wr($),0,p.length),y=Va(y),p.slice($,$+y.length)==y}function kfe(p,y,$){var V=oe.templateSettings;$&&Us(p,y,$)&&(y=r),p=Xr(p),y=U3({},y,V,HR);var ne=U3({},y.imports,V.imports,HR),ce=ki(ne),_e=e7(ne,ce),Ae,ke,Ge=0,Ke=y.interpolate||Re,rt="__p += '",bt=r7((y.escape||Re).source+"|"+Ke.source+"|"+(Ke===jt?Ar:Re).source+"|"+(y.evaluate||Re).source+"|$","g"),Ut="//# sourceURL="+(nn.call(y,"sourceURL")?(y.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vx+"]")+` +`;p.replace(bt,function(ar,kr,Fr,Ka,Bs,Ya){return Fr||(Fr=Ka),rt+=p.slice(Ge,Ya).replace(qe,soe),kr&&(Ae=!0,rt+=`' + __e(`+kr+`) + '`),Bs&&(ke=!0,rt+=`'; `+Bs+`; __p += '`),Fr&&(rt+=`' + ((__t = (`+Fr+`)) == null ? '' : __t) + -'`),Ge=Zo+or.length,or}),rt+=`'; +'`),Ge=Ya+ar.length,ar}),rt+=`'; `;var sr=nn.call(y,"variable")&&y.variable;if(!sr)rt=`with (obj) { `+rt+` } -`;else if(Cr.test(sr))throw new fr(a);rt=(ke?rt.replace(ut,""):rt).replace(pt,"$1").replace(tr,"$1;"),rt="function("+(sr||"obj")+`) { +`;else if(Cr.test(sr))throw new fr(o);rt=(ke?rt.replace(ut,""):rt).replace(pt,"$1").replace(tr,"$1;"),rt="function("+(sr||"obj")+`) { `+(sr?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(Ae?", __e = _.escape":"")+(ke?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+rt+`return __p -}`;var _r=AM(function(){return Jr(ce,Ut+"return "+rt).apply(r,_e)});if(_r.source=rt,Rx(_r))throw _r;return _r}function ife(p){return Xr(p).toLowerCase()}function sfe(p){return Xr(p).toUpperCase()}function ofe(p,y,$){if(p=Xr(p),p&&($||y===r))return MP(p);if(!p||!(y=Go(y)))return p;var V=gl(p),ne=gl(y),ce=OP(V,ne),_e=jP(V,ne)+1;return Wd(V,ce,_e).join("")}function afe(p,y,$){if(p=Xr(p),p&&($||y===r))return p.slice(0,LP(p)+1);if(!p||!(y=Go(y)))return p;var V=gl(p),ne=jP(V,gl(y))+1;return Wd(V,0,ne).join("")}function lfe(p,y,$){if(p=Xr(p),p&&($||y===r))return p.replace(Ft,"");if(!p||!(y=Go(y)))return p;var V=gl(p),ne=OP(V,gl(y));return Wd(V,ne).join("")}function cfe(p,y){var $=oe,V=K;if(Un(y)){var ne="separator"in y?y.separator:ne;$="length"in y?wr(y.length):$,V="omission"in y?Go(y.omission):V}p=Xr(p);var ce=p.length;if(wp(p)){var _e=gl(p);ce=_e.length}if($>=ce)return p;var Ae=$-bp(V);if(Ae<1)return V;var ke=_e?Wd(_e,0,Ae).join(""):p.slice(0,Ae);if(ne===r)return ke+V;if(_e&&(Ae+=ke.length-Ae),Mx(ne)){if(p.slice(Ae).search(ne)){var Ge,Ke=ke;for(ne.global||(ne=Z7(ne.source,Xr(cr.exec(ne))+"g")),ne.lastIndex=0;Ge=ne.exec(Ke);)var rt=Ge.index;ke=ke.slice(0,rt===r?Ae:rt)}}else if(p.indexOf(Go(ne),Ae)!=Ae){var bt=ke.lastIndexOf(ne);bt>-1&&(ke=ke.slice(0,bt))}return ke+V}function ufe(p){return p=Xr(p),p&&mt.test(p)?p.replace(Wt,Foe):p}var dfe=Ip(function(p,y,$){return p+($?" ":"")+y.toUpperCase()}),Dx=SR("toUpperCase");function CM(p,y,$){return p=Xr(p),y=$?r:y,y===r?Moe(p)?Woe(p):Aoe(p):p.match(y)||[]}var AM=Sr(function(p,y){try{return $i(p,r,y)}catch($){return Rx($)?$:new fr($)}}),ffe=Eu(function(p,y){return $a(y,function($){$=pc($),_u(p,$,Nx(p[$],p))}),p});function hfe(p){var y=p==null?0:p.length,$=rr();return p=y?On(p,function(V){if(typeof V[1]!="function")throw new ka(o);return[$(V[0]),V[1]]}):[],Sr(function(V){for(var ne=-1;++neO)return[];var $=D,V=ms(p,D);y=rr(y),p-=D;for(var ne=G7(V,y);++$0||y<0)?new Or($):(p<0?$=$.takeRight(-p):p&&($=$.drop(p)),y!==r&&(y=wr(y),$=y<0?$.dropRight(-y):$.take(y-p)),$)},Or.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},Or.prototype.toArray=function(){return this.take(D)},fc(Or.prototype,function(p,y){var $=/^(?:filter|find|map|reject)|While$/.test(y),V=/^(?:head|last)$/.test(y),ne=ae[V?"take"+(y=="last"?"Right":""):y],ce=V||/^find/.test(y);ne&&(ae.prototype[y]=function(){var _e=this.__wrapped__,Ae=V?[1]:arguments,ke=_e instanceof Or,Ge=Ae[0],Ke=ke||mr(_e),rt=function(kr){var Fr=ne.apply(ae,jd([kr],Ae));return V&&bt?Fr[0]:Fr};Ke&&$&&typeof Ge=="function"&&Ge.length!=1&&(ke=Ke=!1);var bt=this.__chain__,Ut=!!this.__actions__.length,sr=ce&&!bt,_r=ke&&!Ut;if(!ce&&Ke){_e=_r?_e:new Or(this);var or=p.apply(_e,Ae);return or.__actions__.push({func:k3,args:[rt],thisArg:r}),new Na(or,bt)}return sr&&_r?p.apply(this,Ae):(or=this.thru(rt),sr?V?or.value()[0]:or.value():or)})}),$a(["pop","push","shift","sort","splice","unshift"],function(p){var y=r3[p],$=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",V=/^(?:pop|shift)$/.test(p);ae.prototype[p]=function(){var ne=arguments;if(V&&!this.__chain__){var ce=this.value();return y.apply(mr(ce)?ce:[],ne)}return this[$](function(_e){return y.apply(mr(_e)?_e:[],ne)})}}),fc(Or.prototype,function(p,y){var $=ae[y];if($){var V=$.name+"";nn.call(Cp,V)||(Cp[V]=[]),Cp[V].push({name:y,func:$})}}),Cp[E3(r,v).name]=[{name:"wrapper",func:r}],Or.prototype.clone=uae,Or.prototype.reverse=dae,Or.prototype.value=fae,ae.prototype.at=Bce,ae.prototype.chain=Wce,ae.prototype.commit=zce,ae.prototype.next=Hce,ae.prototype.plant=Vce,ae.prototype.reverse=Gce,ae.prototype.toJSON=ae.prototype.valueOf=ae.prototype.value=Kce,ae.prototype.first=ae.prototype.head,bm&&(ae.prototype[bm]=qce),ae},_p=zoe();ni?((ni.exports=_p)._=_p,gn._=_p):Lr._=_p}).call(Xt)})(c4,c4.exports);var mHe=c4.exports,BI={exports:{}};(function(t,e){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Xt<"u"&&Xt,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof Xt<"u"&&Xt||{},l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(x){return x&&DataView.prototype.isPrototypeOf(x)}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(x){return x&&u.indexOf(Object.prototype.toString.call(x))>-1};function h(x){if(typeof x!="string"&&(x=String(x)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(x)||x==="")throw new TypeError('Invalid character in header field name: "'+x+'"');return x.toLowerCase()}function g(x){return typeof x!="string"&&(x=String(x)),x}function m(x){var P={next:function(){var L=x.shift();return{done:L===void 0,value:L}}};return l.iterable&&(P[Symbol.iterator]=function(){return P}),P}function w(x){this.map={},x instanceof w?x.forEach(function(P,L){this.append(L,P)},this):Array.isArray(x)?x.forEach(function(P){if(P.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+P.length);this.append(P[0],P[1])},this):x&&Object.getOwnPropertyNames(x).forEach(function(P){this.append(P,x[P])},this)}w.prototype.append=function(x,P){x=h(x),P=g(P);var L=this.map[x];this.map[x]=L?L+", "+P:P},w.prototype.delete=function(x){delete this.map[h(x)]},w.prototype.get=function(x){return x=h(x),this.has(x)?this.map[x]:null},w.prototype.has=function(x){return this.map.hasOwnProperty(h(x))},w.prototype.set=function(x,P){this.map[h(x)]=g(P)},w.prototype.forEach=function(x,P){for(var L in this.map)this.map.hasOwnProperty(L)&&x.call(P,this.map[L],L,this)},w.prototype.keys=function(){var x=[];return this.forEach(function(P,L){x.push(L)}),m(x)},w.prototype.values=function(){var x=[];return this.forEach(function(P){x.push(P)}),m(x)},w.prototype.entries=function(){var x=[];return this.forEach(function(P,L){x.push([L,P])}),m(x)},l.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function E(x){if(!x._noBody){if(x.bodyUsed)return Promise.reject(new TypeError("Already read"));x.bodyUsed=!0}}function v(x){return new Promise(function(P,L){x.onload=function(){P(x.result)},x.onerror=function(){L(x.error)}})}function _(x){var P=new FileReader,L=v(P);return P.readAsArrayBuffer(x),L}function A(x){var P=new FileReader,L=v(P),O=/charset=([A-Za-z0-9_-]+)/.exec(x.type),j=O?O[1]:"utf-8";return P.readAsText(x,j),L}function C(x){for(var P=new Uint8Array(x),L=new Array(P.length),O=0;O-1?P:x}function G(x,P){if(!(this instanceof G))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P=P||{};var L=P.body;if(x instanceof G){if(x.bodyUsed)throw new TypeError("Already read");this.url=x.url,this.credentials=x.credentials,P.headers||(this.headers=new w(x.headers)),this.method=x.method,this.mode=x.mode,this.signal=x.signal,!L&&x._bodyInit!=null&&(L=x._bodyInit,x.bodyUsed=!0)}else this.url=String(x);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new w(P.headers)),this.method=U(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal||function(){if("AbortController"in a){var I=new AbortController;return I.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&L)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(L),(this.method==="GET"||this.method==="HEAD")&&(P.cache==="no-store"||P.cache==="no-cache")){var O=/([?&])_=[^&]*/;if(O.test(this.url))this.url=this.url.replace(O,"$1_="+new Date().getTime());else{var j=/\?/;this.url+=(j.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}G.prototype.clone=function(){return new G(this,{body:this._bodyInit})};function oe(x){var P=new FormData;return x.trim().split("&").forEach(function(L){if(L){var O=L.split("="),j=O.shift().replace(/\+/g," "),I=O.join("=").replace(/\+/g," ");P.append(decodeURIComponent(j),decodeURIComponent(I))}}),P}function K(x){var P=new w,L=x.replace(/\r?\n[\t ]+/g," ");return L.split("\r").map(function(O){return O.indexOf(` -`)===0?O.substr(1,O.length):O}).forEach(function(O){var j=O.split(":"),I=j.shift().trim();if(I){var D=j.join(":").trim();try{P.append(I,D)}catch(M){console.warn("Response "+M.message)}}}),P}B.call(G.prototype);function N(x,P){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(P||(P={}),this.type="default",this.status=P.status===void 0?200:P.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=P.statusText===void 0?"":""+P.statusText,this.headers=new w(P.headers),this.url=P.url||"",this._initBody(x)}B.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 x=new N(null,{status:200,statusText:""});return x.ok=!1,x.status=0,x.type="error",x};var k=[301,302,303,307,308];N.redirect=function(x,P){if(k.indexOf(P)===-1)throw new RangeError("Invalid status code");return new N(null,{status:P,headers:{location:x}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(P,L){this.message=P,this.name=L;var O=Error(P);this.stack=O.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function b(x,P){return new Promise(function(L,O){var j=new G(x,P);if(j.signal&&j.signal.aborted)return O(new o.DOMException("Aborted","AbortError"));var I=new XMLHttpRequest;function D(){I.abort()}I.onload=function(){var le={statusText:I.statusText,headers:K(I.getAllResponseHeaders()||"")};j.url.indexOf("file://")===0&&(I.status<200||I.status>599)?le.status=200:le.status=I.status,le.url="responseURL"in I?I.responseURL:le.headers.get("X-Request-URL");var H="response"in I?I.response:I.responseText;setTimeout(function(){L(new N(H,le))},0)},I.onerror=function(){setTimeout(function(){O(new TypeError("Network request failed"))},0)},I.ontimeout=function(){setTimeout(function(){O(new TypeError("Network request timed out"))},0)},I.onabort=function(){setTimeout(function(){O(new o.DOMException("Aborted","AbortError"))},0)};function M(le){try{return le===""&&a.location.href?a.location.href:le}catch{return le}}if(I.open(j.method,M(j.url),!0),j.credentials==="include"?I.withCredentials=!0:j.credentials==="omit"&&(I.withCredentials=!1),"responseType"in I&&(l.blob?I.responseType="blob":l.arrayBuffer&&(I.responseType="arraybuffer")),P&&typeof P.headers=="object"&&!(P.headers instanceof w||a.Headers&&P.headers instanceof a.Headers)){var X=[];Object.getOwnPropertyNames(P.headers).forEach(function(le){X.push(h(le)),I.setRequestHeader(le,g(P.headers[le]))}),j.headers.forEach(function(le,H){X.indexOf(H)===-1&&I.setRequestHeader(H,le)})}else j.headers.forEach(function(le,H){I.setRequestHeader(H,le)});j.signal&&(j.signal.addEventListener("abort",D),I.onreadystatechange=function(){I.readyState===4&&j.signal.removeEventListener("abort",D)}),I.send(typeof j._bodyInit>"u"?null:j._bodyInit)})}return b.polyfill=!0,a.fetch||(a.fetch=b,a.Headers=w,a.Request=G,a.Response=N),o.Headers=w,o.Request=G,o.Response=N,o.fetch=b,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(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})(BI,BI.exports);var yHe=BI.exports;const GB=wa(yHe);var vHe=Object.defineProperty,wHe=Object.defineProperties,bHe=Object.getOwnPropertyDescriptors,KB=Object.getOwnPropertySymbols,_He=Object.prototype.hasOwnProperty,xHe=Object.prototype.propertyIsEnumerable,YB=(t,e,r)=>e in t?vHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ZB=(t,e)=>{for(var r in e||(e={}))_He.call(e,r)&&YB(t,r,e[r]);if(KB)for(var r of KB(e))xHe.call(e,r)&&YB(t,r,e[r]);return t},JB=(t,e)=>wHe(t,bHe(e));const EHe={Accept:"application/json","Content-Type":"application/json"},CHe="POST",QB={headers:EHe,method:CHe},XB=10;let ac=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new oo.EventEmitter,this.isAvailable=!1,this.registering=!1,!pB(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=Cd(e),n=await(await GB(this.url,JB(ZB({},QB),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!pB(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",s=>{this.resetMaxListeners(),i(s)}),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=Cd({id:1,jsonrpc:"2.0",method:"test",params:[]});await GB(e,JB(ZB({},QB),{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"?N0(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=W_(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return $te(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>XB&&this.events.setMaxListeners(XB)}};const eW="error",AHe="wss://relay.walletconnect.org",SHe="wc",IHe="universal_provider",tW=`${SHe}@2:${IHe}:`,tre="https://rpc.walletconnect.org/v1/",Xp="generic",THe=`${tre}bundler`,hl={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var $He=Object.defineProperty,kHe=Object.defineProperties,NHe=Object.getOwnPropertyDescriptors,rW=Object.getOwnPropertySymbols,PHe=Object.prototype.hasOwnProperty,RHe=Object.prototype.propertyIsEnumerable,nW=(t,e,r)=>e in t?$He(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ob=(t,e)=>{for(var r in e||(e={}))PHe.call(e,r)&&nW(t,r,e[r]);if(rW)for(var r of rW(e))RHe.call(e,r)&&nW(t,r,e[r]);return t},MHe=(t,e)=>kHe(t,NHe(e));function va(t,e,r){var n;const i=L1(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${tre}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function op(t){return t.includes(":")?t.split(":")[1]:t}function rre(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function OHe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function rC(t={},e={}){const r=iW(t),n=iW(e);return mHe.merge(r,n)}function iW(t){var e,r,n,i;const s={};if(!lv(t))return s;for(const[o,a]of Object.entries(t)){const l=MN(o)?[o]:a.chains,c=a.methods||[],u=a.events||[],f=a.rpcMap||{},h=Sy(o);s[h]=MHe(Ob(Ob({},s[h]),a),{chains:P5(l,(e=s[h])==null?void 0:e.chains),methods:P5(c,(r=s[h])==null?void 0:r.methods),events:P5(u,(n=s[h])==null?void 0:n.events),rpcMap:Ob(Ob({},f),(i=s[h])==null?void 0:i.rpcMap)})}return s}function jHe(t){return t.includes(":")?t.split(":")[2]:t}function sW(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=MN(r)?[r]:n.chains?n.chains:rre(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function nC(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 nre={},Zr=t=>nre[t],iC=(t,e)=>{nre[t]=e};let DHe=class{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=op(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||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new ac(n,Zr("disableProviderPing")))}};var LHe=Object.defineProperty,FHe=Object.defineProperties,UHe=Object.getOwnPropertyDescriptors,oW=Object.getOwnPropertySymbols,BHe=Object.prototype.hasOwnProperty,WHe=Object.prototype.propertyIsEnumerable,aW=(t,e,r)=>e in t?LHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lW=(t,e)=>{for(var r in e||(e={}))BHe.call(e,r)&&aW(t,r,e[r]);if(oW)for(var r of oW(e))WHe.call(e,r)&&aW(t,r,e[r]);return t},cW=(t,e)=>FHe(t,UHe(e));class zHe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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||va(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new ac(n,Zr("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(op(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 s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);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(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. 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 s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const o=this.client.session.get(e.topic),a=((i=o==null?void 0:o.sessionProperties)==null?void 0:i.capabilities)||{};if(a!=null&&a[s])return a==null?void 0:a[s];const l=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:cW(lW({},o.sessionProperties||{}),{capabilities:cW(lW({},a||{}),{[s]: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),s=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(s){const a=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(a,e)}catch(l){console.warn("Failed to fetch call status from bundler",l,a)}}const o=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,e)}catch(a){console.warn("Failed to fetch call status from custom bundler",a,o)}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),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(vf("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${THe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class HHe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=op(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||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new ac(n,Zr("disableProviderPing")))}}let qHe=class{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=op(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||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new ac(n,Zr("disableProviderPing")))}};class VHe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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||va(`${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(hl.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||va(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new fl(new ac(n,Zr("disableProviderPing")))}}let GHe=class{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=op(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 fl(new ac(n,Zr("disableProviderPing")))}};class KHe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=op(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||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new ac(n,Zr("disableProviderPing")))}}let YHe=class{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=op(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||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new ac(n,Zr("disableProviderPing")))}};class ZHe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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||va(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(hl.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||va(e,this.namespace);return typeof n>"u"?void 0:new fl(new ac(n,Zr("disableProviderPing")))}}class JHe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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||va(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(hl.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||va(e,this.namespace);return typeof n>"u"?void 0:new fl(new ac(n))}}class QHe{constructor(e){this.name=Xp,this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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 s=L1(i);n[`${s.namespace}:${s.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||va(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new ac(n,Zr("disableProviderPing")))}}var XHe=Object.defineProperty,eqe=Object.defineProperties,tqe=Object.getOwnPropertyDescriptors,uW=Object.getOwnPropertySymbols,rqe=Object.prototype.hasOwnProperty,nqe=Object.prototype.propertyIsEnumerable,dW=(t,e,r)=>e in t?XHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jb=(t,e)=>{for(var r in e||(e={}))rqe.call(e,r)&&dW(t,r,e[r]);if(uW)for(var r of uW(e))nqe.call(e,r)&&dW(t,r,e[r]);return t},sC=(t,e)=>eqe(t,tqe(e));let iqe=class ire{constructor(e){this.events=new Rk,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:ww(U_({level:(e==null?void 0:e.logger)||eW})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new ire(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:jb({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,B_(s,o))).catch(o=>r(o,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:sn("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 s=await i();if(this.session=s.session,this.session){const o=sW(this.session.namespaces);this.namespaces=rC(this.namespaces,o),this.persist("namespaces",this.namespaces),this.onConnect()}return s}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(s=>{this.session=s;const o=sW(s.namespaces);this.namespaces=rC(this.namespaces,o),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Xte)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===Xp?s.setDefaultChain(`${n}:${i}`,r):s.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(Ad(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 gHe.init({core:this.providerOpts.core,logger:this.providerOpts.logger||eW,relayUrl:this.providerOpts.relayUrl||AHe,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=>Sy(r)))];iC("client",this.client),iC("events",this.events),iC("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=OHe(r,this.session),i=rre(n),s=rC(this.namespaces,this.optionalNamespaces),o=sC(jb({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new zHe({namespace:o});break;case"algorand":this.rpcProviders[r]=new VHe({namespace:o});break;case"solana":this.rpcProviders[r]=new HHe({namespace:o});break;case"cosmos":this.rpcProviders[r]=new qHe({namespace:o});break;case"polkadot":this.rpcProviders[r]=new DHe({namespace:o});break;case"cip34":this.rpcProviders[r]=new GHe({namespace:o});break;case"elrond":this.rpcProviders[r]=new KHe({namespace:o});break;case"multiversx":this.rpcProviders[r]=new YHe({namespace:o});break;case"near":this.rpcProviders[r]=new ZHe({namespace:o});break;case"tezos":this.rpcProviders[r]=new JHe({namespace:o});break;default:this.rpcProviders[Xp]?this.rpcProviders[Xp].updateNamespace(o):this.rpcProviders[Xp]=new QHe({namespace:o})}})}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&&Ad(i)&&this.events.emit("accountsChanged",i.map(jHe))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Sy(i),a=nC(i)!==nC(s)?`${o}:${nC(s)}`:i;this.onChainChanged(a)}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,s=(n=this.client)==null?void 0:n.session.get(e);this.session=sC(jb({},s),{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",sC(jb({},sn("USER_DISCONNECTED")),{data:e.topic}))}),this.on(hl.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[Xp]}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(o=>Sy(o)).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=Sy(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}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(`${tW}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${tW}/${e}`)}};const sqe=iqe,oqe="wc",aqe="ethereum_provider",lqe=`${oqe}@2:${aqe}:`,cqe="https://rpc.walletconnect.org/v1/",WI=["eth_sendTransaction","personal_sign"],sre=["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"],zI=["chainChanged","accountsChanged"],ore=["chainChanged","accountsChanged","message","disconnect","connect"];var uqe=Object.defineProperty,dqe=Object.defineProperties,fqe=Object.getOwnPropertyDescriptors,fW=Object.getOwnPropertySymbols,hqe=Object.prototype.hasOwnProperty,pqe=Object.prototype.propertyIsEnumerable,hW=(t,e,r)=>e in t?uqe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,e1=(t,e)=>{for(var r in e||(e={}))hqe.call(e,r)&&hW(t,r,e[r]);if(fW)for(var r of fW(e))pqe.call(e,r)&&hW(t,r,e[r]);return t},oC=(t,e)=>dqe(t,fqe(e));function u4(t){return Number(t[0].split(":")[1])}function Db(t){return`0x${t.toString(16)}`}function gqe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!Ad(e))throw new Error("Invalid chains");const l={chains:e,methods:n||WI,events:s||zI,rpcMap:e1({},e.length?{[u4(e)]:a[u4(e)]}:{})},c=s==null?void 0:s.filter(g=>!zI.includes(g)),u=n==null?void 0:n.filter(g=>!WI.includes(g));if(!r&&!o&&!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:sre))],events:[...new Set(l.events.concat(o!=null&&o.length?o:ore))],rpcMap:a};return{required:e.length?l:void 0,optional:r.length?h:void 0}}let mqe=class are{constructor(){this.events=new oo.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=lqe,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 are;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}=gqe(this.rpc);try{const i=await new Promise(async(o,a)=>{var l;this.rpc.showQrModal&&((l=this.modal)==null||l.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(oC(e1({namespaces:e1({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(c=>{o(c)}).catch(c=>{a(new Error(c.message))})});if(!i)return;const s=kU(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Db(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(s,o)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(oC(e1({},e),{chains:this.rpc.chains}),r).then(l=>{s(l)}).catch(l=>{o(new Error(l.message))})}),i=n.session;if(i){const s=kU(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Db(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",Db(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",oC(e1({},sn("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",Db(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:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],o=i.concat(s);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=i.length?(e==null?void 0:e.methods)||WI:[],l=i.length?(e==null?void 0:e.events)||zI:[],c=(e==null?void 0:e.optionalMethods)||[],u=(e==null?void 0:e.optionalEvents)||[],f=(e==null?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),h=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:s.map(g=>this.formatChainId(g)),methods:a,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?u4(this.rpc.chains):u4(this.rpc.optionalChains),this.signer=await sqe.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 Oo(()=>import("./index-Cr0fblK2.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(e1({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&&Ad(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&Ad(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${cqe}?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 yqe=mqe;let F1=class extends Yg{async initialize(){var n,i,s,o;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 a=iE((o=(s=this.walletProvider)==null?void 0:s.session)==null?void 0:o.peer.metadata.url);this.walletEntry=a==null?void 0:a.entry,this.walletClientType=(a==null?void 0:a.walletClientType)||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:r}=await Oo(()=>import("./index-Cr0fblK2.js").then(a=>a.i),[]);this.modal=new r({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(a=>{var l;a.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,s,o,a,l;if(this.walletClientType==="metamask")return{name:"MetaMask",icon:YPe,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:zEe(((o=(s=this.walletProvider)==null?void 0:s.session)==null?void 0:o.peer.metadata.name)||"")||"WalletConnect",icon:typeof e=="string"?e:tRe,id:((l=(a=this.walletProvider)==null?void 0:a.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=US[e]),this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,ZEe(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((e,r)=>{this.onQrModalClosed=()=>{r(new mX)},(async()=>{var s,o,a,l,c;let n="",i=await Promise.race([(s=this.walletProvider)==null?void 0:s.enable(),this.proxyProvider.walletTimeout()]);if(i!=null&&i.length&&(n=i[0]),!n||n==="")throw new Nn("Unable to retrieve address");if((a=(o=this.walletProvider)==null?void 0:o.session)!=null&&a.peer.metadata.url){let u=iE((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=Yk(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(i),e()})().catch(n=>{r(n?Q0(n):new Nn("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 s of this.chains){let o=qEe(s.id,this.chains,this.rpcConfig,this.privyAppId);o&&(e[s.id]=o)}let r=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(s=>s.id),i=await yqe.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:ore,optionalMethods:sre,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",s=>{var o,a;if(i.signer.abortPairingAttempt(),this.walletEntry){let{redirect:l,href:c}=KEe(s,this.walletEntry);JEe({href:c,name:this.walletEntry.displayName}),this.redirectUri=l;let u=YEe(s,this.walletEntry);u!=null&&u.redirect&&(this.fallbackUniversalRedirectUri=u.redirect),cs&&xJ(l,"_self"),(o=this.showPrivyQrModal)==null||o.call(this,{native:l,universal:this.fallbackUniversalRedirectUri})}else(a=this.modal)==null||a.openModal({uri:s,chains:[this.defaultChain.id]})}),i.on("connect",()=>{var s,o,a;if((s=this.modal)==null||s.closeModal(),(o=i.session)==null?void 0:o.peer.metadata.url){let l=iE((a=i.session)==null?void 0:a.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,s,o,a,l){super(l||"unknown",n,i,r),this.connectorType="wallet_connect_v2",this.privyAppId=o,this.privyAppName=a,this.walletConnectCloudProjectId=e,this.rpcConfig=r,this.shouldEnforceDefaultChainOnConnect=s,this.proxyProvider=new Vs(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=US[l],this.walletClientType=l)}};var vqe=(t,e)=>{let r=T.useRef(()=>{});T.useEffect(()=>{r.current=t}),T.useEffect(()=>{if(e!==null){let n=setInterval(()=>r.current(),e||0);return()=>clearInterval(n)}},[e])};function wqe(){let[t,e]=T.useState(!1),r=T.useCallback(()=>{document.hidden&&e(!0)},[]);return T.useEffect(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:t,reset:()=>e(!1)}}const lre=t=>(t==null?void 0:t.privyErrorCode)===Se.LINKED_TO_ANOTHER_USER?uf.ERROR_USER_EXISTS:t instanceof Vl&&!t.details.default?t.details:t instanceof gX?uf.ERROR_TIMED_OUT:t instanceof mX?uf.ERROR_USER_REJECTED_CONNECTION:(t==null?void 0:t.privyErrorCode)===Se.CANNOT_LINK_MORE_OF_TYPE?uf.ERROR_USER_LIMIT_REACHED:uf.ERROR_WALLET_CONNECTION,bqe=()=>{var be,Ce,Fe,Ue,Ye,lt,xe,He,Ve,Ie,Ne;let t,[e,r]=T.useState(!1),[n,i]=T.useState(!1),[s,o]=T.useState(void 0),{authenticated:a,logout:l}=Pr(),{app:c,navigate:u,navigateBack:f,lastScreen:h,currentScreen:g,setModalData:m,data:w}=vt(),{getAuthFlow:E,walletConnectionStatus:v,closePrivyModal:_,initLoginWithWallet:A,loginWithWallet:C,updateWallets:R,createAnalyticsEvent:B}=xt(),{walletConnectors:S}=Pr(),[U,G]=T.useState(0),{user:oe}=Pr(),[K]=T.useState((oe==null?void 0:oe.linkedAccounts.length)||0),[N,k]=T.useState(""),[b,x]=T.useState(""),[P,L]=T.useState(!1),{hasTabbedAway:O}=wqe(),{enabled:j,token:I}=Ca(),D=cs&&((be=v==null?void 0:v.connector)==null?void 0:be.connectorType)==="wallet_connect_v2"||cs&&((Ce=v==null?void 0:v.connector)==null?void 0:Ce.connectorType)==="coinbase_wallet"||cs&&((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",M=(v==null?void 0:v.status)==="connected",X=(v==null?void 0:v.status)==="switching_to_supported_chain";T.useEffect(()=>{var Y;let Oe=E(),Me=Oe instanceof P6||Oe instanceof VS?Oe:void 0;M&&!Me&&(!j||I||a?A(v.connectedWallet,I,(Y=w==null?void 0:w.login)==null?void 0:Y.disableSignup).then(()=>{L(!0)}):(m({captchaModalData:{callback:F=>{var z;return A(v.connectedWallet,F,(z=w==null?void 0:w.login)==null?void 0:z.disableSignup).then(()=>{L(!0)})},userIntentRequired:!1,onSuccessNavigateTo:ye.AWAITING_CONNECTION,onErrorNavigateTo:ye.ERROR_SCREEN}}),u(ye.CAPTCHA_SCREEN,!1))),Me&&D&&M&&!Me.preparedMessage?Me.buildMessage():Me&&!D&&M&&(n||(async()=>{var F,z;i(!0),o(void 0);try{((F=v==null?void 0:v.connector)==null?void 0:F.connectorType)==="wallet_connect_v2"&&((z=v==null?void 0:v.connector)==null?void 0:z.walletClientType)==="metamask"&&await mJ(2500),await H()}catch(ie){console.warn("Auto-prompted signature failed",ie)}finally{i(!1)}})())},[U,M,P]),T.useEffect(()=>{var Oe;if(oe&&e){let Me=Rn-500;if(c!=null&&c.legal.requireUsersAcceptTerms&&!oe.hasAcceptedTerms){let F=setTimeout(()=>{u(ye.AFFIRMATIVE_CONSENT_SCREEN)},Me);return()=>clearTimeout(F)}if(wd(oe,(Oe=c==null?void 0:c.embeddedWallets)==null?void 0:Oe.createOnLogin)){let F=setTimeout(()=>{m({createWallet:{onSuccess:()=>{},onFailure:z=>{console.error(z),B({eventName:"embedded_wallet_creation_failure_logout",payload:{error:z,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),u(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Me);return()=>clearTimeout(F)}R();let Y=setTimeout(()=>_({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Rn);return()=>clearTimeout(Y)}},[oe,e]);let le=Oe=>{var Me,Y,F,z,ie,pe,ve,he,De,Ze,et,it,ut,pt;if((Oe==null?void 0:Oe.privyErrorCode)!==Se.ALLOWLIST_REJECTED){if((Oe==null?void 0:Oe.privyErrorCode)===Se.USER_LIMIT_REACHED)return console.error(new Vv(Oe).toString()),void u(ye.USER_LIMIT_REACHED_SCREEN);if((Oe==null?void 0:Oe.privyErrorCode)!==Se.USER_DOES_NOT_EXIST)return(Oe==null?void 0:Oe.privyErrorCode)===Se.ACCOUNT_TRANSFER_REQUIRED&&((Y=(Me=Oe.data)==null?void 0:Me.data)!=null&&Y.nonce)?(m({accountTransfer:{nonce:(z=(F=Oe.data)==null?void 0:F.data)==null?void 0:z.nonce,account:(ie=E())==null?void 0:ie.meta.address,displayName:(he=(ve=(pe=Oe.data)==null?void 0:pe.data)==null?void 0:ve.account)==null?void 0:he.displayName,externalWalletMetadata:{walletClientType:(De=E())==null?void 0:De.meta.walletClientType,chainId:(Ze=E())==null?void 0:Ze.meta.chainId,connectorType:(et=E())==null?void 0:et.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:(pt=(ut=(it=Oe.data)==null?void 0:it.data)==null?void 0:ut.otherUser)==null?void 0:pt.embeddedWalletAddress}}),void u(ye.LINK_CONFLICT_SCREEN)):void o(lre(Oe));u(ye.ACCOUNT_NOT_FOUND_SCREEN)}else u(ye.ALLOWLIST_REJECTION_SCREEN)};async function H(){try{await C(),r(!0)}catch(Oe){le(Oe)}finally{i(!1)}}T.useEffect(()=>{v!=null&&v.connectError&&le(v==null?void 0:v.connectError)},[v]),vqe(()=>{let Oe=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof F1?v.connector.redirectUri:void 0;Oe&&k(Oe);let Me=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof F1?v.connector.fallbackUniversalRedirectUri:void 0;Me&&x(Me)},(v==null?void 0:v.connector)instanceof F1&&!N?500:null);let ee=((Ye=v==null?void 0:v.connector)==null?void 0:Ye.connectorType)||"injected",Z=((lt=v==null?void 0:v.connector)==null?void 0:lt.walletClientType)||"unknown",te=((xe=Yc[Z])==null?void 0:xe.displayName)||((He=v==null?void 0:v.connector)==null?void 0:He.walletBranding.name)||"Browser Extension",re=((Ve=Yc[Z])==null?void 0:Ve.logo)||((Ie=v==null?void 0:v.connector)==null?void 0:Ie.walletBranding.icon)||(Oe=>d.jsx(yN,{...Oe})),W=te==="Browser Extension"?te.toLowerCase():te;t=e?`Successfully connected with ${W}`:s?s.message:X?"Switching networks":M?n&&D?"Signing":"Sign to verify":`Waiting for ${W}`;let q="Don’t see your wallet? Check your other browser windows.";e?q=K===((oe==null?void 0:oe.linkedAccounts.length)||0)?"Wallet was already linked.":"You’re good to go!":U>=2&&s?q="Unable to connect wallet":s?q=s.detail:X?q="Switch your wallet to the requested network.":M&&D?q="Sign the message in your wallet to verify it belongs to you.":Z==="metamask"&&cs?q="Click continue to open and connect MetaMask.":Z==="metamask"?q="For the best experience, connect only one wallet at a time.":ee==="wallet_connect"?q="Open your mobile wallet app to continue":ee!=="coinbase_wallet"||pJ()||(q=eU(oe)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let J=(Ne=S==null?void 0:S.walletConnectors)==null?void 0:Ne.find(Oe=>Oe.walletClientType==="coinbase_wallet"),me=Z==="coinbase_wallet"&&(eU(oe)||s===uf.ERROR_USER_EXISTS);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:h&&g!==h?f:void 0}),d.jsxs(_qe,{children:[d.jsx(cre,{walletLogo:re,success:e,fail:!!s}),d.jsxs(ya,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:q}),M||!N||O?null:d.jsxs("p",{children:["Still here?"," ",d.jsx("a",{href:N,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),b&&d.jsxs(d.Fragment,{children:[" ","or"," ",d.jsx("a",{href:b,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),me?d.jsx(Lt,{onClick:()=>J&&(J==null?void 0:J.disconnect()),disabled:e,children:"Use a different wallet"}):s==uf.ERROR_USER_EXISTS&&g!==h?d.jsx(Lt,{onClick:f,children:"Use a different wallet"}):M&&!e&&D?d.jsx(Lt,{onClick:()=>{i(!0),H()},disabled:n,children:n?"Signing":"Sign with your wallet"}):!e&&(s!=null&&s.retryable)&&U<2?d.jsx(Lt,{onClick:()=>{G(U+1),o(void 0),M?(i(!0),H()):v==null||v.connectRetry()},disabled:!e&&(!(s!=null&&s.retryable)||U>=2),children:"Retry"}):e||s?null:d.jsx(Lt,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),d.jsx($r,{})]})};let _qe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-afad057-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),xqe=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 cre=t=>{let e=t.walletLogo;return d.jsx(d.Fragment,{children:d.jsx(xqe,{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"}})]})})})},Eqe=()=>{var R,B,S,U,G,oe;let t,{navigateBack:e,navigate:r,lastScreen:n,currentScreen:i,data:s,setModalData:o}=vt(),{walletConnectionStatus:a,closePrivyModal:l}=xt(),[c,u]=T.useState(void 0),[f,h]=T.useState(0),g=(a==null?void 0:a.status)==="connected",m=(a==null?void 0:a.status)==="switching_to_supported_chain";T.useEffect(()=>{var K,N;if(g){let k;if((K=s==null?void 0:s.externalConnectWallet)!=null&&K.onCompleteNavigateTo){let b=s.externalConnectWallet.onCompleteNavigateTo,x=(N=a.connectedWallet)==null?void 0:N.address;k=setTimeout(()=>{var P;s.funding&&o({...s,funding:{...s.funding,connectedWalletAddress:x}}),r(b({walletChainType:(P=a.connector)==null?void 0:P.chainType}))},Rn)}else k=setTimeout(l,Rn);return()=>clearTimeout(k)}},[g]),T.useEffect(()=>{var K;a!=null&&a.connectError&&(K=a==null?void 0:a.connectError,u(lre(K)))},[a]);let w=((R=a==null?void 0:a.connector)==null?void 0:R.connectorType)||"injected",E=((B=a==null?void 0:a.connector)==null?void 0:B.walletClientType)||"unknown",v=((S=Yc[E])==null?void 0:S.displayName)||((U=a==null?void 0:a.connector)==null?void 0:U.walletBranding.name)||"Browser Extension",_=((G=Yc[E])==null?void 0:G.logo)||((oe=a==null?void 0:a.connector)==null?void 0:oe.walletBranding.icon)||(K=>d.jsx(yN,{...K})),A=v==="Browser Extension"?v.toLowerCase():v;t=g?`Successfully connected with ${A}`:c?c.message:m?"Switching networks":`Waiting for ${A}`;let C="Don’t see your wallet? Check your other browser windows.";return g?C="You’re good to go!":f>=2&&c?C="Unable to connect wallet":c?C=c.detail:m?C="Switch your wallet to the requested network.":E==="metamask"&&cs?C="Click to continue to open and connect MetaMask.":E==="metamask"?C="For the best experience, connect only one wallet at a time.":w==="wallet_connect_v2"?C="Open your mobile wallet app to continue":w==="coinbase_wallet"&&(C="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(Cqe,{children:[d.jsx(cre,{walletLogo:_,success:g,fail:!!c}),d.jsxs(ya,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:C})]}),c==uf.ERROR_USER_EXISTS?d.jsx(Lt,{onClick:e,children:"Use a different wallet"}):!g&&(c!=null&&c.retryable)&&f<2?d.jsx(Lt,{onClick:()=>{h(f+1),u(void 0),a==null||a.connectRetry()},disabled:!g&&(!(c!=null&&c.retryable)||f>=2),children:"Retry"}):!g&&c&&f>=2?d.jsx(Lt,{onClick:e,children:"Use a different wallet"}):null]}),d.jsx($r,{})]})};let Cqe=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 ure=({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 Aqe(t){let{logout:e}=T.useContext(Jg);return oN("logout",t),{logout:e}}const Sqe=()=>{let t=wi(),{data:e,navigate:r,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=vt(),{crossAppAuthFlow:s,updateWallets:o,closePrivyModal:a,createAnalyticsEvent:l}=xt(),{logout:c}=Aqe(),[u,f]=T.useState({}),h=e==null?void 0:e.crossAppAuth,g={id:h.appId,name:h.name,logoUrl:h.logoUrl},m=new Ee(`There was an issue connecting your ${g.name} account. Please try again.`),w=new Ks(async A=>{if(h.popup)try{let C=await s({appId:A,popup:h.popup,action:h.action});f({data:C})}catch(C){C instanceof Ee?f({error:C}):(C instanceof Ha&&h.popup&&h.popup.close(),f({error:m}))}else f({error:m})}),E=()=>{u.data&&(o(),h.onSuccess(u.data),a({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h.onError(u.error??new Ee("User canceled flow")),a({shouldCallAuthOnSuccess:!1,isSuccess:!1})};i.current=E,T.useEffect(()=>{g.id.length&&w.execute(g.id)},[g.id]),T.useEffect(()=>{var R;if(!u.data)return;let A=u.data;if(t.legal.requireUsersAcceptTerms&&!A.hasAcceptedTerms){let B=setTimeout(()=>{r(ye.AFFIRMATIVE_CONSENT_SCREEN)},Rn);return()=>clearTimeout(B)}if(wd(A,(R=t.embeddedWallets)==null?void 0:R.createOnLogin)){let B=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:S=>{console.error(S),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:S,provider:`privy:${g.id}`,screen:"CrossAppAuthScreen"}}),c()},callAuthOnSuccessOnClose:!0}}),r(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Rn);return()=>clearTimeout(B)}let C=setTimeout(E,Rn);return()=>clearTimeout(C)},[u.data]);let{title:v,subtitle:_}=T.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:E}),d.jsx(Qr,{}),d.jsxs(Iqe,{children:[d.jsx(Fo,{children:d.jsxs("div",{children:[d.jsx(ec,{success:!!u.data,fail:!!u.error}),d.jsx(ure,{name:g.name,logoUrl:g.logoUrl})]})}),d.jsxs(ya,{children:[d.jsx("h3",{children:v}),d.jsx("p",{children:_})]})]}),d.jsx(tn,{}),d.jsx($r,{})]})};let Iqe=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 Tqe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 lc=T.forwardRef(Tqe);function $qe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 kqe=T.forwardRef($qe),Nqe=fe.div.withConfig({displayName:"Column",componentId:"sc-cfc52180-0"})(["display:flex;flex-direction:column;"]),M0=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);"]),Pqe=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;"]),dre=es(["&&{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);":""),UN=fe.div.withConfig({displayName:"Box",componentId:"sc-1660059c-0"})(["",""],dre),V_=({errMsg:t,balance:e,address:r,isLoading:n,className:i,title:s,isPulsing:o,showIcon:a,statusColor:l="green"})=>{let c;return c=l||(t?"red":"green"),d.jsxs(d.Fragment,{children:[d.jsxs(UN,{className:i,$state:t?"error":void 0,children:[d.jsxs(Nqe,{children:[d.jsx(Pqe,{children:s||"Pay with"}),d.jsx(ca,{address:r,showCopyIcon:a||!!t})]}),e!==void 0&&d.jsx(nc,{isLoading:n,isPulsing:o,color:c,children:e})]}),t&&d.jsx(M0,{style:{marginTop:"0.25rem"},children:t})]})},Rqe=()=>{let{app:t,data:e}=vt(),{closePrivyModal:r}=xt(),[n,i]=T.useState(!1),[s,o]=T.useState(),{address:a,onDelegate:l,onSuccess:c,onError:u}=e.delegatedActions.consent,f=async()=>{n?c():u(s??new Ee("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return T.useEffect(()=>{if(!n&&!s)return;let h=setTimeout(f,Tk);return()=>clearTimeout(h)},[n,s]),d.jsxs(d.Fragment,n||s?{children:[d.jsx(ft,{onClose:f}),d.jsx(Qr,{}),d.jsxs(hN,{children:[s?d.jsx(y_,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(lc,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(gN,{height:20}),d.jsx(Fn,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":`You’ve successfully granted delegated action permissions to ${t.name}.`})]}),d.jsx(tn,{}),d.jsx(Jt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:f}),d.jsx(kqe,{width:56,height:56,style:{margin:"auto"}}),d.jsx(un,{style:{marginTop:24,color:"var(--privy-color-foreground)"},children:"Enable offline access"}),d.jsxs(dn,{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(Oqe,{showIcon:!0,address:a,title:"Wallet",isLoading:!1}),d.jsxs(Mqe,{style:{marginTop:24},children:[d.jsx(Ed,{onClick:f,children:"Not now"}),d.jsx(Lt,{onClick:async()=>{try{await l(),i(!0)}catch(h){o(h)}},children:"Accept"})]}),d.jsx(Jt,{})]})};let Mqe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-b99bc0c0-0"})(["display:flex;gap:10px;"]),Oqe=fe(V_).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-b99bc0c0-1"})(["margin-top:1.5rem;"]);function jqe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 Dqe=T.forwardRef(jqe),Lqe=()=>{let{app:t,data:e}=vt(),{closePrivyModal:r}=xt(),[n,i]=T.useState(!1),[s,o]=T.useState(),{onRevoke:a,onSuccess:l,onError:c}=e.delegatedActions.revoke,u=async()=>{n?l():c(s??new Ee("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return T.useEffect(()=>{if(!n&&!s)return;let f=setTimeout(u,Tk);return()=>clearTimeout(f)},[n,s]),d.jsxs(d.Fragment,n||s?{children:[d.jsx(ft,{onClose:u}),d.jsx(Qr,{}),d.jsxs(hN,{children:[s?d.jsx(y_,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(lc,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(gN,{height:20}),d.jsx(Fn,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":"You've successfully revoked permissions."})]}),d.jsx(tn,{}),d.jsx(Jt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:u}),d.jsx(Dqe,{width:56,height:56,style:{margin:"auto"}}),d.jsx(un,{style:{marginTop:24},children:"Revoke offline access to wallet"}),d.jsxs(dn,{children:["By confirming, ",t.name," will no longer be able to use this wallet on your behalf when you are not online."]}),d.jsxs(Fqe,{style:{marginTop:24},children:[d.jsx(Ed,{onClick:u,children:"Deny"}),d.jsx(Lt,{onClick:async()=>{try{await a(),i(!0)}catch(f){o(f)}},children:"Confirm"})]}),d.jsx(Jt,{})]})};let Fqe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-8ff214d7-0"})(["display:flex;gap:10px;"]);const fre=()=>d.jsx(Uqe,{children:d.jsxs(Bqe,{children:[d.jsx(Wqe,{}),d.jsx(zqe,{})]})});let Uqe=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;}"]),Bqe=fe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-85b54ede-1"})(["position:relative;height:140px;width:140px;opacity:1;animation:fadein 200ms ease;"]),Wqe=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%;}"]),zqe=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 Hqe=["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 Jn=class extends Error{constructor(e,r){super(r),this.type=e}};function sm(t){let e=t.type;return typeof e=="string"&&Hqe.includes(e)}function d4(t){return sm(t)&&t.type==="wallet_not_on_device"}function qqe(t){return sm(t)&&(t.type==="invalid_recovery_pin"||t.type==="invalid_request_arguments")}function BN(t){return!!sm(t)&&t.type==="mfa_timeout"}function WN(t){return!!sm(t)&&t.type==="missing_or_invalid_mfa"}function Vqe(t){return!!sm(t)&&t.type==="mfa_verification_max_attempts_reached"}function hre(t){return!(!sm(t)||!t.message.includes("code 429"))}function pre(t){return!!function(e){let r=e.type;return typeof r=="string"&&r==="client_error"}(t)&&t.message==="MFA canceled"}function G_(){return E6(HS(36))}function zN(){return G_()}async function HN(t,e="S256"){if(e!="S256")return t;{let r=await aCe(t);return E6(r)}}function Gqe(){let t=Dt.get(xy);if(!t)throw new Ee("Authentication error.");return t}function gre({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 mre({walletAction:t,availableRecoveryMethods:e,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:i}){return i?ye.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:r||e.length===1?gre({isCreatingWallet:t==="create",skipSplashScreen:n}):ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN}function yre(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 pW({api:t,provider:e}){let r=G_(),n=zN(),i=await HN(r);try{return e==="icloud"?{url:(await t.post(yEe,{client_type:"web"})).url}:{url:(await t.post(mEe,{redirect_to:window.location.href,code_challenge:i,state_code:n})).url,codeVerifier:r,stateCode:n,provider:e}}catch(s){throw Hr(s)}}async function Kqe({api:t,provider:e,stateCode:r,codeVerifier:n,authorizationCode:i}){if(!i||!r)throw new Ee("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(i==="undefined")throw new Ee("User denied confirmation during OAuth flow");try{return(await t.post(vEe,{authorization_code:i,state_code:r,code_verifier:n,provider:e})).access_token}catch(s){let o=Hr(s);throw o.privyErrorCode?new Ee(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new Ee("Invalid code during oauth flow.",void 0,Se.OAUTH_USER_DENIED):new Ee("Invalid code during OAuth flow.",void 0,Se.UNKNOWN_AUTH_ERROR)}}const Yqe=()=>{let{authenticated:t,user:e,getAccessToken:r}=Pr(),{closePrivyModal:n,createAnalyticsEvent:i,walletProxy:s}=xt(),{navigate:o,data:a,setModalData:l,onUserCloseViaDialogOrKeybindRef:c}=vt(),u=T.useMemo(()=>Date.now(),[]),[f,h]=T.useState(!1),{onCompleteNavigateTo:g,onFailure:m,shouldForceMFA:w,entropyId:E,entropyIdVerifier:v}=a==null?void 0:a.connectWallet,_=C=>{f||(h(!0),m(typeof C=="string"?Error(C):C))};T.useEffect(()=>{let C,R=M6(e,E);return t&&R?s?((async()=>{let B=await r();if(!B)return _("User must be authenticated and have a Privy wallet before it can be connected");try{await s.connect({accessToken:B,entropyId:E,entropyIdVerifier:v}),w&&await s.verifyMfa({accessToken:B});let S=(Date.now()-u)/1e3;g===ye.EMBEDDED_WALLET_KEY_EXPORT_SCREEN&&S<1?C=setTimeout(()=>{o(g,!1)},1e3*(1-S)):o(g,!1)}catch(S){if(d4(S)&&R.recoveryMethod==="privy"){let U=await r();if(!U)return _("User must be authenticated and have a Privy wallet before it can be recovered");try{i({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:R.address}});let G=await(s==null?void 0:s.recover({accessToken:U,entropyId:E,entropyIdVerifier:v}));G!=null&&G.entropyId||_(Error("Unable to recover wallet")),g?o(g):n({shouldCallAuthOnSuccess:!1}),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:R.address}}),o(g)}catch{_("An error has occurred, please try again.")}}else d4(S)&&R.recoveryMethod!=="privy"?(l({...a,recoverWallet:{entropyId:E,entropyIdVerifier:v,onCompleteNavigateTo:g,onFailure:m},recoveryOAuthStatus:{provider:R.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),o(yre(R.recoveryMethod))):_(S)}})(),()=>clearTimeout(C)):void 0:_("User must be authenticated and have a Privy wallet before it can be connected")},[t,e,s]);let A=()=>{_("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(Pd,{children:[d.jsx(x_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(Fn,{title:"Something went wrong",description:"We’re on it. Please try again later."})]}),d.jsx(Lt,{onClick:()=>n({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):d.jsx(fre,{}),d.jsx(Zqe,{})]})};let Zqe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-124dbb1c-0"})(["height:44px;"]);const Jqe=()=>{let{user:t}=Pr(),{closePrivyModal:e,isNewUserThisSession:r,updateWallets:n}=xt(),{app:i,data:s,onUserCloseViaDialogOrKeybindRef:o}=vt(),{onSuccess:a,onFailure:l,callAuthOnSuccessOnClose:c}=s.createWallet,u=()=>{let f=xo(t);f?(n(),a(f)):l(Error("Failed to create wallet")),e({shouldCallAuthOnSuccess:c})};return T.useEffect(()=>{let f=setTimeout(u,Tk);return()=>clearTimeout(f)},[]),o.current=u,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:u}),d.jsx(Qr,{}),d.jsxs(Pd,{children:[d.jsx($0,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(Fn,{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(tn,{}),d.jsx(Jt,{})]})},Qqe=({children:t,theme:e})=>d.jsxs(Xqe,{$theme:e,children:[d.jsx(Nd,{width:"1.25rem",color:e==="dark"?"#FDE68A":"var(--privy-color-warn)"}),t]});let Xqe=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 ap=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);}"]),Wf=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;"]),eVe=()=>{let[t,e]=T.useState(null),{authenticated:r,user:n,getAccessToken:i}=Pr(),{closePrivyModal:s,createAnalyticsEvent:o,clientAnalyticsId:a}=xt(),l=wi(),{data:c,onUserCloseViaDialogOrKeybindRef:u}=vt(),{onFailure:f,onSuccess:h,origin:g,appId:m,appClientId:w,walletToExport:E,primaryWallet:v}=c.keyExport,_=C=>{s({shouldCallAuthOnSuccess:!1}),f(typeof C=="string"?Error(C):C)},A=()=>{s({shouldCallAuthOnSuccess:!1}),h(),o({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:E.address}})};return T.useEffect(()=>{if(!r||!E)return _("User must be authenticated before exporting their wallet");i().then(e,_)},[r,n]),u.current=A,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:A}),d.jsxs(rVe,{children:[d.jsx(Wf,{children:"Transfer wallet"}),d.jsxs(ap,{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(Qqe,{theme:l.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),d.jsx(V_,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:E.address,showIcon:!0}),d.jsx("div",{style:{width:"100%"},children:t&&d.jsx(tVe,{origin:g,appId:m,appClientId:w,accessToken:t,clientAnalyticsId:a,walletToExport:E,primaryWallet:v,dimensions:{height:"44px"}})})]}),d.jsx(Jt,{})]})};function tVe(t){let[e,r]=T.useState(t.dimensions.width),[n,i]=T.useState(void 0),s=T.useRef(null);T.useEffect(()=>{if(s.current&&e===void 0){let{width:l}=s.current.getBoundingClientRect();r(l)}let a=getComputedStyle(document.documentElement);i({background:a.getPropertyValue("--privy-color-background"),background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]);let o=t.walletToExport.chainType==="ethereum"&&!t.walletToExport.imported;return d.jsx("div",{ref:s,children:e&&d.jsxs(nVe,{children:[d.jsx("iframe",{style:{position:"absolute",zIndex:1},width:e,height:t.dimensions.height,allow:"clipboard-write self *",src:yJ(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:o,...n},{token:t.accessToken})}),d.jsx(gW,{children:"Loading..."}),o&&d.jsx(gW,{children:"Loading..."})]})})}let rVe=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-eaab13a9-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),nVe=fe.div.withConfig({displayName:"ButtonContainer",componentId:"sc-eaab13a9-1"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),gW=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 vre(){let{getAccessToken:t}=Pr(),{refreshUser:e,createAnalyticsEvent:r,initializeWalletProxy:n}=xt(),i=T.useRef(!1);return{createWallet:T.useCallback(async({user:s,recoveryPassword:o})=>{let a=await t();if(!a)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($k);if(!l)throw Error("walletProxy does not exist.");let c=new Promise((g,m)=>{setTimeout(()=>{m(Error("walletProxy.create timed out."))},2e4)}),u=Oc(s);if(!await Promise.race([l.create({accessToken:a,recoveryPassword:o,recoveryMethod:o?"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=xo(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 iVe=()=>{let{app:t,setModalData:e,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=vt(),[s,o]=T.useState(""),{embeddedWallets:a}=wi(),{authenticated:l,user:c}=Pr(),{closePrivyModal:u}=xt(),{onSuccess:f,onFailure:h,callAuthOnSuccessOnClose:g}=n.createWallet,m=(t==null?void 0:t.embeddedWallets.requireUserOwnedRecoveryOnCreate)===!0,{createWallet:w}=vre(),[E,v]=T.useState(null),_=new Ks(async()=>{try{let A=await w({user:c});if(!A)return;v(A),r(ye.EMBEDDED_WALLET_CREATED_SCREEN)}catch(A){o(A.message)}});return T.useEffect(()=>l&&c?m?(e({...n,recoverySelection:{...n==null?void 0:n.recoverySelection,isInAccountCreateFlow:!0}}),r(mre({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:a.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void _.execute():(r(ye.LANDING),void h(Error("User must be authenticated before creating a Privy wallet"))),[m,l]),i.current=()=>null,s?d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsxs(Pd,{children:[d.jsx(x_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(Fn,{title:"Something went wrong",description:s})]}),d.jsx(Lt,{onClick:()=>{E?(f(E),u({shouldCallAuthOnSuccess:g})):(h(new kf("User wallet creation failed")),u({shouldCallAuthOnSuccess:!1}))},children:"Close"}),d.jsx(sVe,{})]}):d.jsx(fre,{})};let sVe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-eabafbf4-0"})(["height:44px;"]);var oVe=function(e,r){return Math.round(r*Math.log(e)/Math.LN2)},aVe=[{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}],lVe=function(e){return function(r){return e.reduce(function(n,i){return n+(i.re.test(r)?i.length:0)},0)}},cVe=lVe(aVe),uVe=function(e){return e?oVe(cVe(e),e.length):0},dVe=uVe;const fVe=wa(dVe);function wre(t){return crypto.getRandomValues(new Uint8Array(t))}const hVe=256,Xy=65536;function pVe(){const[t]=wre(1);return t}function gVe(){const[t,e]=wre(2);return(t<<8)+e}function mVe(t){if(typeof t!="number"||t<2||t>Xy)throw new Error(`Invalid number: number must be at least two and at most ${Xy}`);const e=t>256,r=e?Xy:hVe,n=e?gVe:pVe,i=t*Math.floor(r/t);for(;;){const s=n();if(sXy)throw new Error(`Invalid argument: end must be a number less than or equal to ${Xy}`);if(r-e<2)throw new Error("Invalid range: range must contain at least two values");const n=[];for(let i=0;i{const o=e[i];return n+(s===0?o:r+o)},"")}const wVe=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"]),bVe=Object.freeze(wVe.filter(t=>!t.includes("-")));let _Ve=/[a-z]/,xVe=/[A-Z]/,EVe=/[0-9]/,bre="!@#$%^&*()\\-_+.",_re=`a-zA-Z0-9${bre}`,CVe=RegExp(`[${bre}]`),AVe=RegExp(`[${_re}]`);const SVe=RegExp(`^[${_re}]{6,}$`),IVe=(t="")=>[...new Set(t.split("").filter(e=>!AVe.test(e)).map(e=>e.replace(" ","SPACE")))],xre=()=>vVe(4,bVe);function TVe(t){return t>.9?"Strong":t>.5?"Medium":"Weak"}function $Ve(t){if(t.length<8)return 0;let e=0;return _Ve.test(t)&&(e+=1),xVe.test(t)&&(e+=1),EVe.test(t)&&(e+=1),CVe.test(t)&&(e+=1),Math.max(0,Math.min(1,e/3))}function kVe(t=""){return(.3*$Ve(t)+fVe(t)/95)/2}function NVe(t=""){let e=kVe(t);return{value:e,label:TVe(e)}}function PVe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 RVe=T.forwardRef(PVe);function MVe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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"}),T.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const OVe=T.forwardRef(MVe);function jVe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 DVe=T.forwardRef(jVe);let LVe=es(["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 Ere=fe.span.withConfig({displayName:"StatusText",componentId:"sc-3f6866a9-0"})([""," transition:color 0.1s ease-in;color:",";text-transform:",";&[aria-hidden='true']{visibility:hidden;}"],LVe,({error:t})=>t?"var(--privy-color-error)":"var(--privy-color-foreground-3)",({error:t})=>t?"":"capitalize"),K_=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-3f6866a9-1"})(["display:flex;flex-direction:column;justify-content:center;flex-grow:1;"]),Y_=fe(Lt).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-3f6866a9-2"})(["",""],t=>t.hideAnimations&&es(["&&{transition:none;}"]));let Cre=es(["&&{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 qN=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;"],Cre),FVe=fe.div.withConfig({displayName:"PasswordDisplay",componentId:"sc-3f6866a9-4"})(["",""],Cre),Z_=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"),J_=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;}"]),VN=fe.div.withConfig({displayName:"Details",componentId:"sc-3f6866a9-7"})(["display:flex;flex-direction:column;gap:10px;padding-bottom:1rem;"]),HI=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;}"]),mW=fe(g_).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;}"]),GN=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;"]),UVe=fe(RVe).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);}"]),KN=fe(DVe).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);}"]),YN=fe(OVe).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);}"]),BVe=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)"),WVe=({buttonHideAnimations:t,buttonLoading:e,password:r,onSubmit:n,onBack:i})=>{let[s,o]=T.useState(!0),[a,l]=T.useState(!1),[c,u]=T.useState(""),f=r===c;return T.useEffect(()=>{c&&!a&&l(!0)},[c]),d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:i}),d.jsx(Qr,{}),d.jsxs(K_,{children:[d.jsxs(J_,{children:[d.jsx(Nd,{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(Z_,{children:[d.jsx(qN,{value:c,onChange:h=>u(h.target.value),onKeyUp:h=>{h.key==="Enter"&&n()},onBlur:()=>l(!0),placeholder:"confirm your password",type:s?"password":"text",style:{paddingRight:"2.3rem"}}),d.jsx(GN,{style:{right:"0.75rem"},children:s?d.jsx(KN,{onClick:()=>o(!1)}):d.jsx(YN,{onClick:()=>o(!0)})})]}),d.jsx(Ere,{"aria-hidden":!a||f,error:!0,children:"Passwords do not match"})]}),d.jsx(Y_,{onClick:n,loading:e,disabled:!f,hideAnimations:t,children:"Continue"}),d.jsx(tn,{}),d.jsx(Jt,{})]})},zVe=({className:t,checked:e,color:r="var(--privy-color-accent)",...n})=>d.jsx("label",{children:d.jsxs(HVe,{className:t,children:[d.jsx(Sre,{checked:e,...n}),d.jsx(qVe,{color:r,checked:e,children:d.jsx(Are,{viewBox:"0 0 24 24",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})})})]})});let HVe=fe.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-db51b935-1"})(["display:inline-block;vertical-align:middle;"]),Are=fe.svg.withConfig({displayName:"Icon",componentId:"sc-db51b935-2"})(["fill:none;stroke:white;stroke-width:3px;"]),Sre=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;"]),qVe=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)",Sre,t=>t.color,Are,t=>t.checked?"visible":"hidden");const VVe=({buttonHideAnimations:t,buttonLoading:e,onSubmit:r,onBack:n,config:i})=>{let[s,o]=T.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:n}),d.jsx(Qr,{}),d.jsxs(K_,{children:[d.jsxs(J_,{children:[d.jsx(Nd,{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(VN,{children:d.jsxs(HI,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:a=>{a.preventDefault(),o(l=>!l)},children:[d.jsx(zVe,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),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(GVe,{children:[i.initiatedBy==="user"&&d.jsx(Ed,{onClick:i.onCancel,disabled:e,children:"Cancel"}),d.jsx(Y_,{onClick:r,loading:e,hideAnimations:t,disabled:!s,children:"Set Password"})]}),d.jsx(tn,{}),d.jsx(Jt,{})]})};let GVe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-eb601350-0"})(["display:flex;gap:10px;"]);function KVe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 YVe=T.forwardRef(KVe),ZVe=({buttonHideAnimations:t,buttonLoading:e,password:r="",config:n,isResettingPassword:i,onSubmit:s,onClose:o,onBack:a,onPasswordChange:l,onPasswordGenerate:c})=>{let[u,f]=T.useState(!1),[h,g]=T.useState(!1);T.useEffect(()=>{r&&!h&&g(!0)},[r]);let m=T.useMemo(()=>h?6>((r==null?void 0:r.length)||0)?"Password must be at least 6 characters":SVe.test(r||"")?null:`Invalid characters used ( ${IVe(r).join(" ")} )`:null,[r,h]),w=T.useMemo(()=>m?{value:0,label:"Weak"}:NVe(r),[r,m]),E=T.useMemo(()=>!(r!=null&&r.length)||!!m,[m,r]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:o,closeable:n.initiatedBy==="user",backFn:a}),d.jsx(Qr,{}),d.jsxs(K_,{children:[d.jsxs(J_,{children:[d.jsx(YVe,{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(Z_,{children:[d.jsx(qN,{value:r,onChange:v=>l(v.target.value),onKeyUp:v=>{v.key==="Enter"&&s()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),d.jsxs(GN,{style:{width:"3.5rem"},children:[u?d.jsx(KN,{onClick:()=>f(!1)}):d.jsx(YN,{onClick:()=>f(!0)}),d.jsx(UVe,{onClick:c})]})]}),d.jsx(BVe,{value:w.value===0?.01:w.value,label:w.label}),d.jsx(Ere,{error:!!m,children:m||`Password Strength: ${h?w.label:"--"}`}),d.jsxs(QVe,{children:[d.jsx(JVe,{children:d.jsxs(VN,{children:[d.jsxs(HI,{children:[d.jsx($0,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),d.jsxs(HI,{children:[d.jsx($0,{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(Y_,{onClick:s,loading:e,disabled:E,hideAnimations:t,children:"Continue"})]})]}),d.jsx(tn,{}),d.jsx(Jt,{})]})};let JVe=fe(VN).withConfig({displayName:"DetailsContainer",componentId:"sc-7b3b7727-0"})(["flex:1;padding-top:1rem;"]),QVe=fe.div.withConfig({displayName:"LowerContainer",componentId:"sc-7b3b7727-1"})(["display:flex;flex-direction:column;height:100%;"]);function XVe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 eGe=T.forwardRef(XVe);function tGe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 Ire=T.forwardRef(tGe);function rGe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 nGe=T.forwardRef(rGe),iGe=({buttonHideAnimations:t,buttonLoading:e,appName:r,password:n,onSubmit:i,onBack:s})=>{let[o,a]=T.useState(!1),l=T.useCallback(()=>{a(!0),n&&navigator.clipboard.writeText(n)},[n]),c=T.useCallback(()=>{let u=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),h=new Blob([sGe(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:s,closeable:!1}),d.jsx(Qr,{}),d.jsxs(K_,{children:[d.jsxs(J_,{children:[d.jsx(Nd,{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(Z_,{centered:!0,children:d.jsx(FVe,{children:n})}),d.jsxs("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[d.jsx(mW,{onClick:l,children:d.jsxs(d.Fragment,o?{children:[d.jsx(Ire,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[d.jsx(nGe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),d.jsxs(mW,{onClick:c,children:[d.jsx(eGe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),d.jsx(Y_,{onClick:i,loading:e,hideAnimations:t,children:"Continue"}),d.jsx(tn,{}),d.jsx(Jt,{})]})};let sGe=(t,e)=>`Your wallet recovery password for ${t} is +}`;var _r=jM(function(){return Jr(ce,Ut+"return "+rt).apply(r,_e)});if(_r.source=rt,F7(_r))throw _r;return _r}function Nfe(p){return Xr(p).toLowerCase()}function Pfe(p){return Xr(p).toUpperCase()}function Rfe(p,y,$){if(p=Xr(p),p&&($||y===r))return qP(p);if(!p||!(y=Va(y)))return p;var V=gl(p),ne=gl(y),ce=VP(V,ne),_e=GP(V,ne)+1;return Hd(V,ce,_e).join("")}function Mfe(p,y,$){if(p=Xr(p),p&&($||y===r))return p.slice(0,YP(p)+1);if(!p||!(y=Va(y)))return p;var V=gl(p),ne=GP(V,gl(y))+1;return Hd(V,0,ne).join("")}function Ofe(p,y,$){if(p=Xr(p),p&&($||y===r))return p.replace(Ft,"");if(!p||!(y=Va(y)))return p;var V=gl(p),ne=VP(V,gl(y));return Hd(V,ne).join("")}function jfe(p,y){var $=ae,V=K;if(Un(y)){var ne="separator"in y?y.separator:ne;$="length"in y?wr(y.length):$,V="omission"in y?Va(y.omission):V}p=Xr(p);var ce=p.length;if(_p(p)){var _e=gl(p);ce=_e.length}if($>=ce)return p;var Ae=$-xp(V);if(Ae<1)return V;var ke=_e?Hd(_e,0,Ae).join(""):p.slice(0,Ae);if(ne===r)return ke+V;if(_e&&(Ae+=ke.length-Ae),U7(ne)){if(p.slice(Ae).search(ne)){var Ge,Ke=ke;for(ne.global||(ne=r7(ne.source,Xr(cr.exec(ne))+"g")),ne.lastIndex=0;Ge=ne.exec(Ke);)var rt=Ge.index;ke=ke.slice(0,rt===r?Ae:rt)}}else if(p.indexOf(Va(ne),Ae)!=Ae){var bt=ke.lastIndexOf(ne);bt>-1&&(ke=ke.slice(0,bt))}return ke+V}function Lfe(p){return p=Xr(p),p&&mt.test(p)?p.replace(Wt,foe):p}var Dfe=$p(function(p,y,$){return p+($?" ":"")+y.toUpperCase()}),z7=LR("toUpperCase");function OM(p,y,$){return p=Xr(p),y=$?r:y,y===r?ooe(p)?goe(p):Qae(p):p.match(y)||[]}var jM=Sr(function(p,y){try{return $i(p,r,y)}catch($){return F7($)?$:new fr($)}}),Ffe=Au(function(p,y){return $o(y,function($){$=gc($),Eu(p,$,L7(p[$],p))}),p});function Ufe(p){var y=p==null?0:p.length,$=rr();return p=y?On(p,function(V){if(typeof V[1]!="function")throw new ko(a);return[$(V[0]),V[1]]}):[],Sr(function(V){for(var ne=-1;++neO)return[];var $=L,V=ms(p,L);y=rr(y),p-=L;for(var ne=Xx(V,y);++$0||y<0)?new Or($):(p<0?$=$.takeRight(-p):p&&($=$.drop(p)),y!==r&&(y=wr(y),$=y<0?$.dropRight(-y):$.take(y-p)),$)},Or.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},Or.prototype.toArray=function(){return this.take(L)},hc(Or.prototype,function(p,y){var $=/^(?:filter|find|map|reject)|While$/.test(y),V=/^(?:head|last)$/.test(y),ne=oe[V?"take"+(y=="last"?"Right":""):y],ce=V||/^find/.test(y);ne&&(oe.prototype[y]=function(){var _e=this.__wrapped__,Ae=V?[1]:arguments,ke=_e instanceof Or,Ge=Ae[0],Ke=ke||mr(_e),rt=function(kr){var Fr=ne.apply(oe,Dd([kr],Ae));return V&&bt?Fr[0]:Fr};Ke&&$&&typeof Ge=="function"&&Ge.length!=1&&(ke=Ke=!1);var bt=this.__chain__,Ut=!!this.__actions__.length,sr=ce&&!bt,_r=ke&&!Ut;if(!ce&&Ke){_e=_r?_e:new Or(this);var ar=p.apply(_e,Ae);return ar.__actions__.push({func:R3,args:[rt],thisArg:r}),new No(ar,bt)}return sr&&_r?p.apply(this,Ae):(ar=this.thru(rt),sr?V?ar.value()[0]:ar.value():ar)})}),$o(["pop","push","shift","sort","splice","unshift"],function(p){var y=s3[p],$=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",V=/^(?:pop|shift)$/.test(p);oe.prototype[p]=function(){var ne=arguments;if(V&&!this.__chain__){var ce=this.value();return y.apply(mr(ce)?ce:[],ne)}return this[$](function(_e){return y.apply(mr(_e)?_e:[],ne)})}}),hc(Or.prototype,function(p,y){var $=oe[y];if($){var V=$.name+"";nn.call(Sp,V)||(Sp[V]=[]),Sp[V].push({name:y,func:$})}}),Sp[S3(r,v).name]=[{name:"wrapper",func:r}],Or.prototype.clone=Loe,Or.prototype.reverse=Doe,Or.prototype.value=Foe,oe.prototype.at=pue,oe.prototype.chain=gue,oe.prototype.commit=mue,oe.prototype.next=yue,oe.prototype.plant=wue,oe.prototype.reverse=bue,oe.prototype.toJSON=oe.prototype.valueOf=oe.prototype.value=_ue,oe.prototype.first=oe.prototype.head,xm&&(oe.prototype[xm]=vue),oe},Ep=moe();ni?((ni.exports=Ep)._=Ep,gn._=Ep):Dr._=Ep}).call(Xt)})(p6,p6.exports);var gqe=p6.exports,KI={exports:{}};(function(t,e){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Xt<"u"&&Xt,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(a){var o=typeof s<"u"&&s||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(x){return x&&DataView.prototype.isPrototypeOf(x)}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(x){return x&&u.indexOf(Object.prototype.toString.call(x))>-1};function h(x){if(typeof x!="string"&&(x=String(x)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(x)||x==="")throw new TypeError('Invalid character in header field name: "'+x+'"');return x.toLowerCase()}function g(x){return typeof x!="string"&&(x=String(x)),x}function m(x){var P={next:function(){var D=x.shift();return{done:D===void 0,value:D}}};return l.iterable&&(P[Symbol.iterator]=function(){return P}),P}function w(x){this.map={},x instanceof w?x.forEach(function(P,D){this.append(D,P)},this):Array.isArray(x)?x.forEach(function(P){if(P.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+P.length);this.append(P[0],P[1])},this):x&&Object.getOwnPropertyNames(x).forEach(function(P){this.append(P,x[P])},this)}w.prototype.append=function(x,P){x=h(x),P=g(P);var D=this.map[x];this.map[x]=D?D+", "+P:P},w.prototype.delete=function(x){delete this.map[h(x)]},w.prototype.get=function(x){return x=h(x),this.has(x)?this.map[x]:null},w.prototype.has=function(x){return this.map.hasOwnProperty(h(x))},w.prototype.set=function(x,P){this.map[h(x)]=g(P)},w.prototype.forEach=function(x,P){for(var D in this.map)this.map.hasOwnProperty(D)&&x.call(P,this.map[D],D,this)},w.prototype.keys=function(){var x=[];return this.forEach(function(P,D){x.push(D)}),m(x)},w.prototype.values=function(){var x=[];return this.forEach(function(P){x.push(P)}),m(x)},w.prototype.entries=function(){var x=[];return this.forEach(function(P,D){x.push([D,P])}),m(x)},l.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function E(x){if(!x._noBody){if(x.bodyUsed)return Promise.reject(new TypeError("Already read"));x.bodyUsed=!0}}function v(x){return new Promise(function(P,D){x.onload=function(){P(x.result)},x.onerror=function(){D(x.error)}})}function _(x){var P=new FileReader,D=v(P);return P.readAsArrayBuffer(x),D}function A(x){var P=new FileReader,D=v(P),O=/charset=([A-Za-z0-9_-]+)/.exec(x.type),j=O?O[1]:"utf-8";return P.readAsText(x,j),D}function C(x){for(var P=new Uint8Array(x),D=new Array(P.length),O=0;O-1?P:x}function G(x,P){if(!(this instanceof G))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');P=P||{};var D=P.body;if(x instanceof G){if(x.bodyUsed)throw new TypeError("Already read");this.url=x.url,this.credentials=x.credentials,P.headers||(this.headers=new w(x.headers)),this.method=x.method,this.mode=x.mode,this.signal=x.signal,!D&&x._bodyInit!=null&&(D=x._bodyInit,x.bodyUsed=!0)}else this.url=String(x);if(this.credentials=P.credentials||this.credentials||"same-origin",(P.headers||!this.headers)&&(this.headers=new w(P.headers)),this.method=U(P.method||this.method||"GET"),this.mode=P.mode||this.mode||null,this.signal=P.signal||this.signal||function(){if("AbortController"in o){var T=new AbortController;return T.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(D),(this.method==="GET"||this.method==="HEAD")&&(P.cache==="no-store"||P.cache==="no-cache")){var O=/([?&])_=[^&]*/;if(O.test(this.url))this.url=this.url.replace(O,"$1_="+new Date().getTime());else{var j=/\?/;this.url+=(j.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}G.prototype.clone=function(){return new G(this,{body:this._bodyInit})};function ae(x){var P=new FormData;return x.trim().split("&").forEach(function(D){if(D){var O=D.split("="),j=O.shift().replace(/\+/g," "),T=O.join("=").replace(/\+/g," ");P.append(decodeURIComponent(j),decodeURIComponent(T))}}),P}function K(x){var P=new w,D=x.replace(/\r?\n[\t ]+/g," ");return D.split("\r").map(function(O){return O.indexOf(` +`)===0?O.substr(1,O.length):O}).forEach(function(O){var j=O.split(":"),T=j.shift().trim();if(T){var L=j.join(":").trim();try{P.append(T,L)}catch(M){console.warn("Response "+M.message)}}}),P}B.call(G.prototype);function N(x,P){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(P||(P={}),this.type="default",this.status=P.status===void 0?200:P.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=P.statusText===void 0?"":""+P.statusText,this.headers=new w(P.headers),this.url=P.url||"",this._initBody(x)}B.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 x=new N(null,{status:200,statusText:""});return x.ok=!1,x.status=0,x.type="error",x};var k=[301,302,303,307,308];N.redirect=function(x,P){if(k.indexOf(P)===-1)throw new RangeError("Invalid status code");return new N(null,{status:P,headers:{location:x}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(P,D){this.message=P,this.name=D;var O=Error(P);this.stack=O.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function b(x,P){return new Promise(function(D,O){var j=new G(x,P);if(j.signal&&j.signal.aborted)return O(new a.DOMException("Aborted","AbortError"));var T=new XMLHttpRequest;function L(){T.abort()}T.onload=function(){var le={statusText:T.statusText,headers:K(T.getAllResponseHeaders()||"")};j.url.indexOf("file://")===0&&(T.status<200||T.status>599)?le.status=200:le.status=T.status,le.url="responseURL"in T?T.responseURL:le.headers.get("X-Request-URL");var H="response"in T?T.response:T.responseText;setTimeout(function(){D(new N(H,le))},0)},T.onerror=function(){setTimeout(function(){O(new TypeError("Network request failed"))},0)},T.ontimeout=function(){setTimeout(function(){O(new TypeError("Network request timed out"))},0)},T.onabort=function(){setTimeout(function(){O(new a.DOMException("Aborted","AbortError"))},0)};function M(le){try{return le===""&&o.location.href?o.location.href:le}catch{return le}}if(T.open(j.method,M(j.url),!0),j.credentials==="include"?T.withCredentials=!0:j.credentials==="omit"&&(T.withCredentials=!1),"responseType"in T&&(l.blob?T.responseType="blob":l.arrayBuffer&&(T.responseType="arraybuffer")),P&&typeof P.headers=="object"&&!(P.headers instanceof w||o.Headers&&P.headers instanceof o.Headers)){var X=[];Object.getOwnPropertyNames(P.headers).forEach(function(le){X.push(h(le)),T.setRequestHeader(le,g(P.headers[le]))}),j.headers.forEach(function(le,H){X.indexOf(H)===-1&&T.setRequestHeader(H,le)})}else j.headers.forEach(function(le,H){T.setRequestHeader(H,le)});j.signal&&(j.signal.addEventListener("abort",L),T.onreadystatechange=function(){T.readyState===4&&j.signal.removeEventListener("abort",L)}),T.send(typeof j._bodyInit>"u"?null:j._bodyInit)})}return b.polyfill=!0,o.fetch||(o.fetch=b,o.Headers=w,o.Request=G,o.Response=N),a.Headers=w,a.Request=G,a.Response=N,a.fetch=b,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(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})(KI,KI.exports);var mqe=KI.exports;const fW=wo(mqe);var yqe=Object.defineProperty,vqe=Object.defineProperties,wqe=Object.getOwnPropertyDescriptors,hW=Object.getOwnPropertySymbols,bqe=Object.prototype.hasOwnProperty,_qe=Object.prototype.propertyIsEnumerable,pW=(t,e,r)=>e in t?yqe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gW=(t,e)=>{for(var r in e||(e={}))bqe.call(e,r)&&pW(t,r,e[r]);if(hW)for(var r of hW(e))_qe.call(e,r)&&pW(t,r,e[r]);return t},mW=(t,e)=>vqe(t,wqe(e));const xqe={Accept:"application/json","Content-Type":"application/json"},Eqe="POST",yW={headers:xqe,method:Eqe},vW=10;let oc=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new aa.EventEmitter,this.isAvailable=!1,this.registering=!1,!RB(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=Sd(e),n=await(await fW(this.url,mW(gW({},yW),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!RB(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",s=>{this.resetMaxListeners(),i(s)}),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=Sd({id:1,jsonrpc:"2.0",method:"test",params:[]});await fW(e,mW(gW({},yW),{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"?M0(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=K_(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return ere(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>vW&&this.events.setMaxListeners(vW)}};const wW="error",Cqe="wss://relay.walletconnect.org",Aqe="wc",Sqe="universal_provider",bW=`${Aqe}@2:${Sqe}:`,Sre="https://rpc.walletconnect.org/v1/",t1="generic",Iqe=`${Sre}bundler`,hl={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Tqe=Object.defineProperty,$qe=Object.defineProperties,kqe=Object.getOwnPropertyDescriptors,_W=Object.getOwnPropertySymbols,Nqe=Object.prototype.hasOwnProperty,Pqe=Object.prototype.propertyIsEnumerable,xW=(t,e,r)=>e in t?Tqe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Db=(t,e)=>{for(var r in e||(e={}))Nqe.call(e,r)&&xW(t,r,e[r]);if(_W)for(var r of _W(e))Pqe.call(e,r)&&xW(t,r,e[r]);return t},Rqe=(t,e)=>$qe(t,kqe(e));function vo(t,e,r){var n;const i=U1(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${Sre}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function cp(t){return t.includes(":")?t.split(":")[1]:t}function Ire(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function Mqe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function cC(t={},e={}){const r=EW(t),n=EW(e);return gqe.merge(r,n)}function EW(t){var e,r,n,i;const s={};if(!dv(t))return s;for(const[a,o]of Object.entries(t)){const l=qN(a)?[a]:o.chains,c=o.methods||[],u=o.events||[],f=o.rpcMap||{},h=Ty(a);s[h]=Rqe(Db(Db({},s[h]),o),{chains:O5(l,(e=s[h])==null?void 0:e.chains),methods:O5(c,(r=s[h])==null?void 0:r.methods),events:O5(u,(n=s[h])==null?void 0:n.events),rpcMap:Db(Db({},f),(i=s[h])==null?void 0:i.rpcMap)})}return s}function Oqe(t){return t.includes(":")?t.split(":")[2]:t}function CW(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],a=n.accounts||[],o=qN(r)?[r]:n.chains?n.chains:Ire(n.accounts);e[r]={chains:o,methods:i,events:s,accounts:a}}return e}function uC(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 Tre={},Zr=t=>Tre[t],dC=(t,e)=>{Tre[t]=e};let jqe=class{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=cp(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||vo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new oc(n,Zr("disableProviderPing")))}};var Lqe=Object.defineProperty,Dqe=Object.defineProperties,Fqe=Object.getOwnPropertyDescriptors,AW=Object.getOwnPropertySymbols,Uqe=Object.prototype.hasOwnProperty,Bqe=Object.prototype.propertyIsEnumerable,SW=(t,e,r)=>e in t?Lqe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,IW=(t,e)=>{for(var r in e||(e={}))Uqe.call(e,r)&&SW(t,r,e[r]);if(AW)for(var r of AW(e))Bqe.call(e,r)&&SW(t,r,e[r]);return t},TW=(t,e)=>Dqe(t,Fqe(e));class Wqe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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||vo(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new oc(n,Zr("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(cp(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 s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);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(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. 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 s=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const a=this.client.session.get(e.topic),o=((i=a==null?void 0:a.sessionProperties)==null?void 0:i.capabilities)||{};if(o!=null&&o[s])return o==null?void 0:o[s];const l=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:TW(IW({},a.sessionProperties||{}),{capabilities:TW(IW({},o||{}),{[s]: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),s=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(s){const o=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(o,e)}catch(l){console.warn("Failed to fetch call status from bundler",l,o)}}const a=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(a)try{return await this.getUserOperationReceipt(a,e)}catch(o){console.warn("Failed to fetch call status from custom bundler",o,a)}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),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(bf("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${Iqe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class zqe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=cp(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||vo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new oc(n,Zr("disableProviderPing")))}}let Hqe=class{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=cp(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||vo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new oc(n,Zr("disableProviderPing")))}};class qqe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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||vo(`${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(hl.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||vo(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new fl(new oc(n,Zr("disableProviderPing")))}}let Vqe=class{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=cp(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 fl(new oc(n,Zr("disableProviderPing")))}};class Gqe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=cp(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||vo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new oc(n,Zr("disableProviderPing")))}}let Kqe=class{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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=cp(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||vo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new oc(n,Zr("disableProviderPing")))}};class Yqe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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||vo(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(hl.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||vo(e,this.namespace);return typeof n>"u"?void 0:new fl(new oc(n,Zr("disableProviderPing")))}}class Zqe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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||vo(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(hl.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||vo(e,this.namespace);return typeof n>"u"?void 0:new fl(new oc(n))}}class Jqe{constructor(e){this.name=t1,this.namespace=e.namespace,this.events=Zr("events"),this.client=Zr("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(hl.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 s=U1(i);n[`${s.namespace}:${s.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||vo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new fl(new oc(n,Zr("disableProviderPing")))}}var Qqe=Object.defineProperty,Xqe=Object.defineProperties,eVe=Object.getOwnPropertyDescriptors,$W=Object.getOwnPropertySymbols,tVe=Object.prototype.hasOwnProperty,rVe=Object.prototype.propertyIsEnumerable,kW=(t,e,r)=>e in t?Qqe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Fb=(t,e)=>{for(var r in e||(e={}))tVe.call(e,r)&&kW(t,r,e[r]);if($W)for(var r of $W(e))rVe.call(e,r)&&kW(t,r,e[r]);return t},fC=(t,e)=>Xqe(t,eVe(e));let nVe=class $re{constructor(e){this.events=new Hk,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:xw(V_({level:(e==null?void 0:e.logger)||wW})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new $re(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:Fb({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(a=>r(null,G_(s,a))).catch(a=>r(a,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:sn("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 s=await i();if(this.session=s.session,this.session){const a=CW(this.session.namespaces);this.namespaces=cC(this.namespaces,a),this.persist("namespaces",this.namespaces),this.onConnect()}return s}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(s=>{this.session=s;const a=CW(s.namespaces);this.namespaces=cC(this.namespaces,a),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==Cre)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s.name===t1?s.setDefaultChain(`${n}:${i}`,r):s.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(Id(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 pqe.init({core:this.providerOpts.core,logger:this.providerOpts.logger||wW,relayUrl:this.providerOpts.relayUrl||Cqe,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=>Ty(r)))];dC("client",this.client),dC("events",this.events),dC("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=Mqe(r,this.session),i=Ire(n),s=cC(this.namespaces,this.optionalNamespaces),a=fC(Fb({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new Wqe({namespace:a});break;case"algorand":this.rpcProviders[r]=new qqe({namespace:a});break;case"solana":this.rpcProviders[r]=new zqe({namespace:a});break;case"cosmos":this.rpcProviders[r]=new Hqe({namespace:a});break;case"polkadot":this.rpcProviders[r]=new jqe({namespace:a});break;case"cip34":this.rpcProviders[r]=new Vqe({namespace:a});break;case"elrond":this.rpcProviders[r]=new Gqe({namespace:a});break;case"multiversx":this.rpcProviders[r]=new Kqe({namespace:a});break;case"near":this.rpcProviders[r]=new Yqe({namespace:a});break;case"tezos":this.rpcProviders[r]=new Zqe({namespace:a});break;default:this.rpcProviders[t1]?this.rpcProviders[t1].updateNamespace(a):this.rpcProviders[t1]=new Jqe({namespace:a})}})}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&&Id(i)&&this.events.emit("accountsChanged",i.map(Oqe))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,a=Ty(i),o=uC(i)!==uC(s)?`${a}:${uC(s)}`: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,s=(n=this.client)==null?void 0:n.session.get(e);this.session=fC(Fb({},s),{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",fC(Fb({},sn("USER_DISCONNECTED")),{data:e.topic}))}),this.on(hl.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[t1]}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(a=>Ty(a)).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=Ty(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}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(`${bW}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${bW}/${e}`)}};const iVe=nVe,sVe="wc",aVe="ethereum_provider",oVe=`${sVe}@2:${aVe}:`,lVe="https://rpc.walletconnect.org/v1/",YI=["eth_sendTransaction","personal_sign"],kre=["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"],ZI=["chainChanged","accountsChanged"],Nre=["chainChanged","accountsChanged","message","disconnect","connect"];var cVe=Object.defineProperty,uVe=Object.defineProperties,dVe=Object.getOwnPropertyDescriptors,NW=Object.getOwnPropertySymbols,fVe=Object.prototype.hasOwnProperty,hVe=Object.prototype.propertyIsEnumerable,PW=(t,e,r)=>e in t?cVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,r1=(t,e)=>{for(var r in e||(e={}))fVe.call(e,r)&&PW(t,r,e[r]);if(NW)for(var r of NW(e))hVe.call(e,r)&&PW(t,r,e[r]);return t},hC=(t,e)=>uVe(t,dVe(e));function g6(t){return Number(t[0].split(":")[1])}function Ub(t){return`0x${t.toString(16)}`}function pVe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:a,rpcMap:o}=t;if(!Id(e))throw new Error("Invalid chains");const l={chains:e,methods:n||YI,events:s||ZI,rpcMap:r1({},e.length?{[g6(e)]:o[g6(e)]}:{})},c=s==null?void 0:s.filter(g=>!ZI.includes(g)),u=n==null?void 0:n.filter(g=>!YI.includes(g));if(!r&&!a&&!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:kre))],events:[...new Set(l.events.concat(a!=null&&a.length?a:Nre))],rpcMap:o};return{required:e.length?l:void 0,optional:r.length?h:void 0}}let gVe=class Pre{constructor(){this.events=new aa.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=oVe,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 Pre;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}=pVe(this.rpc);try{const i=await new Promise(async(a,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(hC(r1({namespaces:r1({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(c=>{a(c)}).catch(c=>{o(new Error(c.message))})});if(!i)return;const s=YU(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Ub(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(s,a)=>{var o;this.rpc.showQrModal&&((o=this.modal)==null||o.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(hC(r1({},e),{chains:this.rpc.chains}),r).then(l=>{s(l)}).catch(l=>{a(new Error(l.message))})}),i=n.session;if(i){const s=YU(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Ub(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",Ub(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",hC(r1({},sn("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",Ub(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:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],a=i.concat(s);if(!a.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const o=i.length?(e==null?void 0:e.methods)||YI:[],l=i.length?(e==null?void 0:e.events)||ZI:[],c=(e==null?void 0:e.optionalMethods)||[],u=(e==null?void 0:e.optionalEvents)||[],f=(e==null?void 0:e.rpcMap)||this.buildRpcMap(a,e.projectId),h=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:s.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?g6(this.rpc.chains):g6(this.rpc.optionalChains),this.signer=await iVe.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 Ma(()=>import("./index-BVxaHy8U.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(r1({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&&Id(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&Id(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${lVe}?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 mVe=gVe;let B1=class extends Jg{async initialize(){var n,i,s,a;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=dE((a=(s=this.walletProvider)==null?void 0:s.session)==null?void 0:a.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 Ma(()=>import("./index-BVxaHy8U.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,s,a,o,l;if(this.walletClientType==="metamask")return{name:"MetaMask",icon:KRe,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:WCe(((a=(s=this.walletProvider)==null?void 0:s.session)==null?void 0:a.peer.metadata.name)||"")||"WalletConnect",icon:typeof e=="string"?e:eMe,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=GS[e]),this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,YCe(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((e,r)=>{this.onQrModalClosed=()=>{r(new BX)},(async()=>{var s,a,o,l,c;let n="",i=await Promise.race([(s=this.walletProvider)==null?void 0:s.enable(),this.proxyProvider.walletTimeout()]);if(i!=null&&i.length&&(n=i[0]),!n||n==="")throw new Pn("Unable to retrieve address");if((o=(a=this.walletProvider)==null?void 0:a.session)!=null&&o.peer.metadata.url){let u=dE((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=aN(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(i),e()})().catch(n=>{r(n?tp(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 s of this.chains){let a=HCe(s.id,this.chains,this.rpcConfig,this.privyAppId);a&&(e[s.id]=a)}let r=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(s=>s.id),i=await mVe.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:Nre,optionalMethods:kre,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",s=>{var a,o;if(i.signer.abortPairingAttempt(),this.walletEntry){let{redirect:l,href:c}=GCe(s,this.walletEntry);ZCe({href:c,name:this.walletEntry.displayName}),this.redirectUri=l;let u=KCe(s,this.walletEntry);u!=null&&u.redirect&&(this.fallbackUniversalRedirectUri=u.redirect),cs&&GJ(l,"_self"),(a=this.showPrivyQrModal)==null||a.call(this,{native:l,universal:this.fallbackUniversalRedirectUri})}else(o=this.modal)==null||o.openModal({uri:s,chains:[this.defaultChain.id]})}),i.on("connect",()=>{var s,a,o;if((s=this.modal)==null||s.closeModal(),(a=i.session)==null?void 0:a.peer.metadata.url){let l=dE((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,s,a,o,l){super(l||"unknown",n,i,r),this.connectorType="wallet_connect_v2",this.privyAppId=a,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=r,this.shouldEnforceDefaultChainOnConnect=s,this.proxyProvider=new Vs(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=GS[l],this.walletClientType=l)}};var yVe=(t,e)=>{let r=I.useRef(()=>{});I.useEffect(()=>{r.current=t}),I.useEffect(()=>{if(e!==null){let n=setInterval(()=>r.current(),e||0);return()=>clearInterval(n)}},[e])};function vVe(){let[t,e]=I.useState(!1),r=I.useCallback(()=>{document.hidden&&e(!0)},[]);return I.useEffect(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:t,reset:()=>e(!1)}}const Rre=t=>(t==null?void 0:t.privyErrorCode)===Se.LINKED_TO_ANOTHER_USER?ff.ERROR_USER_EXISTS:t instanceof Vl&&!t.details.default?t.details:t instanceof UX?ff.ERROR_TIMED_OUT:t instanceof BX?ff.ERROR_USER_REJECTED_CONNECTION:(t==null?void 0:t.privyErrorCode)===Se.CANNOT_LINK_MORE_OF_TYPE?ff.ERROR_USER_LIMIT_REACHED:ff.ERROR_WALLET_CONNECTION,wVe=()=>{var be,Ce,Fe,Ue,Ye,lt,xe,He,Ve,Ie,Ne;let t,[e,r]=I.useState(!1),[n,i]=I.useState(!1),[s,a]=I.useState(void 0),{authenticated:o,logout:l}=Pr(),{app:c,navigate:u,navigateBack:f,lastScreen:h,currentScreen:g,setModalData:m,data:w}=vt(),{getAuthFlow:E,walletConnectionStatus:v,closePrivyModal:_,initLoginWithWallet:A,loginWithWallet:C,updateWallets:R,createAnalyticsEvent:B}=xt(),{walletConnectors:S}=Pr(),[U,G]=I.useState(0),{user:ae}=Pr(),[K]=I.useState((ae==null?void 0:ae.linkedAccounts.length)||0),[N,k]=I.useState(""),[b,x]=I.useState(""),[P,D]=I.useState(!1),{hasTabbedAway:O}=vVe(),{enabled:j,token:T}=Co(),L=cs&&((be=v==null?void 0:v.connector)==null?void 0:be.connectorType)==="wallet_connect_v2"||cs&&((Ce=v==null?void 0:v.connector)==null?void 0:Ce.connectorType)==="coinbase_wallet"||cs&&((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",M=(v==null?void 0:v.status)==="connected",X=(v==null?void 0:v.status)==="switching_to_supported_chain";I.useEffect(()=>{var Y;let Oe=E(),Me=Oe instanceof L4||Oe instanceof XS?Oe:void 0;M&&!Me&&(!j||T||o?A(v.connectedWallet,T,(Y=w==null?void 0:w.login)==null?void 0:Y.disableSignup).then(()=>{D(!0)}):(m({captchaModalData:{callback:F=>{var z;return A(v.connectedWallet,F,(z=w==null?void 0:w.login)==null?void 0:z.disableSignup).then(()=>{D(!0)})},userIntentRequired:!1,onSuccessNavigateTo:ye.AWAITING_CONNECTION,onErrorNavigateTo:ye.ERROR_SCREEN}}),u(ye.CAPTCHA_SCREEN,!1))),Me&&L&&M&&!Me.preparedMessage?Me.buildMessage():Me&&!L&&M&&(n||(async()=>{var F,z;i(!0),a(void 0);try{((F=v==null?void 0:v.connector)==null?void 0:F.connectorType)==="wallet_connect_v2"&&((z=v==null?void 0:v.connector)==null?void 0:z.walletClientType)==="metamask"&&await BJ(2500),await H()}catch(ie){console.warn("Auto-prompted signature failed",ie)}finally{i(!1)}})())},[U,M,P]),I.useEffect(()=>{var Oe;if(ae&&e){let Me=Mn-500;if(c!=null&&c.legal.requireUsersAcceptTerms&&!ae.hasAcceptedTerms){let F=setTimeout(()=>{u(ye.AFFIRMATIVE_CONSENT_SCREEN)},Me);return()=>clearTimeout(F)}if(_d(ae,(Oe=c==null?void 0:c.embeddedWallets)==null?void 0:Oe.createOnLogin)){let F=setTimeout(()=>{m({createWallet:{onSuccess:()=>{},onFailure:z=>{console.error(z),B({eventName:"embedded_wallet_creation_failure_logout",payload:{error:z,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),u(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Me);return()=>clearTimeout(F)}R();let Y=setTimeout(()=>_({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Mn);return()=>clearTimeout(Y)}},[ae,e]);let le=Oe=>{var Me,Y,F,z,ie,pe,ve,he,Le,Ze,et,it,ut,pt;if((Oe==null?void 0:Oe.privyErrorCode)!==Se.ALLOWLIST_REJECTED){if((Oe==null?void 0:Oe.privyErrorCode)===Se.USER_LIMIT_REACHED)return console.error(new Yv(Oe).toString()),void u(ye.USER_LIMIT_REACHED_SCREEN);if((Oe==null?void 0:Oe.privyErrorCode)!==Se.USER_DOES_NOT_EXIST)return(Oe==null?void 0:Oe.privyErrorCode)===Se.ACCOUNT_TRANSFER_REQUIRED&&((Y=(Me=Oe.data)==null?void 0:Me.data)!=null&&Y.nonce)?(m({accountTransfer:{nonce:(z=(F=Oe.data)==null?void 0:F.data)==null?void 0:z.nonce,account:(ie=E())==null?void 0:ie.meta.address,displayName:(he=(ve=(pe=Oe.data)==null?void 0:pe.data)==null?void 0:ve.account)==null?void 0:he.displayName,externalWalletMetadata:{walletClientType:(Le=E())==null?void 0:Le.meta.walletClientType,chainId:(Ze=E())==null?void 0:Ze.meta.chainId,connectorType:(et=E())==null?void 0:et.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:(pt=(ut=(it=Oe.data)==null?void 0:it.data)==null?void 0:ut.otherUser)==null?void 0:pt.embeddedWalletAddress}}),void u(ye.LINK_CONFLICT_SCREEN)):void a(Rre(Oe));u(ye.ACCOUNT_NOT_FOUND_SCREEN)}else u(ye.ALLOWLIST_REJECTION_SCREEN)};async function H(){try{await C(),r(!0)}catch(Oe){le(Oe)}finally{i(!1)}}I.useEffect(()=>{v!=null&&v.connectError&&le(v==null?void 0:v.connectError)},[v]),yVe(()=>{let Oe=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof B1?v.connector.redirectUri:void 0;Oe&&k(Oe);let Me=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof B1?v.connector.fallbackUniversalRedirectUri:void 0;Me&&x(Me)},(v==null?void 0:v.connector)instanceof B1&&!N?500:null);let ee=((Ye=v==null?void 0:v.connector)==null?void 0:Ye.connectorType)||"injected",Z=((lt=v==null?void 0:v.connector)==null?void 0:lt.walletClientType)||"unknown",te=((xe=Jc[Z])==null?void 0:xe.displayName)||((He=v==null?void 0:v.connector)==null?void 0:He.walletBranding.name)||"Browser Extension",re=((Ve=Jc[Z])==null?void 0:Ve.logo)||((Ie=v==null?void 0:v.connector)==null?void 0:Ie.walletBranding.icon)||(Oe=>d.jsx(TN,{...Oe})),W=te==="Browser Extension"?te.toLowerCase():te;t=e?`Successfully connected with ${W}`:s?s.message:X?"Switching networks":M?n&&L?"Signing":"Sign to verify":`Waiting for ${W}`;let q="Don’t see your wallet? Check your other browser windows.";e?q=K===((ae==null?void 0:ae.linkedAccounts.length)||0)?"Wallet was already linked.":"You’re good to go!":U>=2&&s?q="Unable to connect wallet":s?q=s.detail:X?q="Switch your wallet to the requested network.":M&&L?q="Sign the message in your wallet to verify it belongs to you.":Z==="metamask"&&cs?q="Click continue to open and connect MetaMask.":Z==="metamask"?q="For the best experience, connect only one wallet at a time.":ee==="wallet_connect"?q="Open your mobile wallet app to continue":ee!=="coinbase_wallet"||FJ()||(q=wU(ae)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let J=(Ne=S==null?void 0:S.walletConnectors)==null?void 0:Ne.find(Oe=>Oe.walletClientType==="coinbase_wallet"),me=Z==="coinbase_wallet"&&(wU(ae)||s===ff.ERROR_USER_EXISTS);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:h&&g!==h?f:void 0}),d.jsxs(bVe,{children:[d.jsx(Mre,{walletLogo:re,success:e,fail:!!s}),d.jsxs(yo,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:q}),M||!N||O?null:d.jsxs("p",{children:["Still here?"," ",d.jsx("a",{href:N,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),b&&d.jsxs(d.Fragment,{children:[" ","or"," ",d.jsx("a",{href:b,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),me?d.jsx(Dt,{onClick:()=>J&&(J==null?void 0:J.disconnect()),disabled:e,children:"Use a different wallet"}):s==ff.ERROR_USER_EXISTS&&g!==h?d.jsx(Dt,{onClick:f,children:"Use a different wallet"}):M&&!e&&L?d.jsx(Dt,{onClick:()=>{i(!0),H()},disabled:n,children:n?"Signing":"Sign with your wallet"}):!e&&(s!=null&&s.retryable)&&U<2?d.jsx(Dt,{onClick:()=>{G(U+1),a(void 0),M?(i(!0),H()):v==null||v.connectRetry()},disabled:!e&&(!(s!=null&&s.retryable)||U>=2),children:"Retry"}):e||s?null:d.jsx(Dt,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),d.jsx($r,{})]})};let bVe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-afad057-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),_Ve=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 Mre=t=>{let e=t.walletLogo;return d.jsx(d.Fragment,{children:d.jsx(_Ve,{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"}})]})})})},xVe=()=>{var R,B,S,U,G,ae;let t,{navigateBack:e,navigate:r,lastScreen:n,currentScreen:i,data:s,setModalData:a}=vt(),{walletConnectionStatus:o,closePrivyModal:l}=xt(),[c,u]=I.useState(void 0),[f,h]=I.useState(0),g=(o==null?void 0:o.status)==="connected",m=(o==null?void 0:o.status)==="switching_to_supported_chain";I.useEffect(()=>{var K,N;if(g){let k;if((K=s==null?void 0:s.externalConnectWallet)!=null&&K.onCompleteNavigateTo){let b=s.externalConnectWallet.onCompleteNavigateTo,x=(N=o.connectedWallet)==null?void 0:N.address;k=setTimeout(()=>{var P;s.funding&&a({...s,funding:{...s.funding,connectedWalletAddress:x}}),r(b({walletChainType:(P=o.connector)==null?void 0:P.chainType}))},Mn)}else k=setTimeout(l,Mn);return()=>clearTimeout(k)}},[g]),I.useEffect(()=>{var K;o!=null&&o.connectError&&(K=o==null?void 0:o.connectError,u(Rre(K)))},[o]);let w=((R=o==null?void 0:o.connector)==null?void 0:R.connectorType)||"injected",E=((B=o==null?void 0:o.connector)==null?void 0:B.walletClientType)||"unknown",v=((S=Jc[E])==null?void 0:S.displayName)||((U=o==null?void 0:o.connector)==null?void 0:U.walletBranding.name)||"Browser Extension",_=((G=Jc[E])==null?void 0:G.logo)||((ae=o==null?void 0:o.connector)==null?void 0:ae.walletBranding.icon)||(K=>d.jsx(TN,{...K})),A=v==="Browser Extension"?v.toLowerCase():v;t=g?`Successfully connected with ${A}`:c?c.message:m?"Switching networks":`Waiting for ${A}`;let C="Don’t see your wallet? Check your other browser windows.";return g?C="You’re good to go!":f>=2&&c?C="Unable to connect wallet":c?C=c.detail:m?C="Switch your wallet to the requested network.":E==="metamask"&&cs?C="Click to continue to open and connect MetaMask.":E==="metamask"?C="For the best experience, connect only one wallet at a time.":w==="wallet_connect_v2"?C="Open your mobile wallet app to continue":w==="coinbase_wallet"&&(C="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(EVe,{children:[d.jsx(Mre,{walletLogo:_,success:g,fail:!!c}),d.jsxs(yo,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:C})]}),c==ff.ERROR_USER_EXISTS?d.jsx(Dt,{onClick:e,children:"Use a different wallet"}):!g&&(c!=null&&c.retryable)&&f<2?d.jsx(Dt,{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(Dt,{onClick:e,children:"Use a different wallet"}):null]}),d.jsx($r,{})]})};let EVe=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 Ore=({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 CVe(t){let{logout:e}=I.useContext(Xg);return yN("logout",t),{logout:e}}const AVe=()=>{let t=wi(),{data:e,navigate:r,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=vt(),{crossAppAuthFlow:s,updateWallets:a,closePrivyModal:o,createAnalyticsEvent:l}=xt(),{logout:c}=CVe(),[u,f]=I.useState({}),h=e==null?void 0:e.crossAppAuth,g={id:h.appId,name:h.name,logoUrl:h.logoUrl},m=new Ee(`There was an issue connecting your ${g.name} account. Please try again.`),w=new Ks(async A=>{if(h.popup)try{let C=await s({appId:A,popup:h.popup,action:h.action});f({data:C})}catch(C){C instanceof Ee?f({error:C}):(C instanceof Ho&&h.popup&&h.popup.close(),f({error:m}))}else f({error:m})}),E=()=>{u.data&&(a(),h.onSuccess(u.data),o({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h.onError(u.error??new Ee("User canceled flow")),o({shouldCallAuthOnSuccess:!1,isSuccess:!1})};i.current=E,I.useEffect(()=>{g.id.length&&w.execute(g.id)},[g.id]),I.useEffect(()=>{var R;if(!u.data)return;let A=u.data;if(t.legal.requireUsersAcceptTerms&&!A.hasAcceptedTerms){let B=setTimeout(()=>{r(ye.AFFIRMATIVE_CONSENT_SCREEN)},Mn);return()=>clearTimeout(B)}if(_d(A,(R=t.embeddedWallets)==null?void 0:R.createOnLogin)){let B=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:S=>{console.error(S),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:S,provider:`privy:${g.id}`,screen:"CrossAppAuthScreen"}}),c()},callAuthOnSuccessOnClose:!0}}),r(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Mn);return()=>clearTimeout(B)}let C=setTimeout(E,Mn);return()=>clearTimeout(C)},[u.data]);let{title:v,subtitle:_}=I.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:E}),d.jsx(Qr,{}),d.jsxs(SVe,{children:[d.jsx(Da,{children:d.jsxs("div",{children:[d.jsx(ec,{success:!!u.data,fail:!!u.error}),d.jsx(Ore,{name:g.name,logoUrl:g.logoUrl})]})}),d.jsxs(yo,{children:[d.jsx("h3",{children:v}),d.jsx("p",{children:_})]})]}),d.jsx(tn,{}),d.jsx($r,{})]})};let SVe=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 IVe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 lc=I.forwardRef(IVe);function TVe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 $Ve=I.forwardRef(TVe),kVe=fe.div.withConfig({displayName:"Column",componentId:"sc-cfc52180-0"})(["display:flex;flex-direction:column;"]),L0=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);"]),NVe=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;"]),jre=es(["&&{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);":""),JN=fe.div.withConfig({displayName:"Box",componentId:"sc-1660059c-0"})(["",""],jre),Q_=({errMsg:t,balance:e,address:r,isLoading:n,className:i,title:s,isPulsing:a,showIcon:o,statusColor:l="green"})=>{let c;return c=l||(t?"red":"green"),d.jsxs(d.Fragment,{children:[d.jsxs(JN,{className:i,$state:t?"error":void 0,children:[d.jsxs(kVe,{children:[d.jsx(NVe,{children:s||"Pay with"}),d.jsx(lo,{address:r,showCopyIcon:o||!!t})]}),e!==void 0&&d.jsx(nc,{isLoading:n,isPulsing:a,color:c,children:e})]}),t&&d.jsx(L0,{style:{marginTop:"0.25rem"},children:t})]})},PVe=()=>{let{app:t,data:e}=vt(),{closePrivyModal:r}=xt(),[n,i]=I.useState(!1),[s,a]=I.useState(),{address:o,onDelegate:l,onSuccess:c,onError:u}=e.delegatedActions.consent,f=async()=>{n?c():u(s??new Ee("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return I.useEffect(()=>{if(!n&&!s)return;let h=setTimeout(f,Fk);return()=>clearTimeout(h)},[n,s]),d.jsxs(d.Fragment,n||s?{children:[d.jsx(ft,{onClose:f}),d.jsx(Qr,{}),d.jsxs(CN,{children:[s?d.jsx(E_,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(lc,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(SN,{height:20}),d.jsx(Fn,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":`You’ve successfully granted delegated action permissions to ${t.name}.`})]}),d.jsx(tn,{}),d.jsx(Jt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:f}),d.jsx($Ve,{width:56,height:56,style:{margin:"auto"}}),d.jsx(un,{style:{marginTop:24,color:"var(--privy-color-foreground)"},children:"Enable offline access"}),d.jsxs(dn,{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(MVe,{showIcon:!0,address:o,title:"Wallet",isLoading:!1}),d.jsxs(RVe,{style:{marginTop:24},children:[d.jsx(Ad,{onClick:f,children:"Not now"}),d.jsx(Dt,{onClick:async()=>{try{await l(),i(!0)}catch(h){a(h)}},children:"Accept"})]}),d.jsx(Jt,{})]})};let RVe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-b99bc0c0-0"})(["display:flex;gap:10px;"]),MVe=fe(Q_).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-b99bc0c0-1"})(["margin-top:1.5rem;"]);function OVe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 jVe=I.forwardRef(OVe),LVe=()=>{let{app:t,data:e}=vt(),{closePrivyModal:r}=xt(),[n,i]=I.useState(!1),[s,a]=I.useState(),{onRevoke:o,onSuccess:l,onError:c}=e.delegatedActions.revoke,u=async()=>{n?l():c(s??new Ee("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return I.useEffect(()=>{if(!n&&!s)return;let f=setTimeout(u,Fk);return()=>clearTimeout(f)},[n,s]),d.jsxs(d.Fragment,n||s?{children:[d.jsx(ft,{onClose:u}),d.jsx(Qr,{}),d.jsxs(CN,{children:[s?d.jsx(E_,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(lc,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(SN,{height:20}),d.jsx(Fn,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":"You've successfully revoked permissions."})]}),d.jsx(tn,{}),d.jsx(Jt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:u}),d.jsx(jVe,{width:56,height:56,style:{margin:"auto"}}),d.jsx(un,{style:{marginTop:24},children:"Revoke offline access to wallet"}),d.jsxs(dn,{children:["By confirming, ",t.name," will no longer be able to use this wallet on your behalf when you are not online."]}),d.jsxs(DVe,{style:{marginTop:24},children:[d.jsx(Ad,{onClick:u,children:"Deny"}),d.jsx(Dt,{onClick:async()=>{try{await o(),i(!0)}catch(f){a(f)}},children:"Confirm"})]}),d.jsx(Jt,{})]})};let DVe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-8ff214d7-0"})(["display:flex;gap:10px;"]);const Lre=()=>d.jsx(FVe,{children:d.jsxs(UVe,{children:[d.jsx(BVe,{}),d.jsx(WVe,{})]})});let FVe=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;}"]),UVe=fe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-85b54ede-1"})(["position:relative;height:140px;width:140px;opacity:1;animation:fadein 200ms ease;"]),BVe=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%;}"]),WVe=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 zVe=["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 Jn=class extends Error{constructor(e,r){super(r),this.type=e}};function om(t){let e=t.type;return typeof e=="string"&&zVe.includes(e)}function m6(t){return om(t)&&t.type==="wallet_not_on_device"}function HVe(t){return om(t)&&(t.type==="invalid_recovery_pin"||t.type==="invalid_request_arguments")}function QN(t){return!!om(t)&&t.type==="mfa_timeout"}function XN(t){return!!om(t)&&t.type==="missing_or_invalid_mfa"}function qVe(t){return!!om(t)&&t.type==="mfa_verification_max_attempts_reached"}function Dre(t){return!(!om(t)||!t.message.includes("code 429"))}function Fre(t){return!!function(e){let r=e.type;return typeof r=="string"&&r==="client_error"}(t)&&t.message==="MFA canceled"}function X_(){return T4(JS(36))}function eP(){return X_()}async function tP(t,e="S256"){if(e!="S256")return t;{let r=await aAe(t);return T4(r)}}function VVe(){let t=Lt.get(Cy);if(!t)throw new Ee("Authentication error.");return t}function Ure({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 Bre({walletAction:t,availableRecoveryMethods:e,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:i}){return i?ye.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:r||e.length===1?Ure({isCreatingWallet:t==="create",skipSplashScreen:n}):ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN}function Wre(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 RW({api:t,provider:e}){let r=X_(),n=eP(),i=await tP(r);try{return e==="icloud"?{url:(await t.post(mCe,{client_type:"web"})).url}:{url:(await t.post(gCe,{redirect_to:window.location.href,code_challenge:i,state_code:n})).url,codeVerifier:r,stateCode:n,provider:e}}catch(s){throw Hr(s)}}async function GVe({api:t,provider:e,stateCode:r,codeVerifier:n,authorizationCode:i}){if(!i||!r)throw new Ee("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(i==="undefined")throw new Ee("User denied confirmation during OAuth flow");try{return(await t.post(yCe,{authorization_code:i,state_code:r,code_verifier:n,provider:e})).access_token}catch(s){let a=Hr(s);throw a.privyErrorCode?new Ee(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new Ee("Invalid code during oauth flow.",void 0,Se.OAUTH_USER_DENIED):new Ee("Invalid code during OAuth flow.",void 0,Se.UNKNOWN_AUTH_ERROR)}}const KVe=()=>{let{authenticated:t,user:e,getAccessToken:r}=Pr(),{closePrivyModal:n,createAnalyticsEvent:i,walletProxy:s}=xt(),{navigate:a,data:o,setModalData:l,onUserCloseViaDialogOrKeybindRef:c}=vt(),u=I.useMemo(()=>Date.now(),[]),[f,h]=I.useState(!1),{onCompleteNavigateTo:g,onFailure:m,shouldForceMFA:w,entropyId:E,entropyIdVerifier:v}=o==null?void 0:o.connectWallet,_=C=>{f||(h(!0),m(typeof C=="string"?Error(C):C))};I.useEffect(()=>{let C,R=F4(e,E);return t&&R?s?((async()=>{let B=await r();if(!B)return _("User must be authenticated and have a Privy wallet before it can be connected");try{await s.connect({accessToken:B,entropyId:E,entropyIdVerifier:v}),w&&await s.verifyMfa({accessToken:B});let S=(Date.now()-u)/1e3;g===ye.EMBEDDED_WALLET_KEY_EXPORT_SCREEN&&S<1?C=setTimeout(()=>{a(g,!1)},1e3*(1-S)):a(g,!1)}catch(S){if(m6(S)&&R.recoveryMethod==="privy"){let U=await r();if(!U)return _("User must be authenticated and have a Privy wallet before it can be recovered");try{i({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:R.address}});let G=await(s==null?void 0:s.recover({accessToken:U,entropyId:E,entropyIdVerifier:v}));G!=null&&G.entropyId||_(Error("Unable to recover wallet")),g?a(g):n({shouldCallAuthOnSuccess:!1}),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:R.address}}),a(g)}catch{_("An error has occurred, please try again.")}}else m6(S)&&R.recoveryMethod!=="privy"?(l({...o,recoverWallet:{entropyId:E,entropyIdVerifier:v,onCompleteNavigateTo:g,onFailure:m},recoveryOAuthStatus:{provider:R.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),a(Wre(R.recoveryMethod))):_(S)}})(),()=>clearTimeout(C)):void 0:_("User must be authenticated and have a Privy wallet before it can be connected")},[t,e,s]);let A=()=>{_("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(Md,{children:[d.jsx(T_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(Fn,{title:"Something went wrong",description:"We’re on it. Please try again later."})]}),d.jsx(Dt,{onClick:()=>n({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):d.jsx(Lre,{}),d.jsx(YVe,{})]})};let YVe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-124dbb1c-0"})(["height:44px;"]);const ZVe=()=>{let{user:t}=Pr(),{closePrivyModal:e,isNewUserThisSession:r,updateWallets:n}=xt(),{app:i,data:s,onUserCloseViaDialogOrKeybindRef:a}=vt(),{onSuccess:o,onFailure:l,callAuthOnSuccessOnClose:c}=s.createWallet,u=()=>{let f=_a(t);f?(n(),o(f)):l(Error("Failed to create wallet")),e({shouldCallAuthOnSuccess:c})};return I.useEffect(()=>{let f=setTimeout(u,Fk);return()=>clearTimeout(f)},[]),a.current=u,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:u}),d.jsx(Qr,{}),d.jsxs(Md,{children:[d.jsx(P0,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(Fn,{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(tn,{}),d.jsx(Jt,{})]})},JVe=({children:t,theme:e})=>d.jsxs(QVe,{$theme:e,children:[d.jsx(Rd,{width:"1.25rem",color:e==="dark"?"#FDE68A":"var(--privy-color-warn)"}),t]});let QVe=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 up=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);}"]),qf=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;"]),XVe=()=>{let[t,e]=I.useState(null),{authenticated:r,user:n,getAccessToken:i}=Pr(),{closePrivyModal:s,createAnalyticsEvent:a,clientAnalyticsId:o}=xt(),l=wi(),{data:c,onUserCloseViaDialogOrKeybindRef:u}=vt(),{onFailure:f,onSuccess:h,origin:g,appId:m,appClientId:w,walletToExport:E,primaryWallet:v}=c.keyExport,_=C=>{s({shouldCallAuthOnSuccess:!1}),f(typeof C=="string"?Error(C):C)},A=()=>{s({shouldCallAuthOnSuccess:!1}),h(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:E.address}})};return I.useEffect(()=>{if(!r||!E)return _("User must be authenticated before exporting their wallet");i().then(e,_)},[r,n]),u.current=A,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:A}),d.jsxs(tGe,{children:[d.jsx(qf,{children:"Transfer wallet"}),d.jsxs(up,{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(JVe,{theme:l.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),d.jsx(Q_,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:E.address,showIcon:!0}),d.jsx("div",{style:{width:"100%"},children:t&&d.jsx(eGe,{origin:g,appId:m,appClientId:w,accessToken:t,clientAnalyticsId:o,walletToExport:E,primaryWallet:v,dimensions:{height:"44px"}})})]}),d.jsx(Jt,{})]})};function eGe(t){let[e,r]=I.useState(t.dimensions.width),[n,i]=I.useState(void 0),s=I.useRef(null);I.useEffect(()=>{if(s.current&&e===void 0){let{width:l}=s.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 a=t.walletToExport.chainType==="ethereum"&&!t.walletToExport.imported;return d.jsx("div",{ref:s,children:e&&d.jsxs(rGe,{children:[d.jsx("iframe",{style:{position:"absolute",zIndex:1},width:e,height:t.dimensions.height,allow:"clipboard-write self *",src:WJ(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:a,...n},{token:t.accessToken})}),d.jsx(MW,{children:"Loading..."}),a&&d.jsx(MW,{children:"Loading..."})]})})}let tGe=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-eaab13a9-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),rGe=fe.div.withConfig({displayName:"ButtonContainer",componentId:"sc-eaab13a9-1"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),MW=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 zre(){let{getAccessToken:t}=Pr(),{refreshUser:e,createAnalyticsEvent:r,initializeWalletProxy:n}=xt(),i=I.useRef(!1);return{createWallet:I.useCallback(async({user:s,recoveryPassword:a})=>{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(Uk);if(!l)throw Error("walletProxy does not exist.");let c=new Promise((g,m)=>{setTimeout(()=>{m(Error("walletProxy.create timed out."))},2e4)}),u=jc(s);if(!await Promise.race([l.create({accessToken:o,recoveryPassword:a,recoveryMethod:a?"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=_a(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 nGe=()=>{let{app:t,setModalData:e,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=vt(),[s,a]=I.useState(""),{embeddedWallets:o}=wi(),{authenticated:l,user:c}=Pr(),{closePrivyModal:u}=xt(),{onSuccess:f,onFailure:h,callAuthOnSuccessOnClose:g}=n.createWallet,m=(t==null?void 0:t.embeddedWallets.requireUserOwnedRecoveryOnCreate)===!0,{createWallet:w}=zre(),[E,v]=I.useState(null),_=new Ks(async()=>{try{let A=await w({user:c});if(!A)return;v(A),r(ye.EMBEDDED_WALLET_CREATED_SCREEN)}catch(A){a(A.message)}});return I.useEffect(()=>l&&c?m?(e({...n,recoverySelection:{...n==null?void 0:n.recoverySelection,isInAccountCreateFlow:!0}}),r(Bre({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:o.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void _.execute():(r(ye.LANDING),void h(Error("User must be authenticated before creating a Privy wallet"))),[m,l]),i.current=()=>null,s?d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsxs(Md,{children:[d.jsx(T_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(Fn,{title:"Something went wrong",description:s})]}),d.jsx(Dt,{onClick:()=>{E?(f(E),u({shouldCallAuthOnSuccess:g})):(h(new Pf("User wallet creation failed")),u({shouldCallAuthOnSuccess:!1}))},children:"Close"}),d.jsx(iGe,{})]}):d.jsx(Lre,{})};let iGe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-eabafbf4-0"})(["height:44px;"]);var sGe=function(e,r){return Math.round(r*Math.log(e)/Math.LN2)},aGe=[{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}],oGe=function(e){return function(r){return e.reduce(function(n,i){return n+(i.re.test(r)?i.length:0)},0)}},lGe=oGe(aGe),cGe=function(e){return e?sGe(lGe(e),e.length):0},uGe=cGe;const dGe=wo(uGe);function Hre(t){return crypto.getRandomValues(new Uint8Array(t))}const fGe=256,t2=65536;function hGe(){const[t]=Hre(1);return t}function pGe(){const[t,e]=Hre(2);return(t<<8)+e}function gGe(t){if(typeof t!="number"||t<2||t>t2)throw new Error(`Invalid number: number must be at least two and at most ${t2}`);const e=t>256,r=e?t2:fGe,n=e?pGe:hGe,i=t*Math.floor(r/t);for(;;){const s=n();if(st2)throw new Error(`Invalid argument: end must be a number less than or equal to ${t2}`);if(r-e<2)throw new Error("Invalid range: range must contain at least two values");const n=[];for(let i=0;i{const a=e[i];return n+(s===0?a:r+a)},"")}const vGe=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"]),wGe=Object.freeze(vGe.filter(t=>!t.includes("-")));let bGe=/[a-z]/,_Ge=/[A-Z]/,xGe=/[0-9]/,qre="!@#$%^&*()\\-_+.",Vre=`a-zA-Z0-9${qre}`,EGe=RegExp(`[${qre}]`),CGe=RegExp(`[${Vre}]`);const AGe=RegExp(`^[${Vre}]{6,}$`),SGe=(t="")=>[...new Set(t.split("").filter(e=>!CGe.test(e)).map(e=>e.replace(" ","SPACE")))],Gre=()=>yGe(4,wGe);function IGe(t){return t>.9?"Strong":t>.5?"Medium":"Weak"}function TGe(t){if(t.length<8)return 0;let e=0;return bGe.test(t)&&(e+=1),_Ge.test(t)&&(e+=1),xGe.test(t)&&(e+=1),EGe.test(t)&&(e+=1),Math.max(0,Math.min(1,e/3))}function $Ge(t=""){return(.3*TGe(t)+dGe(t)/95)/2}function kGe(t=""){let e=$Ge(t);return{value:e,label:IGe(e)}}function NGe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 PGe=I.forwardRef(NGe);function RGe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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"}),I.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const MGe=I.forwardRef(RGe);function OGe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 jGe=I.forwardRef(OGe);let LGe=es(["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 Kre=fe.span.withConfig({displayName:"StatusText",componentId:"sc-3f6866a9-0"})([""," transition:color 0.1s ease-in;color:",";text-transform:",";&[aria-hidden='true']{visibility:hidden;}"],LGe,({error:t})=>t?"var(--privy-color-error)":"var(--privy-color-foreground-3)",({error:t})=>t?"":"capitalize"),ex=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-3f6866a9-1"})(["display:flex;flex-direction:column;justify-content:center;flex-grow:1;"]),tx=fe(Dt).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-3f6866a9-2"})(["",""],t=>t.hideAnimations&&es(["&&{transition:none;}"]));let Yre=es(["&&{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 rP=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;"],Yre),DGe=fe.div.withConfig({displayName:"PasswordDisplay",componentId:"sc-3f6866a9-4"})(["",""],Yre),rx=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"),nx=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;}"]),nP=fe.div.withConfig({displayName:"Details",componentId:"sc-3f6866a9-7"})(["display:flex;flex-direction:column;gap:10px;padding-bottom:1rem;"]),JI=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;}"]),OW=fe(__).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;}"]),iP=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;"]),FGe=fe(PGe).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);}"]),sP=fe(jGe).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);}"]),aP=fe(MGe).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);}"]),UGe=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)"),BGe=({buttonHideAnimations:t,buttonLoading:e,password:r,onSubmit:n,onBack:i})=>{let[s,a]=I.useState(!0),[o,l]=I.useState(!1),[c,u]=I.useState(""),f=r===c;return I.useEffect(()=>{c&&!o&&l(!0)},[c]),d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:i}),d.jsx(Qr,{}),d.jsxs(ex,{children:[d.jsxs(nx,{children:[d.jsx(Rd,{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(rx,{children:[d.jsx(rP,{value:c,onChange:h=>u(h.target.value),onKeyUp:h=>{h.key==="Enter"&&n()},onBlur:()=>l(!0),placeholder:"confirm your password",type:s?"password":"text",style:{paddingRight:"2.3rem"}}),d.jsx(iP,{style:{right:"0.75rem"},children:s?d.jsx(sP,{onClick:()=>a(!1)}):d.jsx(aP,{onClick:()=>a(!0)})})]}),d.jsx(Kre,{"aria-hidden":!o||f,error:!0,children:"Passwords do not match"})]}),d.jsx(tx,{onClick:n,loading:e,disabled:!f,hideAnimations:t,children:"Continue"}),d.jsx(tn,{}),d.jsx(Jt,{})]})},WGe=({className:t,checked:e,color:r="var(--privy-color-accent)",...n})=>d.jsx("label",{children:d.jsxs(zGe,{className:t,children:[d.jsx(Jre,{checked:e,...n}),d.jsx(HGe,{color:r,checked:e,children:d.jsx(Zre,{viewBox:"0 0 24 24",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})})})]})});let zGe=fe.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-db51b935-1"})(["display:inline-block;vertical-align:middle;"]),Zre=fe.svg.withConfig({displayName:"Icon",componentId:"sc-db51b935-2"})(["fill:none;stroke:white;stroke-width:3px;"]),Jre=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;"]),HGe=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)",Jre,t=>t.color,Zre,t=>t.checked?"visible":"hidden");const qGe=({buttonHideAnimations:t,buttonLoading:e,onSubmit:r,onBack:n,config:i})=>{let[s,a]=I.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:n}),d.jsx(Qr,{}),d.jsxs(ex,{children:[d.jsxs(nx,{children:[d.jsx(Rd,{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(nP,{children:d.jsxs(JI,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:o=>{o.preventDefault(),a(l=>!l)},children:[d.jsx(WGe,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),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(VGe,{children:[i.initiatedBy==="user"&&d.jsx(Ad,{onClick:i.onCancel,disabled:e,children:"Cancel"}),d.jsx(tx,{onClick:r,loading:e,hideAnimations:t,disabled:!s,children:"Set Password"})]}),d.jsx(tn,{}),d.jsx(Jt,{})]})};let VGe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-eb601350-0"})(["display:flex;gap:10px;"]);function GGe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 KGe=I.forwardRef(GGe),YGe=({buttonHideAnimations:t,buttonLoading:e,password:r="",config:n,isResettingPassword:i,onSubmit:s,onClose:a,onBack:o,onPasswordChange:l,onPasswordGenerate:c})=>{let[u,f]=I.useState(!1),[h,g]=I.useState(!1);I.useEffect(()=>{r&&!h&&g(!0)},[r]);let m=I.useMemo(()=>h?6>((r==null?void 0:r.length)||0)?"Password must be at least 6 characters":AGe.test(r||"")?null:`Invalid characters used ( ${SGe(r).join(" ")} )`:null,[r,h]),w=I.useMemo(()=>m?{value:0,label:"Weak"}:kGe(r),[r,m]),E=I.useMemo(()=>!(r!=null&&r.length)||!!m,[m,r]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:a,closeable:n.initiatedBy==="user",backFn:o}),d.jsx(Qr,{}),d.jsxs(ex,{children:[d.jsxs(nx,{children:[d.jsx(KGe,{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(rx,{children:[d.jsx(rP,{value:r,onChange:v=>l(v.target.value),onKeyUp:v=>{v.key==="Enter"&&s()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),d.jsxs(iP,{style:{width:"3.5rem"},children:[u?d.jsx(sP,{onClick:()=>f(!1)}):d.jsx(aP,{onClick:()=>f(!0)}),d.jsx(FGe,{onClick:c})]})]}),d.jsx(UGe,{value:w.value===0?.01:w.value,label:w.label}),d.jsx(Kre,{error:!!m,children:m||`Password Strength: ${h?w.label:"--"}`}),d.jsxs(JGe,{children:[d.jsx(ZGe,{children:d.jsxs(nP,{children:[d.jsxs(JI,{children:[d.jsx(P0,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),d.jsxs(JI,{children:[d.jsx(P0,{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(tx,{onClick:s,loading:e,disabled:E,hideAnimations:t,children:"Continue"})]})]}),d.jsx(tn,{}),d.jsx(Jt,{})]})};let ZGe=fe(nP).withConfig({displayName:"DetailsContainer",componentId:"sc-7b3b7727-0"})(["flex:1;padding-top:1rem;"]),JGe=fe.div.withConfig({displayName:"LowerContainer",componentId:"sc-7b3b7727-1"})(["display:flex;flex-direction:column;height:100%;"]);function QGe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 XGe=I.forwardRef(QGe);function eKe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 Qre=I.forwardRef(eKe);function tKe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 rKe=I.forwardRef(tKe),nKe=({buttonHideAnimations:t,buttonLoading:e,appName:r,password:n,onSubmit:i,onBack:s})=>{let[a,o]=I.useState(!1),l=I.useCallback(()=>{o(!0),n&&navigator.clipboard.writeText(n)},[n]),c=I.useCallback(()=>{let u=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),h=new Blob([iKe(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:s,closeable:!1}),d.jsx(Qr,{}),d.jsxs(ex,{children:[d.jsxs(nx,{children:[d.jsx(Rd,{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(rx,{centered:!0,children:d.jsx(DGe,{children:n})}),d.jsxs("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[d.jsx(OW,{onClick:l,children:d.jsxs(d.Fragment,a?{children:[d.jsx(Qre,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[d.jsx(rKe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),d.jsxs(OW,{onClick:c,children:[d.jsx(XGe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),d.jsx(tx,{onClick:i,loading:e,hideAnimations:t,children:"Continue"}),d.jsx(tn,{}),d.jsx(Jt,{})]})};let iKe=(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 oGe=({error:t,onClose:e})=>d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(Qr,{}),d.jsxs(Pd,t?{children:[d.jsx(x_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(Fn,{title:"Something went wrong",description:t})]}:{children:[d.jsx($0,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(Fn,{title:"Success"})]}),d.jsx(Lt,{onClick:e,children:"Close"}),d.jsx(tn,{}),d.jsx(Jt,{})]});let aGe=(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 lGe=()=>{let[t,e]=T.useReducer(aGe,"creating");return{send:e,state:t}},Tre=({onSubmit:t,...e})=>{let{lastScreen:r,navigate:n}=vt(),{send:i,state:s}=lGe(),o=T.useCallback(async()=>{s==="finalizing"&&await t(),i("next")},[s,i,t]);T.useEffect(()=>{let c;return s==="done"&&e.config.initiatedBy==="automatic"&&(c=setTimeout(()=>{var u;return(u=e.onClose)==null?void 0:u.call(e)},Rn)),()=>{c&&clearTimeout(c)}},[s,e.config.initiatedBy,e.onClose]);let a=T.useCallback(()=>{i("back")},[i]),l=T.useCallback(()=>{n(ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN)},[r,n]);return s==="creating"?d.jsx(ZVe,{...e,onSubmit:o,onBack:r===ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN?l:void 0}):s==="saving"?d.jsx(iGe,{...e,onSubmit:o,onBack:a}):s==="confirming"?d.jsx(WVe,{...e,onSubmit:o,onBack:a}):s==="finalizing"?d.jsx(VVe,{...e,onSubmit:o,onBack:a}):s==="done"?d.jsx(oGe,{...e,onSubmit:o}):null},cGe=()=>{let[t,e]=T.useState(null),[r,n]=T.useState(!1),[i,s]=T.useState(null),[o,a]=T.useState(""),{authenticated:l,getAccessToken:c,user:u}=Pr(),{walletProxy:f,refreshUser:h,closePrivyModal:g,createAnalyticsEvent:m}=xt(),{app:w,navigate:E,data:v,onUserCloseViaDialogOrKeybindRef:_}=vt(),{onSuccess:A,onFailure:C}=v.createWallet,R=ia(u),B=(t==null?void 0:t.recoveryMethod)==="user-passcode",S=(R==null?void 0:R.recoveryMethod)==="user-passcode";T.useEffect(()=>{l||(E(ye.LANDING),C(new L9e("User must be authenticated before setting a password on a Privy wallet")))},[l]);let U=()=>i?(C(i),void g({shouldCallAuthOnSuccess:!1})):B?(A(t),void g({shouldCallAuthOnSuccess:!1})):(C(new kf("Exited before password was added to wallet")),void g({shouldCallAuthOnSuccess:!1}));return _.current=U,d.jsx(Tre,{appName:(w==null?void 0:w.name)||"privy",config:{initiatedBy:"user",onCancel:U},error:i?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:o,isResettingPassword:S,onPasswordGenerate:()=>a(xre()),onPasswordChange:a,onSubmit:async()=>{B?(A(t),g({shouldCallAuthOnSuccess:!1})):(n(!0),s(null),await(async()=>{let G=await c();if(G&&(R!=null&&R.address)&&o&&f)try{m({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:R.address,existingRecoveryMethod:R.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S}});let{entropyId:oe,entropyIdVerifier:K}=Wn(R);if(!(await f.setRecovery({accessToken:G,entropyId:oe,entropyIdVerifier:K,recoveryPassword:o,recoveryMethod:"user-passcode"})).entropyId)return s(new kf("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:R.address,existingRecoveryMethod:R.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S,reason:"error setting password"}});let N=await h(),k=ia(N);if(!k)return s(new kf("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:R.address,existingRecoveryMethod:R.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S,reason:"wallet disconnected"}});e(k),m({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:R.address,existingRecoveryMethod:R.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S}})}catch(oe){console.warn(oe),s(oe instanceof Error?oe:Error("Error setting password on privy wallet")),m({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:R.address,reason:oe}})}})(),n(!1))},onClose:U})};function uGe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 ZN=T.forwardRef(uGe);function dGe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 $re=T.forwardRef(dGe),fGe=()=>{let{closePrivyModal:t}=xt(),{data:e,setModalData:r,navigate:n,onUserCloseViaDialogOrKeybindRef:i}=vt(),{onSuccess:s,onFailure:o}=e.setWalletPassword,a=()=>{o(new kf("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return i.current=a,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:a}),d.jsx(Qr,{}),d.jsxs(Pd,{children:[d.jsxs(SPe,{children:[d.jsx(ZN,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(IPe,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:d.jsx($re,{width:"12px",height:"12px",fill:"white"})})]}),d.jsxs(Fn,{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(Lt,{onClick:()=>{r({createWallet:{onFailure:o,onSuccess:s,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),n(ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN)},children:"Add password"}),d.jsx(tn,{}),d.jsx(Jt,{})]})};let hGe=(t,e)=>{let r=d.jsx(Nd,{height:38,width:38,stroke:"var(--privy-color-error)"});if(t instanceof Ee)switch(t.privyErrorCode){case Se.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:t.message,ctaText:"Try again",icon:r};case Se.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:t.message,ctaText:"Try again",icon:r};case Se.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 Jn&&t.type==="twilio_verification_failed")return{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:d.jsx(tc,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(t instanceof Lo))return t instanceof Ha&&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 Se.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case Se.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:t.message,ctaText:"Try another method",icon:r};case Se.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(mee,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case Se.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:d.jsx("span",{})};case Se.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:d.jsx("span",{})};case Se.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case Se.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 Se.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 pGe=()=>{var o,a;let{navigate:t,navigateBack:e,data:r,lastScreen:n,currentScreen:i}=vt(),s=((o=r==null?void 0:r.errorModalData)==null?void 0:o.previousScreen)||(n===i?void 0:n);return d.jsx(xw,{error:((a=r==null?void 0:r.errorModalData)==null?void 0:a.error)||Error(),backFn:()=>s?t(s,!1):e(),onClick:()=>t(s||ye.LANDING,!1)})},xw=({error:t,backFn:e,onClick:r})=>{let{reset:n}=Ca(),{app:i}=vt(),s=hGe(t,i.allowlistConfig);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:e}),d.jsxs(gGe,{children:[d.jsx(Fo,{children:d.jsxs("div",{children:[d.jsx(dN,{color:"var(--privy-color-error)"}),s.icon]})}),d.jsxs(mGe,{children:[d.jsx("h3",{children:s.title}),d.jsx("p",{children:s.detail})]}),d.jsx(Lt,{color:"var(--privy-color-error)",onClick:()=>{t instanceof Lo&&(t.privyErrorCode===Se.INVALID_CAPTCHA&&n(),t.privyErrorCode===Se.ALLOWLIST_REJECTED&&i.allowlistConfig.errorCtaLink)?window.location.href=i.allowlistConfig.errorCtaLink:r==null||r()},children:s.ctaText})]})]})};let gGe=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;"]),mGe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-1d84a574-1"})(["display:flex;flex-direction:column;gap:8px;"]);const kre=({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"})}),yGe=({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"})})}),Q_=t=>{let[e,r]=T.useState(!1);return d.jsxs(vGe,{color:t.color,onClick:()=>{r(!0),navigator.clipboard.writeText(t.text),setTimeout(()=>r(!1),1500)},justCopied:e,children:[e?d.jsx(kre,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):d.jsx(yGe,{style:{height:"14px",width:"14px"}}),e?"Copied":"Copy"," ",t.itemName?t.itemName:"to Clipboard"]})};let vGe=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 Nre=t=>{let[e,r]=T.useState(!1);return d.jsx(wGe,{color:t.color,href:t.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:e,children:t.text})};let wGe=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 Ew={},bGe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Pre={},Ia={};let JN;const _Ge=[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];Ia.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};Ia.getSymbolTotalCodewords=function(e){return _Ge[e]};Ia.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Ia.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');JN=e};Ia.isKanjiModeEnabled=function(){return typeof JN<"u"};Ia.toSJIS=function(e){return JN(e)};var X_={};(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}}})(X_);function Rre(){this.buffer=[],this.length=0}Rre.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 xGe=Rre;function Cw(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)}Cw.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};Cw.prototype.get=function(t,e){return this.data[t*this.size+e]};Cw.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Cw.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var EGe=Cw,Mre={};(function(t){const e=Ia.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,s=e(n),o=s===145?26:Math.ceil((s-13)/(2*i-2))*2,a=[s-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 s=i.size;let o=0,a=0,l=0,c=null,u=null;for(let f=0;f=5&&(o+=e.N1+(a-5)),c=g,a=1),g=i.get(h,f),g===u?l++:(l>=5&&(o+=e.N1+(l-5)),u=g,l=1)}a>=5&&(o+=e.N1+(a-5)),l>=5&&(o+=e.N1+(l-5))}return o},t.getPenaltyN2=function(i){const s=i.size;let o=0;for(let a=0;a=10&&(a===1488||a===93)&&o++,l=l<<1&2047|i.get(u,c),u>=10&&(l===1488||l===93)&&o++}return o*e.N3},t.getPenaltyN4=function(i){let s=0;const o=i.data.length;for(let l=0;l=0;){const o=s[0];for(let l=0;l0){const s=new Uint8Array(this.degree);return s.set(n,i),s}return n};var AGe=QN,Fre={},ah={},XN={};XN.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var pu={};const Ure="[0-9]+",SGe="[A-Z $%*+\\-./:]+";let fv="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";fv=fv.replace(/u/g,"\\u");const IGe="(?:(?![A-Z0-9 $%*+\\-./:]|"+fv+`)(?:.|[\r -]))+`;pu.KANJI=new RegExp(fv,"g");pu.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");pu.BYTE=new RegExp(IGe,"g");pu.NUMERIC=new RegExp(Ure,"g");pu.ALPHANUMERIC=new RegExp(SGe,"g");const TGe=new RegExp("^"+fv+"$"),$Ge=new RegExp("^"+Ure+"$"),kGe=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");pu.testKanji=function(e){return TGe.test(e)};pu.testNumeric=function(e){return $Ge.test(e)};pu.testAlphanumeric=function(e){return kGe.test(e)};(function(t){const e=XN,r=pu;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(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.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(s,o){if(t.isValid(s))return s;try{return n(s)}catch{return o}}})(ah);(function(t){const e=Ia,r=e7,n=X_,i=ah,s=XN,o=7973,a=e.getBCHDigit(o);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 E=c(w.mode,g);m+=E+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 s.isValid(g)?parseInt(g,10):m},t.getCapacity=function(g,m,w){if(!s.isValid(g))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=i.BYTE);const E=e.getSymbolTotalCodewords(g),v=r.getTotalCodewordsCount(g,m),_=(E-v)*8;if(w===i.MIXED)return _;const A=_-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 E=n.from(m,n.M);if(Array.isArray(g)){if(g.length>1)return f(g,E);if(g.length===0)return 1;w=g[0]}else w=g;return l(w.mode,w.getLength(),E)},t.getEncodedBits=function(g){if(!s.isValid(g)||g<7)throw new Error("Invalid QR Code version");let m=g<<12;for(;e.getBCHDigit(m)-a>=0;)m^=o<=0;)i^=Wre<0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,s*3+1))};var RGe=wg;const MGe=ah,aC=["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 bg(t){this.mode=MGe.ALPHANUMERIC,this.data=t}bg.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};bg.prototype.getLength=function(){return this.data.length};bg.prototype.getBitsLength=function(){return bg.getBitsLength(this.data.length)};bg.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=aC.indexOf(this.data[r])*45;n+=aC.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(aC.indexOf(this.data[r]),6)};var OGe=bg;const jGe=ah;function _g(t){this.mode=jGe.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}_g.getBitsLength=function(e){return e*8};_g.prototype.getLength=function(){return this.data.length};_g.prototype.getBitsLength=function(){return _g.getBitsLength(this.data.length)};_g.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 UGe=xg,Hre={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var s={},o={};o[n]=0;var a=e.PriorityQueue.make();a.push(n,0);for(var l,c,u,f,h,g,m,w,E;!a.empty();){l=a.pop(),c=l.value,f=l.cost,h=r[c]||{};for(u in h)h.hasOwnProperty(u)&&(g=h[u],m=f+g,w=o[u],E=typeof o[u]>"u",(E||w>m)&&(o[u]=m,a.push(u,m),s[u]=c))}if(typeof i<"u"&&typeof o[i]>"u"){var v=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(v)}return s},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],s=n;s;)i.push(s),r[s],s=r[s];return i.reverse(),i},find_path:function(r,n,i){var s=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(s,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},s;r=r||{};for(s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);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})(Hre);var BGe=Hre.exports;(function(t){const e=ah,r=RGe,n=OGe,i=DGe,s=UGe,o=pu,a=Ia,l=BGe;function c(v){return unescape(encodeURIComponent(v)).length}function u(v,_,A){const C=[];let R;for(;(R=v.exec(A))!==null;)C.push({data:R[0],index:R.index,mode:_,length:R[0].length});return C}function f(v){const _=u(o.NUMERIC,e.NUMERIC,v),A=u(o.ALPHANUMERIC,e.ALPHANUMERIC,v);let C,R;return a.isKanjiModeEnabled()?(C=u(o.BYTE,e.BYTE,v),R=u(o.KANJI,e.KANJI,v)):(C=u(o.BYTE_KANJI,e.BYTE,v),R=[]),_.concat(A,C,R).sort(function(S,U){return S.index-U.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function h(v,_){switch(_){case e.NUMERIC:return r.getBitsLength(v);case e.ALPHANUMERIC:return n.getBitsLength(v);case e.KANJI:return s.getBitsLength(v);case e.BYTE:return i.getBitsLength(v)}}function g(v){return v.reduce(function(_,A){const C=_.length-1>=0?_[_.length-1]:null;return C&&C.mode===A.mode?(_[_.length-1].data+=A.data,_):(_.push(A),_)},[])}function m(v){const _=[];for(let A=0;A=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?t.set(s+a,o+l,!0,!0):t.set(s+a,o+l,!1,!0))}}function ZGe(t){const e=t.size;for(let r=8;r>a&1)===1,t.set(i,s,o,!0),t.set(s,i,o,!0)}function uC(t,e,r){const n=t.size,i=GGe.getEncodedBits(e,r);let s,o;for(s=0;s<15;s++)o=(i>>s&1)===1,s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(n-15+s,8,o,!0),s<8?t.set(8,n-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(n-8,8,1,!0)}function XGe(t,e){const r=t.size;let n=-1,i=r-1,s=7,o=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!t.isReserved(i,a-l)){let c=!1;o>>s&1)===1),t.set(i,a-l,c),s--,s===-1&&(o++,s=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function eKe(t,e,r){const n=new WGe;r.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),KGe.getCharCountIndicator(l.mode,t)),l.write(n)});const i=r7.getSymbolTotalCodewords(t),s=GI.getTotalCodewordsCount(t,e),o=(i-s)*8;for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const a=(o-n.getLengthInBits())/8;for(let l=0;ld.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(Qr,{}),d.jsxs(Md,t?{children:[d.jsx(T_,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(Fn,{title:"Something went wrong",description:t})]}:{children:[d.jsx(P0,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(Fn,{title:"Success"})]}),d.jsx(Dt,{onClick:e,children:"Close"}),d.jsx(tn,{}),d.jsx(Jt,{})]});let aKe=(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 oKe=()=>{let[t,e]=I.useReducer(aKe,"creating");return{send:e,state:t}},Xre=({onSubmit:t,...e})=>{let{lastScreen:r,navigate:n}=vt(),{send:i,state:s}=oKe(),a=I.useCallback(async()=>{s==="finalizing"&&await t(),i("next")},[s,i,t]);I.useEffect(()=>{let c;return s==="done"&&e.config.initiatedBy==="automatic"&&(c=setTimeout(()=>{var u;return(u=e.onClose)==null?void 0:u.call(e)},Mn)),()=>{c&&clearTimeout(c)}},[s,e.config.initiatedBy,e.onClose]);let o=I.useCallback(()=>{i("back")},[i]),l=I.useCallback(()=>{n(ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN)},[r,n]);return s==="creating"?d.jsx(YGe,{...e,onSubmit:a,onBack:r===ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN?l:void 0}):s==="saving"?d.jsx(nKe,{...e,onSubmit:a,onBack:o}):s==="confirming"?d.jsx(BGe,{...e,onSubmit:a,onBack:o}):s==="finalizing"?d.jsx(qGe,{...e,onSubmit:a,onBack:o}):s==="done"?d.jsx(sKe,{...e,onSubmit:a}):null},lKe=()=>{let[t,e]=I.useState(null),[r,n]=I.useState(!1),[i,s]=I.useState(null),[a,o]=I.useState(""),{authenticated:l,getAccessToken:c,user:u}=Pr(),{walletProxy:f,refreshUser:h,closePrivyModal:g,createAnalyticsEvent:m}=xt(),{app:w,navigate:E,data:v,onUserCloseViaDialogOrKeybindRef:_}=vt(),{onSuccess:A,onFailure:C}=v.createWallet,R=no(u),B=(t==null?void 0:t.recoveryMethod)==="user-passcode",S=(R==null?void 0:R.recoveryMethod)==="user-passcode";I.useEffect(()=>{l||(E(ye.LANDING),C(new LEe("User must be authenticated before setting a password on a Privy wallet")))},[l]);let U=()=>i?(C(i),void g({shouldCallAuthOnSuccess:!1})):B?(A(t),void g({shouldCallAuthOnSuccess:!1})):(C(new Pf("Exited before password was added to wallet")),void g({shouldCallAuthOnSuccess:!1}));return _.current=U,d.jsx(Xre,{appName:(w==null?void 0:w.name)||"privy",config:{initiatedBy:"user",onCancel:U},error:i?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:S,onPasswordGenerate:()=>o(Gre()),onPasswordChange:o,onSubmit:async()=>{B?(A(t),g({shouldCallAuthOnSuccess:!1})):(n(!0),s(null),await(async()=>{let G=await c();if(G&&(R!=null&&R.address)&&a&&f)try{m({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:R.address,existingRecoveryMethod:R.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S}});let{entropyId:ae,entropyIdVerifier:K}=Wn(R);if(!(await f.setRecovery({accessToken:G,entropyId:ae,entropyIdVerifier:K,recoveryPassword:a,recoveryMethod:"user-passcode"})).entropyId)return s(new Pf("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:R.address,existingRecoveryMethod:R.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S,reason:"error setting password"}});let N=await h(),k=no(N);if(!k)return s(new Pf("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:R.address,existingRecoveryMethod:R.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S,reason:"wallet disconnected"}});e(k),m({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:R.address,existingRecoveryMethod:R.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S}})}catch(ae){console.warn(ae),s(ae instanceof Error?ae:Error("Error setting password on privy wallet")),m({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:R.address,reason:ae}})}})(),n(!1))},onClose:U})};function cKe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 oP=I.forwardRef(cKe);function uKe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 ene=I.forwardRef(uKe),dKe=()=>{let{closePrivyModal:t}=xt(),{data:e,setModalData:r,navigate:n,onUserCloseViaDialogOrKeybindRef:i}=vt(),{onSuccess:s,onFailure:a}=e.setWalletPassword,o=()=>{a(new Pf("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(Qr,{}),d.jsxs(Md,{children:[d.jsxs(ARe,{children:[d.jsx(oP,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(SRe,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:d.jsx(ene,{width:"12px",height:"12px",fill:"white"})})]}),d.jsxs(Fn,{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(Dt,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:s,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),n(ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN)},children:"Add password"}),d.jsx(tn,{}),d.jsx(Jt,{})]})};let fKe=(t,e)=>{let r=d.jsx(Rd,{height:38,width:38,stroke:"var(--privy-color-error)"});if(t instanceof Ee)switch(t.privyErrorCode){case Se.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:t.message,ctaText:"Try again",icon:r};case Se.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:t.message,ctaText:"Try again",icon:r};case Se.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 Jn&&t.type==="twilio_verification_failed")return{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:d.jsx(tc,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(t instanceof La))return t instanceof Ho&&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 Se.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case Se.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:t.message,ctaText:"Try another method",icon:r};case Se.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(Bee,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case Se.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:d.jsx("span",{})};case Se.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:d.jsx("span",{})};case Se.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case Se.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 Se.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 hKe=()=>{var a,o;let{navigate:t,navigateBack:e,data:r,lastScreen:n,currentScreen:i}=vt(),s=((a=r==null?void 0:r.errorModalData)==null?void 0:a.previousScreen)||(n===i?void 0:n);return d.jsx(Aw,{error:((o=r==null?void 0:r.errorModalData)==null?void 0:o.error)||Error(),backFn:()=>s?t(s,!1):e(),onClick:()=>t(s||ye.LANDING,!1)})},Aw=({error:t,backFn:e,onClick:r})=>{let{reset:n}=Co(),{app:i}=vt(),s=fKe(t,i.allowlistConfig);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:e}),d.jsxs(pKe,{children:[d.jsx(Da,{children:d.jsxs("div",{children:[d.jsx(xN,{color:"var(--privy-color-error)"}),s.icon]})}),d.jsxs(gKe,{children:[d.jsx("h3",{children:s.title}),d.jsx("p",{children:s.detail})]}),d.jsx(Dt,{color:"var(--privy-color-error)",onClick:()=>{t instanceof La&&(t.privyErrorCode===Se.INVALID_CAPTCHA&&n(),t.privyErrorCode===Se.ALLOWLIST_REJECTED&&i.allowlistConfig.errorCtaLink)?window.location.href=i.allowlistConfig.errorCtaLink:r==null||r()},children:s.ctaText})]})]})};let pKe=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;"]),gKe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-1d84a574-1"})(["display:flex;flex-direction:column;gap:8px;"]);const tne=({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"})}),mKe=({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"})})}),ix=t=>{let[e,r]=I.useState(!1);return d.jsxs(yKe,{color:t.color,onClick:()=>{r(!0),navigator.clipboard.writeText(t.text),setTimeout(()=>r(!1),1500)},justCopied:e,children:[e?d.jsx(tne,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):d.jsx(mKe,{style:{height:"14px",width:"14px"}}),e?"Copied":"Copy"," ",t.itemName?t.itemName:"to Clipboard"]})};let yKe=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 rne=t=>{let[e,r]=I.useState(!1);return d.jsx(vKe,{color:t.color,href:t.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:e,children:t.text})};let vKe=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 Sw={},wKe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},nne={},Io={};let lP;const bKe=[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];Io.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};Io.getSymbolTotalCodewords=function(e){return bKe[e]};Io.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Io.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');lP=e};Io.isKanjiModeEnabled=function(){return typeof lP<"u"};Io.toSJIS=function(e){return lP(e)};var sx={};(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}}})(sx);function ine(){this.buffer=[],this.length=0}ine.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 _Ke=ine;function Iw(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)}Iw.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};Iw.prototype.get=function(t,e){return this.data[t*this.size+e]};Iw.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Iw.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var xKe=Iw,sne={};(function(t){const e=Io.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,s=e(n),a=s===145?26:Math.ceil((s-13)/(2*i-2))*2,o=[s-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 s=i.size;let a=0,o=0,l=0,c=null,u=null;for(let f=0;f=5&&(a+=e.N1+(o-5)),c=g,o=1),g=i.get(h,f),g===u?l++:(l>=5&&(a+=e.N1+(l-5)),u=g,l=1)}o>=5&&(a+=e.N1+(o-5)),l>=5&&(a+=e.N1+(l-5))}return a},t.getPenaltyN2=function(i){const s=i.size;let a=0;for(let o=0;o=10&&(o===1488||o===93)&&a++,l=l<<1&2047|i.get(u,c),u>=10&&(l===1488||l===93)&&a++}return a*e.N3},t.getPenaltyN4=function(i){let s=0;const a=i.data.length;for(let l=0;l=0;){const a=s[0];for(let l=0;l0){const s=new Uint8Array(this.degree);return s.set(n,i),s}return n};var CKe=cP,une={},uh={},uP={};uP.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var mu={};const dne="[0-9]+",AKe="[A-Z $%*+\\-./:]+";let gv="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";gv=gv.replace(/u/g,"\\u");const SKe="(?:(?![A-Z0-9 $%*+\\-./:]|"+gv+`)(?:.|[\r +]))+`;mu.KANJI=new RegExp(gv,"g");mu.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");mu.BYTE=new RegExp(SKe,"g");mu.NUMERIC=new RegExp(dne,"g");mu.ALPHANUMERIC=new RegExp(AKe,"g");const IKe=new RegExp("^"+gv+"$"),TKe=new RegExp("^"+dne+"$"),$Ke=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");mu.testKanji=function(e){return IKe.test(e)};mu.testNumeric=function(e){return TKe.test(e)};mu.testAlphanumeric=function(e){return $Ke.test(e)};(function(t){const e=uP,r=mu;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(s,a){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?s.ccBits[0]:a<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.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(s,a){if(t.isValid(s))return s;try{return n(s)}catch{return a}}})(uh);(function(t){const e=Io,r=ax,n=sx,i=uh,s=uP,a=7973,o=e.getBCHDigit(a);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 E=c(w.mode,g);m+=E+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 s.isValid(g)?parseInt(g,10):m},t.getCapacity=function(g,m,w){if(!s.isValid(g))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=i.BYTE);const E=e.getSymbolTotalCodewords(g),v=r.getTotalCodewordsCount(g,m),_=(E-v)*8;if(w===i.MIXED)return _;const A=_-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 E=n.from(m,n.M);if(Array.isArray(g)){if(g.length>1)return f(g,E);if(g.length===0)return 1;w=g[0]}else w=g;return l(w.mode,w.getLength(),E)},t.getEncodedBits=function(g){if(!s.isValid(g)||g<7)throw new Error("Invalid QR Code version");let m=g<<12;for(;e.getBCHDigit(m)-o>=0;)m^=a<=0;)i^=hne<0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,s*3+1))};var PKe=_g;const RKe=uh,pC=["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 xg(t){this.mode=RKe.ALPHANUMERIC,this.data=t}xg.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};xg.prototype.getLength=function(){return this.data.length};xg.prototype.getBitsLength=function(){return xg.getBitsLength(this.data.length)};xg.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=pC.indexOf(this.data[r])*45;n+=pC.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(pC.indexOf(this.data[r]),6)};var MKe=xg;const OKe=uh;function Eg(t){this.mode=OKe.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}Eg.getBitsLength=function(e){return e*8};Eg.prototype.getLength=function(){return this.data.length};Eg.prototype.getBitsLength=function(){return Eg.getBitsLength(this.data.length)};Eg.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 FKe=Cg,gne={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var s={},a={};a[n]=0;var o=e.PriorityQueue.make();o.push(n,0);for(var l,c,u,f,h,g,m,w,E;!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=a[u],E=typeof a[u]>"u",(E||w>m)&&(a[u]=m,o.push(u,m),s[u]=c))}if(typeof i<"u"&&typeof a[i]>"u"){var v=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(v)}return s},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],s=n;s;)i.push(s),r[s],s=r[s];return i.reverse(),i},find_path:function(r,n,i){var s=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(s,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},s;r=r||{};for(s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);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})(gne);var UKe=gne.exports;(function(t){const e=uh,r=PKe,n=MKe,i=jKe,s=FKe,a=mu,o=Io,l=UKe;function c(v){return unescape(encodeURIComponent(v)).length}function u(v,_,A){const C=[];let R;for(;(R=v.exec(A))!==null;)C.push({data:R[0],index:R.index,mode:_,length:R[0].length});return C}function f(v){const _=u(a.NUMERIC,e.NUMERIC,v),A=u(a.ALPHANUMERIC,e.ALPHANUMERIC,v);let C,R;return o.isKanjiModeEnabled()?(C=u(a.BYTE,e.BYTE,v),R=u(a.KANJI,e.KANJI,v)):(C=u(a.BYTE_KANJI,e.BYTE,v),R=[]),_.concat(A,C,R).sort(function(S,U){return S.index-U.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function h(v,_){switch(_){case e.NUMERIC:return r.getBitsLength(v);case e.ALPHANUMERIC:return n.getBitsLength(v);case e.KANJI:return s.getBitsLength(v);case e.BYTE:return i.getBitsLength(v)}}function g(v){return v.reduce(function(_,A){const C=_.length-1>=0?_[_.length-1]:null;return C&&C.mode===A.mode?(_[_.length-1].data+=A.data,_):(_.push(A),_)},[])}function m(v){const _=[];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(s+o,a+l,!0,!0):t.set(s+o,a+l,!1,!0))}}function YKe(t){const e=t.size;for(let r=8;r>o&1)===1,t.set(i,s,a,!0),t.set(s,i,a,!0)}function yC(t,e,r){const n=t.size,i=VKe.getEncodedBits(e,r);let s,a;for(s=0;s<15;s++)a=(i>>s&1)===1,s<6?t.set(s,8,a,!0):s<8?t.set(s+1,8,a,!0):t.set(n-15+s,8,a,!0),s<8?t.set(8,n-s-1,a,!0):s<9?t.set(8,15-s-1+1,a,!0):t.set(8,15-s-1,a,!0);t.set(n-8,8,1,!0)}function QKe(t,e){const r=t.size;let n=-1,i=r-1,s=7,a=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;a>>s&1)===1),t.set(i,o-l,c),s--,s===-1&&(a++,s=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function XKe(t,e,r){const n=new BKe;r.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),GKe.getCharCountIndicator(l.mode,t)),l.write(n)});const i=lx.getSymbolTotalCodewords(t),s=eT.getTotalCodewordsCount(t,e),a=(i-s)*8;for(n.getLengthInBits()+4<=a&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const o=(a-n.getLengthInBits())/8;for(let l=0;l=7&&QGe(l,e),XGe(l,o),isNaN(n)&&(n=VI.getBestMask(l,uC.bind(null,l,r))),VI.applyMask(n,l),uC(l,r,n),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}Pre.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=lC.M,i,s;return typeof r<"u"&&(n=lC.from(r.errorCorrectionLevel,lC.M),i=h4.from(r.version),s=VI.from(r.maskPattern),r.toSJISFunc&&r7.setToSJISFunction(r.toSJISFunc)),rKe(e,i,n,s)};var qre={},eP={};(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(s){return[s,s]}))),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,s=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:s,scale:s?4:o,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 s=t.getScale(n,i);return Math.floor((n+i.margin*2)*s)},t.qrToImageData=function(n,i,s){const o=i.modules.size,a=i.modules.data,l=t.getScale(o,s),c=Math.floor((o+s.margin*2)*l),u=s.margin*l,f=[s.color.light,s.color.dark];for(let h=0;h=u&&g>=u&&h"u"&&(!o||!o.getContext)&&(l=o,o=void 0),o||(c=n()),l=e.getOptions(l);const u=e.getImageWidth(s.modules.size,l),f=c.getContext("2d"),h=f.createImageData(u,u);return e.qrToImageData(h.data,s,l),r(f,c,u),f.putImageData(h,0,0),c},t.renderToDataURL=function(s,o,a){let l=a;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),l||(l={});const c=t.render(s,o,l),u=l.type||"image/png",f=l.rendererOpts||{};return c.toDataURL(u,f.quality)}})(qre);var Vre={};const nKe=eP;function wW(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function dC(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function iKe(t,e,r){let n="",i=0,s=!1,o=0;for(let a=0;a0&&l>0&&t[a-1]||(n+=s?dC("M",l+r,.5+c+r):dC("m",i,0),i=0,s=!1),l+1':"",c="',u='viewBox="0 0 '+a+" "+a+'"',h=''+l+c+` -`;return typeof n=="function"&&n(null,h),h};const sKe=bGe,KI=Pre,Gre=qre,oKe=Vre;function tP(t,e,r,n,i){const s=[].slice.call(arguments,1),o=s.length,a=typeof s[o-1]=="function";if(!a&&!sKe())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(i=r,r=e,e=n=void 0):o===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(r=e,e=n=void 0):o===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(l,c){try{const u=KI.create(r,n);l(t(u,e,n))}catch(u){c(u)}})}try{const l=KI.create(r,n);i(null,t(l,e,n))}catch(l){i(l)}}Ew.create=KI.create;Ew.toCanvas=tP.bind(null,Gre.render);Ew.toDataURL=tP.bind(null,Gre.renderToDataURL);Ew.toString=tP.bind(null,function(t,e,r){return oKe.render(t,r)});const aKe=()=>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 fC=(t,e,r,n,i)=>{for(let s=e;s{let r=Ew.create(t,{errorCorrectionLevel:e}).modules,n=BEe(Array.from(r.data),r.size);return n=fC(n,0,0,7,7),n=fC(n,n.length-7,0,7,7),fC(n,0,n.length-7,7,7)},cKe=({x:t,y:e,cellSize:r,bgColor:n,fgColor:i})=>d.jsx(d.Fragment,{children:[0,1,2].map(s=>d.jsx("circle",{r:r*(7-2*s)/2,cx:t+7*r/2,cy:e+7*r/2,fill:s%2!=0?n:i},`finder-${t}-${e}-${s}`))}),uKe=({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,s])=>d.jsx(cKe,{x:i,y:s,cellSize:t,bgColor:r,fgColor:n},`finder-${i}-${s}`))}),dKe=({matrix:t,cellSize:e,color:r})=>d.jsx(d.Fragment,{children:t.map((n,i)=>n.map((s,o)=>s?d.jsx("rect",{height:e-.4,width:e-.4,x:i*e+.1*e,y:o*e+.1*e,rx:.5*e,ry:.5*e,fill:r},`cell-${i}-${o}`):d.jsx(It.Fragment,{},`circle-${i}-${o}`)))}),fKe=({cellSize:t,matrixSize:e,element:r,sizePercentage:n,bgColor:i})=>{if(!r)return d.jsx(d.Fragment,{});let s=e*(n||.14),o=Math.floor(e/2-s/2),a=Math.floor(e/2+s/2);(a-o)%2!=e%2&&(a+=1);let l=(a-o)*t,c=l-.2*l,u=o*t;return d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:o*t,y:o*t,width:l,height:l,fill:i}),d.jsx(r,{x:u+.1*l,y:u+.1*l,height:c,width:c})]})},hKe=t=>{var s;let e=t.outputSize,r=lKe(t.url,t.errorCorrectionLevel),n=e/r.length,i=GEe(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(dKe,{matrix:r,cellSize:n,color:t.fgColor}),d.jsx(uKe,{cellSize:n,matrixSize:r.length,fgColor:t.fgColor,bgColor:t.bgColor}),d.jsx(fKe,{cellSize:n,element:(s=t.logo)==null?void 0:s.element,bgColor:t.bgColor,matrixSize:r.length})]})},pKe=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 n7=t=>{let{appearance:e}=wi(),r=t.bgColor||"#FFFFFF",n=t.fgColor||"#000000",i=t.size||160,s=e.palette.colorScheme==="dark"?r:n;return d.jsx(pKe,{$size:i,$bgColor:r,$fgColor:n,$borderColor:s,children:d.jsx(hKe,{url:t.url,logo:{element:t.squareLogoElement??aKe},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 bW="#8a63d2";const gKe=()=>{let{authenticated:t,logout:e,ready:r,user:n}=Pr(),{lastScreen:i,navigate:s,navigateBack:o,setModalData:a,app:l}=vt(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:f,createAnalyticsEvent:h}=xt(),[g,m]=T.useState(void 0),[w,E]=T.useState(!1),[v,_]=T.useState(!1),A=T.useRef([]),C=c(),R=C==null?void 0:C.meta.connectUri;return T.useEffect(()=>{let B=Date.now(),S=setInterval(async()=>{var oe,K,N,k,b,x,P,L,O,j,I,D,M,X,le;let U=await C.pollForReady.execute(),G=Date.now()-B;if(U){clearInterval(S),E(!0);try{await u(),_(!0)}catch(H){let ee={retryable:!1,message:"Authentication failed"};if((H==null?void 0:H.privyErrorCode)===Se.ALLOWLIST_REJECTED)return void s(ye.ALLOWLIST_REJECTION_SCREEN);if((H==null?void 0:H.privyErrorCode)===Se.USER_LIMIT_REACHED)return console.error(new Vv(H).toString()),void s(ye.USER_LIMIT_REACHED_SCREEN);if((H==null?void 0:H.privyErrorCode)===Se.USER_DOES_NOT_EXIST)return void s(ye.ACCOUNT_NOT_FOUND_SCREEN);if((H==null?void 0:H.privyErrorCode)===Se.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)===Se.ACCOUNT_TRANSFER_REQUIRED&&((K=(oe=H.data)==null?void 0:oe.data)!=null&&K.nonce))return a({accountTransfer:{nonce:(k=(N=H.data)==null?void 0:N.data)==null?void 0:k.nonce,account:(x=(b=H.data)==null?void 0:b.data)==null?void 0:x.subject,displayName:(O=(L=(P=H.data)==null?void 0:P.data)==null?void 0:L.account)==null?void 0:O.displayName,linkMethod:"farcaster",embeddedWalletAddress:(D=(I=(j=H.data)==null?void 0:j.data)==null?void 0:I.otherUser)==null?void 0:D.embeddedWalletAddress,farcasterEmbeddedAddress:(le=(X=(M=H.data)==null?void 0:M.data)==null?void 0:X.otherUser)==null?void 0:le.farcasterEmbeddedAddress}}),void s(ye.LINK_CONFLICT_SCREEN);(H==null?void 0:H.privyErrorCode)===Se.INVALID_CREDENTIALS?(ee.retryable=!0,ee.detail="Something went wrong. Try again."):(H==null?void 0:H.privyErrorCode)===Se.TOO_MANY_REQUESTS&&(ee.detail="Too many requests. Please wait before trying again.")}m(ee)}}else G>12e4&&(clearInterval(S),m({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},2e3);return()=>{clearInterval(S),A.current.forEach(U=>clearTimeout(U))}},[]),T.useEffect(()=>{if(r&&t&&v&&n){if(l!=null&&l.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let B=setTimeout(()=>{s(ye.AFFIRMATIVE_CONSENT_SCREEN)},Rn);return()=>clearTimeout(B)}v&&(wd(n,l==null?void 0:l.embeddedWallets.createOnLogin)?A.current.push(setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:B=>{console.error(B),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:B,screen:"FarcasterConnectStatusScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),s(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Rn)):A.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Rn)))}},[v,r,t,n]),d.jsxs(d.Fragment,cs||w?{children:[d.jsx(ft,{backFn:i?o:void 0,onClose:f},"header"),d.jsx(Qr,{}),d.jsx(d.Fragment,O$?{children:d.jsxs(mKe,{children:[d.jsx(Fo,{children:d.jsxs("div",{children:[d.jsx(ec,{success:v,fail:!!g}),d.jsx(o0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(ya,{children:[d.jsx(un,{children:g?g.message:"Sign in with Farcaster"}),d.jsx(dn,{children:g?g.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),R&&d.jsx(Lt,{onClick:B=>{B.preventDefault(),window.location.href=R},children:"Open Warpcast app"})]})}:{children:d.jsxs(_W,{children:[d.jsx(Fo,{children:d.jsxs("div",{children:[d.jsx(ec,{success:v,fail:!!g}),d.jsx(o0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(ya,{children:[d.jsx(un,{children:g?g.message:"Signing in with Farcaster"}),d.jsx(dn,{children:g?g.detail:"This should only take a moment"}),d.jsx(rc,{children:R&&cs&&d.jsx(Nre,{text:"Take me to Warpcast",url:R,color:bW})})]})]})}),d.jsx($r,{})]}:{children:[d.jsx(ft,{backFn:i?o:void 0,onClose:f},"header"),d.jsx(Qr,{}),d.jsx(_W,{children:d.jsxs("div",{children:[d.jsx(un,{children:"Sign in with Farcaster"}),d.jsx(dn,{children:"Scan with your phone's camera to continue."}),d.jsx(pN,{children:R?d.jsx(n7,{url:R,size:275,squareLogoElement:o0}):d.jsx(nl,{})}),d.jsxs(rc,{children:[d.jsx(dn,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),R&&d.jsx(Q_,{text:R,itemName:"link",color:bW})]})]})}),d.jsx($r,{})]})};let _W=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;"]),mKe=fe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-5a361367-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),xW="#8a63d2";const yKe=()=>{let{lastScreen:t,navigateBack:e,data:r,app:n}=vt(),{requestFarcasterSignerStatus:i,closePrivyModal:s}=xt(),[o,a]=T.useState(void 0),[l,c]=T.useState(!1),[u,f]=T.useState(!1),h=T.useRef([]),g=r==null?void 0:r.farcasterSigner;T.useEffect(()=>{let w=Date.now(),E=setInterval(async()=>{if(!(g!=null&&g.public_key))return clearInterval(E),void a({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});g.status==="approved"&&(clearInterval(E),c(!1),f(!0),h.current.push(setTimeout(()=>s({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Rn)));let v=await i(g==null?void 0:g.public_key),_=Date.now()-w;v.status==="approved"?(clearInterval(E),c(!1),f(!0),h.current.push(setTimeout(()=>s({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Rn))):_>3e5?(clearInterval(E),a({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):v.status==="revoked"&&(clearInterval(E),a({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},2e3);return()=>{clearInterval(E),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,cs||l?{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:s},"header"),d.jsx(Qr,{}),d.jsx(d.Fragment,O$?{children:d.jsxs(vKe,{children:[d.jsx(Fo,{children:d.jsxs("div",{children:[d.jsx(ec,{success:u,fail:!!o}),d.jsx(o0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(ya,{children:[d.jsx(un,{children:o?o.message:"Add a signer to Farcaster"}),d.jsx(dn,{children:o?o.detail:"This will allow "+n.name+" to add casts, likes, follows, and more on your behalf."})]}),m&&d.jsx(Lt,{onClick:w=>{w.preventDefault(),window.location.href=m},children:"Open Warpcast app"})]})}:{children:d.jsxs(EW,{children:[d.jsx(Fo,{children:d.jsxs("div",{children:[d.jsx(ec,{success:u,fail:!!o}),d.jsx(o0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(ya,{children:[d.jsx(un,{children:o?o.message:"Requesting signer from Farcaster"}),d.jsx(dn,{children:o?o.detail:"This should only take a moment"}),d.jsx(rc,{children:m&&cs&&d.jsx(Nre,{text:"Take me to Warpcast",url:m,color:xW})})]})]})}),d.jsx($r,{})]}:{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:s},"header"),d.jsx(Qr,{}),d.jsx(EW,{children:d.jsxs("div",{children:[d.jsx(un,{children:"Add a signer to Farcaster"}),d.jsxs(dn,{children:["This will allow ",n.name," to add casts, likes, follows, and more on your behalf."]}),d.jsx(pN,{children:(g==null?void 0:g.status)==="pending_approval"?d.jsx(n7,{url:g.signer_approval_url,size:275,squareLogoElement:o0}):d.jsx(nl,{})}),d.jsxs(rc,{children:[d.jsx(dn,{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(Q_,{text:g.signer_approval_url,itemName:"link",color:xW})]})]})}),d.jsx($r,{})]})};let EW=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;"]),vKe=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 Bo({title:t}){var o,a;let{currentScreen:e,navigateBack:r,navigate:n,data:i,setModalData:s}=vt();return d.jsx(ft,{title:t,backFn:e===ye.FUNDING_MANUAL_TRANSFER_SCREEN?r:e===((o=i==null?void 0:i.funding)==null?void 0:o.methodScreen)?i.funding.comingFromSendTransactionScreen?()=>n(ye.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN):void 0:(a=i==null?void 0:i.funding)!=null&&a.methodScreen?()=>{let l=i.funding;l.usingDefaultFundingMethod&&(l.usingDefaultFundingMethod=!1),s({funding:l}),n(l.methodScreen)}:void 0})}const om=({size:t})=>d.jsx(wKe,{$size:t,children:d.jsxs(bKe,{children:[d.jsx(_Ke,{}),d.jsx(xKe,{})]})});let wKe=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"),bKe=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;"]),_Ke=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%;}"]),xKe=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 Kre=({enabled:t=!0}={})=>{let{showFiatPrices:e,getUsdPriceForSol:r}=xt(),[n,i]=T.useState(!0),[s,o]=T.useState(void 0),[a,l]=T.useState(void 0);return T.useEffect(()=>{(async()=>{if(e&&t)try{i(!0);let c=await r();c?l(c):o(Error("Unable to fetch SOL price"))}catch(c){o(c)}finally{i(!1)}else i(!1)})()},[]),{solPrice:a,isSolPriceLoading:n,solPriceError:s}};function am(t){let{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}=(a=>{let{showFiatPrices:l,getUsdTokenPrice:c,chains:u}=xt(),[f,h]=T.useState(!0),[g,m]=T.useState(void 0),[w,E]=T.useState(void 0);return T.useEffect(()=>{a||(a=Q2);let v=nN(u).find(_=>_.id===Number(a));(async()=>{if(l){if(!v)return h(!1),void m(Error(`Unable to fetch token price on chain id ${a}`));try{h(!0);let _=await c(v);_?E(_):m(Error(`Unable to fetch token price on chain id ${v.id}`))}catch(_){m(_)}finally{h(!1)}}else h(!1)})()},[a]),{tokenPrice:w,isTokenPriceLoading:f,tokenPriceError:g}})(t==="solana"?-1:t),{solPrice:i,isSolPriceLoading:s,solPriceError:o}=Kre({enabled:t==="solana"});return t==="solana"?{tokenPrice:i,isTokenPriceLoading:s,tokenPriceError:o}:{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}}const Yre=T.createContext(null);function lp(){let t=T.useContext(Yre);return t===null?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):t}const Sd="sdk_fiat_on_ramp_completed_with_status";let CW="0x0000000000000000000000000000000000000000";const hv=({destinationCurrency:t,...e})=>({tradeType:"EXACT_OUTPUT",originCurrency:CW,destinationCurrency:t??CW,...e}),pv=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},p4=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}},EKe=(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 CKe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function Pf(t,e=6,r=!1,n=!1){let i=(parseFloat(t.toString())/1e9).toFixed(e).replace(/0+$/,"").replace(/\.$/,""),s=n?"":" SOL";return r?`${i}${s}`:`${i==="0"?"<0.001":i}${s}`}function a0(t,e){let r=parseFloat(t.toString())/1e9,n=CKe.format(e*r);return n==="$0.00"?"<$0.01":n}function Zre({amount:t,fee:e,tokenPrice:r}){let n=BigInt(1e9*parseFloat(t)),i=n+e;return{fundingAmountInBaseUnit:n,fundingAmountInUsd:r?a0(n,r):void 0,totalPriceInUsd:r?a0(i,r):void 0,totalPriceInNativeCurrency:Pf(i),feePriceInNativeCurrency:Pf(e),feePriceInUsd:r?a0(e,r):void 0}}function lh(t){return"version"in t}function hC(t,e,r=0){var s,o,a;let n=e==="from"?0:e==="to"?1:2;if(lh(t)){let l=t.message.getAccountKeys(),c=(s=t.message.compiledInstructions.at(r))==null?void 0:s.accountKeyIndexes[n];return c&&l.get(c)||null}let i=(a=(o=t.instructions.at(r))==null?void 0:o.keys.at(n))==null?void 0:a.pubkey;if(i==null)throw Error(`Transaction does not contain a "${e}" public key`);return i}function AKe(t,e=!1,r=0){var s,o;let n=e?1:4;if(lh(t)){let a=(s=t.message.compiledInstructions.at(r))==null?void 0:s.data;if(!a)return 0n;try{return EKe(Buffer.from(a),n)}catch{return 0n}}let i=(o=t.instructions.at(r))==null?void 0:o.data.readBigInt64LE(n);return i??0n}function SKe(t,e){if(lh(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 IKe(t,e=0){var n,i,s;let r;if(lh(t)){let o=(n=t.message.compiledInstructions.at(e))==null?void 0:n.programIdIndex;if(o==null)throw Error("Transaction does not contain a Program ID");r=(i=t.message.getAccountKeys().get(o))==null?void 0:i.toBase58()}else r=(s=t.instructions.at(e))==null?void 0:s.programId.toBase58();if(!r)throw Error("Transaction does not contain a Program ID");return r==="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"?"approve":r==="11111111111111111111111111111111"?"transfer":"instruction"}async function TKe(t,e){return lh(t)?(await e.getFeeForMessage(t.message)).value:await t.getEstimatedFee(e)}function Jre(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 Qre(t,e){let r=[],n=lh(t)?t.message.compiledInstructions.length:t.instructions.length,i={},s=BigInt(await TKe(t,e)||0);for(let o=0;o=u})}return{fees:s,instructions:r}}const Xre=({chains:t,appId:e,address:r,rpcConfig:n})=>Promise.all(t.map(async i=>({balance:await Xl({chain:i,transport:Ql(Lf(i,n,e))}).getBalance({address:r}).catch(()=>0n),chain:i})));let ene=T.createContext({plugins:{current:{}}});const $Ke=({children:t})=>{let e=T.useRef({});return d.jsx(ene.Provider,{value:{plugins:e},children:t})},Aw=()=>{let{plugins:t}=T.useContext(ene);return T.useCallback(e=>t.current[e],[t])},Sw=Symbol("solana-funding-plugin"),Iw=fe.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),qr=fe.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]),zr=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;"]),kKe=fe(zr).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),on=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;",""],wee);function NKe({title:t,titleId:e,...r},n){return T.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?T.createElement("title",{id:e},t):null,T.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 tne=T.forwardRef(NKe),PKe=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"})]})]})})]})})}),RKe=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"})]}),MKe=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"})]}),OKe=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"})]}),jKe=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)"})})})]}),DKe=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"})]}),LKe=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"})]}),FKe=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"})]}),UKe=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_)"})]}),BKe=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 WKe={[eh.id]:PKe,[Gk.id]:RKe,[$d.id]:MKe,[Kk.id]:OKe,[cX.id]:jKe,[fu.id]:DKe,[J0.id]:LKe,[kd.id]:FKe,[hX.id]:BKe};const rne=({chainId:t,...e})=>{if(t==="solana")return d.jsx(UKe,{...e});let r=WKe[t];return d.jsx(r||tne,{...e})},zKe=({balance:t,className:e,chain:r})=>d.jsx(UN,{className:e,$state:void 0,children:d.jsx(YI,{balance:t,chain:r})}),YI=({balance:t,chain:e})=>d.jsxs(d.Fragment,{children:[d.jsxs(HKe,{children:[d.jsx(VKe,{chainId:"id"in e?e.id:"solana"}),d.jsx(on,{children:e.name})]}),d.jsxs(nc,{isLoading:!1,isPulsing:!1,color:"gray",children:[d.jsx(qKe,{children:d.jsx(ow,{})}),t]})]});let HKe=fe.div.withConfig({displayName:"Container",componentId:"sc-6d3c340d-0"})(["display:flex;align-items:center;"]),qKe=fe.div.withConfig({displayName:"IconContainer",componentId:"sc-6d3c340d-1"})(["height:0.75rem;width:0.75rem;margin-right:0.2rem;"]),VKe=fe(rne).withConfig({displayName:"StyledNetworkIcon",componentId:"sc-6d3c340d-2"})(["height:1.25rem;width:1.25rem;display:inline-block;margin-right:0.5rem;border-radius:4px;"]);const nne=typeof document<"u"?It.useLayoutEffect:()=>{};function GKe(t){const e=T.useRef(null);return nne(()=>{e.current=t},[t]),T.useCallback((...r)=>{const n=e.current;return n==null?void 0:n(...r)},[])}const Tw=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},Yh=t=>t&&"window"in t&&t.window===t?t:Tw(t).defaultView||window;function KKe(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 YKe(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 ine(t){let e=null;return()=>(e==null&&(e=t()),e)}const ZKe=ine(function(){return YKe(/^Mac/i)}),JKe=ine(function(){return KKe(/Android/i)});function QKe(t){return t.mozInputSource===0&&t.isTrusted?!0:JKe()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}class XKe{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 sne(t){let e=T.useRef({isFocused:!1,observer:null});nne(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=GKe(n=>{t==null||t(n)});return T.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,s=o=>{e.current.isFocused=!1,i.disabled&&r(new XKe("blur",o)),e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",s,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){var o;(o=e.current.observer)===null||o===void 0||o.disconnect();let a=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),e.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[r])}function eYe(t){let{isDisabled:e,onFocus:r,onBlur:n,onFocusChange:i}=t;const s=T.useCallback(l=>{if(l.target===l.currentTarget)return n&&n(l),i&&i(!1),!0},[n,i]),o=sne(s),a=T.useCallback(l=>{const c=Tw(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(r&&r(l),i&&i(!0),o(l))},[i,r,o]);return{focusProps:{onFocus:!e&&(r||i||n)?a:void 0,onBlur:!e&&(n||i)?s:void 0}}}let $w=null,ZI=new Set,t2=new Map,O0=!1,JI=!1;const tYe={Tab:!0,Escape:!0};function rP(t,e){for(let r of ZI)r(t,e)}function rYe(t){return!(t.metaKey||!ZKe()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function g4(t){O0=!0,rYe(t)&&($w="keyboard",rP("keyboard",t))}function Ga(t){$w="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(O0=!0,rP("pointer",t))}function one(t){QKe(t)&&(O0=!0,$w="virtual")}function ane(t){t.target===window||t.target===document||(!O0&&!JI&&($w="virtual",rP("virtual",t)),O0=!1,JI=!1)}function lne(){O0=!1,JI=!0}function QI(t){if(typeof window>"u"||t2.get(Yh(t)))return;const e=Yh(t),r=Tw(t);let n=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){O0=!0,n.apply(this,arguments)},r.addEventListener("keydown",g4,!0),r.addEventListener("keyup",g4,!0),r.addEventListener("click",one,!0),e.addEventListener("focus",ane,!0),e.addEventListener("blur",lne,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",Ga,!0),r.addEventListener("pointermove",Ga,!0),r.addEventListener("pointerup",Ga,!0)):(r.addEventListener("mousedown",Ga,!0),r.addEventListener("mousemove",Ga,!0),r.addEventListener("mouseup",Ga,!0)),e.addEventListener("beforeunload",()=>{cne(t)},{once:!0}),t2.set(e,{focus:n})}const cne=(t,e)=>{const r=Yh(t),n=Tw(t);e&&n.removeEventListener("DOMContentLoaded",e),t2.has(r)&&(r.HTMLElement.prototype.focus=t2.get(r).focus,n.removeEventListener("keydown",g4,!0),n.removeEventListener("keyup",g4,!0),n.removeEventListener("click",one,!0),r.removeEventListener("focus",ane,!0),r.removeEventListener("blur",lne,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",Ga,!0),n.removeEventListener("pointermove",Ga,!0),n.removeEventListener("pointerup",Ga,!0)):(n.removeEventListener("mousedown",Ga,!0),n.removeEventListener("mousemove",Ga,!0),n.removeEventListener("mouseup",Ga,!0)),t2.delete(r))};function nYe(t){const e=Tw(t);let r;return e.readyState!=="loading"?QI(t):(r=()=>{QI(t)},e.addEventListener("DOMContentLoaded",r)),()=>cne(t,r)}typeof document<"u"&&nYe();function une(){return $w!=="pointer"}const iYe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function sYe(t,e,r){var n;const i=typeof window<"u"?Yh(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Yh(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,o=typeof window<"u"?Yh(r==null?void 0:r.target).HTMLElement:HTMLElement,a=typeof window<"u"?Yh(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return t=t||(r==null?void 0:r.target)instanceof i&&!iYe.has(r==null||(n=r.target)===null||n===void 0?void 0:n.type)||(r==null?void 0:r.target)instanceof s||(r==null?void 0:r.target)instanceof o&&(r==null?void 0:r.target.isContentEditable),!(t&&e==="keyboard"&&r instanceof a&&!tYe[r.key])}function oYe(t,e,r){QI(),T.useEffect(()=>{let n=(i,s)=>{sYe(!!(r!=null&&r.isTextInput),i,s)&&t(une())};return ZI.add(n),()=>{ZI.delete(n)}},e)}function aYe(t){let{isDisabled:e,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=t,s=T.useRef({isFocusWithin:!1}),o=T.useCallback(c=>{s.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(s.current.isFocusWithin=!1,r&&r(c),i&&i(!1))},[r,i,s]),a=sne(o),l=T.useCallback(c=>{!s.current.isFocusWithin&&document.activeElement===c.target&&(n&&n(c),i&&i(!0),s.current.isFocusWithin=!0,a(c))},[n,i,a]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:o}}}let m4=!1,pC=0;function XI(){m4=!0,setTimeout(()=>{m4=!1},50)}function AW(t){t.pointerType==="touch"&&XI()}function lYe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",AW):document.addEventListener("touchend",XI),pC++,()=>{pC--,!(pC>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",AW):document.removeEventListener("touchend",XI))}}function cYe(t){let{onHoverStart:e,onHoverChange:r,onHoverEnd:n,isDisabled:i}=t,[s,o]=T.useState(!1),a=T.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;T.useEffect(lYe,[]);let{hoverProps:l,triggerHoverEnd:c}=T.useMemo(()=>{let u=(g,m)=>{if(a.pointerType=m,i||m==="touch"||a.isHovered||!g.currentTarget.contains(g.target))return;a.isHovered=!0;let w=g.currentTarget;a.target=w,e&&e({type:"hoverstart",target:w,pointerType:m}),r&&r(!0),o(!0)},f=(g,m)=>{if(a.pointerType="",a.target=null,m==="touch"||!a.isHovered)return;a.isHovered=!1;let w=g.currentTarget;n&&n({type:"hoverend",target:w,pointerType:m}),r&&r(!1),o(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=g=>{m4&&g.pointerType==="mouse"||u(g,g.pointerType)},h.onPointerLeave=g=>{!i&&g.currentTarget.contains(g.target)&&f(g,g.pointerType)}):(h.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=g=>{!a.ignoreEmulatedMouseEvents&&!m4&&u(g,"mouse"),a.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=g=>{!i&&g.currentTarget.contains(g.target)&&f(g,"mouse")}),{hoverProps:h,triggerHoverEnd:f}},[e,r,n,i,a]);return T.useEffect(()=>{i&&c({currentTarget:a.target},a.pointerType)},[i]),{hoverProps:l,isHovered:s}}function uYe(t={}){let{autoFocus:e=!1,isTextInput:r,within:n}=t,i=T.useRef({isFocused:!1,isFocusVisible:e||une()}),[s,o]=T.useState(!1),[a,l]=T.useState(()=>i.current.isFocused&&i.current.isFocusVisible),c=T.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),u=T.useCallback(g=>{i.current.isFocused=g,o(g),c()},[c]);oYe(g=>{i.current.isFocusVisible=g,c()},[],{isTextInput:r});let{focusProps:f}=eYe({isDisabled:n,onFocusChange:u}),{focusWithinProps:h}=aYe({isDisabled:!n,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:a,focusProps:n?h:f}}var dYe=Object.defineProperty,fYe=(t,e,r)=>e in t?dYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gC=(t,e,r)=>(fYe(t,typeof e!="symbol"?e+"":e,r),r);let hYe=class{constructor(){gC(this,"current",this.detect()),gC(this,"handoffState","pending"),gC(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"}},l0=new hYe;function cp(t){return l0.isServer?null:t instanceof Node?t.ownerDocument:t!=null&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function i7(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function gu(){let t=[],e={addEventListener(r,n,i,s){return r.addEventListener(n,i,s),e.add(()=>r.removeEventListener(n,i,s))},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 i7(()=>{n.current&&r[0]()}),e.add(()=>{n.current=!1})},style(r,n,i){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:s})})},group(r){let n=gu();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 lm(){let[t]=T.useState(gu);return T.useEffect(()=>()=>t.dispose(),[t]),t}let vn=(t,e)=>{l0.isServer?T.useEffect(t,e):T.useLayoutEffect(t,e)};function up(t){let e=T.useRef(t);return vn(()=>{e.current=t},[t]),e}let pr=function(t){let e=up(t);return It.useCallback((...r)=>e.current(...r),[e])};function pYe(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 gYe(t,e){return!(!t||!e||t.righte.right||t.bottome.bottom)}function mYe({disabled:t=!1}={}){let e=T.useRef(null),[r,n]=T.useState(!1),i=lm(),s=pr(()=>{e.current=null,n(!1),i.dispose()}),o=pr(a=>{if(i.dispose(),e.current===null){e.current=a.currentTarget,n(!0);{let l=cp(a.currentTarget);i.addEventListener(l,"pointerup",s,!1),i.addEventListener(l,"pointermove",c=>{if(e.current){let u=pYe(c);n(gYe(u,e.current.getBoundingClientRect()))}},!1),i.addEventListener(l,"pointercancel",s,!1)}}});return{pressed:r,pressProps:t?{}:{onPointerDown:o,onPointerUp:s,onClick:s}}}let yYe=T.createContext(void 0);function dne(){return T.useContext(yYe)}function eT(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function ou(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,ou),n}var Eg=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(Eg||{}),bf=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(bf||{});function bi(){let t=wYe();return T.useCallback(e=>vYe({mergeRefs:t,...e}),[t])}function vYe({ourProps:t,theirProps:e,slot:r,defaultTag:n,features:i,visible:s=!0,name:o,mergeRefs:a}){a=a??bYe;let l=fne(e,t);if(s)return Ub(l,r,n,o,a);let c=i??0;if(c&2){let{static:u=!1,...f}=l;if(u)return Ub(f,r,n,o,a)}if(c&1){let{unmount:u=!0,...f}=l;return ou(u?0:1,{0(){return null},1(){return Ub({...f,hidden:!0,style:{display:"none"}},r,n,o,a)}})}return Ub(l,r,n,o,a)}function Ub(t,e={},r,n,i){let{as:s=r,children:o,refName:a="ref",...l}=mC(t,["unmount","static"]),c=t.ref!==void 0?{[a]:t.ref}:{},u=typeof o=="function"?o(e):o;"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,E=>`-${E.toLowerCase()}`));if(h){f["data-headlessui-state"]=g.join(" ");for(let m of g)f[`data-${m}`]=""}}if(s===T.Fragment&&(Object.keys(Rh(l)).length>0||Object.keys(Rh(f)).length>0))if(!T.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(Rh(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(Rh(l)).concat(Object.keys(Rh(f))).map(h=>` - ${h}`).join(` +`);const a=XKe(e,r,i),o=lx.getSymbolSize(e),l=new WKe(o);return KKe(l,e),YKe(l),ZKe(l,e),yC(l,r,0),e>=7&&JKe(l,e),QKe(l,a),isNaN(n)&&(n=XI.getBestMask(l,yC.bind(null,l,r))),XI.applyMask(n,l),yC(l,r,n),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}nne.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=gC.M,i,s;return typeof r<"u"&&(n=gC.from(r.errorCorrectionLevel,gC.M),i=v6.from(r.version),s=XI.from(r.maskPattern),r.toSJISFunc&&lx.setToSJISFunction(r.toSJISFunc)),tYe(e,i,n,s)};var mne={},dP={};(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(s){return[s,s]}))),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,s=n.width&&n.width>=21?n.width:void 0,a=n.scale||4;return{width:s,scale:s?4:a,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 s=t.getScale(n,i);return Math.floor((n+i.margin*2)*s)},t.qrToImageData=function(n,i,s){const a=i.modules.size,o=i.modules.data,l=t.getScale(a,s),c=Math.floor((a+s.margin*2)*l),u=s.margin*l,f=[s.color.light,s.color.dark];for(let h=0;h=u&&g>=u&&h"u"&&(!a||!a.getContext)&&(l=a,a=void 0),a||(c=n()),l=e.getOptions(l);const u=e.getImageWidth(s.modules.size,l),f=c.getContext("2d"),h=f.createImageData(u,u);return e.qrToImageData(h.data,s,l),r(f,c,u),f.putImageData(h,0,0),c},t.renderToDataURL=function(s,a,o){let l=o;typeof l>"u"&&(!a||!a.getContext)&&(l=a,a=void 0),l||(l={});const c=t.render(s,a,l),u=l.type||"image/png",f=l.rendererOpts||{};return c.toDataURL(u,f.quality)}})(mne);var yne={};const rYe=dP;function DW(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function vC(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function nYe(t,e,r){let n="",i=0,s=!1,a=0;for(let o=0;o0&&l>0&&t[o-1]||(n+=s?vC("M",l+r,.5+c+r):vC("m",i,0),i=0,s=!1),l+1':"",c="',u='viewBox="0 0 '+o+" "+o+'"',h=''+l+c+` +`;return typeof n=="function"&&n(null,h),h};const iYe=wKe,tT=nne,vne=mne,sYe=yne;function fP(t,e,r,n,i){const s=[].slice.call(arguments,1),a=s.length,o=typeof s[a-1]=="function";if(!o&&!iYe())throw new Error("Callback required as last argument");if(o){if(a<2)throw new Error("Too few arguments provided");a===2?(i=r,r=e,e=n=void 0):a===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(r=e,e=n=void 0):a===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(l,c){try{const u=tT.create(r,n);l(t(u,e,n))}catch(u){c(u)}})}try{const l=tT.create(r,n);i(null,t(l,e,n))}catch(l){i(l)}}Sw.create=tT.create;Sw.toCanvas=fP.bind(null,vne.render);Sw.toDataURL=fP.bind(null,vne.renderToDataURL);Sw.toString=fP.bind(null,function(t,e,r){return sYe.render(t,r)});const aYe=()=>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 wC=(t,e,r,n,i)=>{for(let s=e;s{let r=Sw.create(t,{errorCorrectionLevel:e}).modules,n=UCe(Array.from(r.data),r.size);return n=wC(n,0,0,7,7),n=wC(n,n.length-7,0,7,7),wC(n,0,n.length-7,7,7)},lYe=({x:t,y:e,cellSize:r,bgColor:n,fgColor:i})=>d.jsx(d.Fragment,{children:[0,1,2].map(s=>d.jsx("circle",{r:r*(7-2*s)/2,cx:t+7*r/2,cy:e+7*r/2,fill:s%2!=0?n:i},`finder-${t}-${e}-${s}`))}),cYe=({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,s])=>d.jsx(lYe,{x:i,y:s,cellSize:t,bgColor:r,fgColor:n},`finder-${i}-${s}`))}),uYe=({matrix:t,cellSize:e,color:r})=>d.jsx(d.Fragment,{children:t.map((n,i)=>n.map((s,a)=>s?d.jsx("rect",{height:e-.4,width:e-.4,x:i*e+.1*e,y:a*e+.1*e,rx:.5*e,ry:.5*e,fill:r},`cell-${i}-${a}`):d.jsx(It.Fragment,{},`circle-${i}-${a}`)))}),dYe=({cellSize:t,matrixSize:e,element:r,sizePercentage:n,bgColor:i})=>{if(!r)return d.jsx(d.Fragment,{});let s=e*(n||.14),a=Math.floor(e/2-s/2),o=Math.floor(e/2+s/2);(o-a)%2!=e%2&&(o+=1);let l=(o-a)*t,c=l-.2*l,u=a*t;return d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:a*t,y:a*t,width:l,height:l,fill:i}),d.jsx(r,{x:u+.1*l,y:u+.1*l,height:c,width:c})]})},fYe=t=>{var s;let e=t.outputSize,r=oYe(t.url,t.errorCorrectionLevel),n=e/r.length,i=VCe(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(uYe,{matrix:r,cellSize:n,color:t.fgColor}),d.jsx(cYe,{cellSize:n,matrixSize:r.length,fgColor:t.fgColor,bgColor:t.bgColor}),d.jsx(dYe,{cellSize:n,element:(s=t.logo)==null?void 0:s.element,bgColor:t.bgColor,matrixSize:r.length})]})},hYe=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 cx=t=>{let{appearance:e}=wi(),r=t.bgColor||"#FFFFFF",n=t.fgColor||"#000000",i=t.size||160,s=e.palette.colorScheme==="dark"?r:n;return d.jsx(hYe,{$size:i,$bgColor:r,$fgColor:n,$borderColor:s,children:d.jsx(fYe,{url:t.url,logo:{element:t.squareLogoElement??aYe},outputSize:i,bgColor:r,fgColor:n,errorCorrectionLevel:t.errorCorrectionLevel||"Q"})})},u0=({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 FW="#8a63d2";const pYe=()=>{let{authenticated:t,logout:e,ready:r,user:n}=Pr(),{lastScreen:i,navigate:s,navigateBack:a,setModalData:o,app:l}=vt(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:f,createAnalyticsEvent:h}=xt(),[g,m]=I.useState(void 0),[w,E]=I.useState(!1),[v,_]=I.useState(!1),A=I.useRef([]),C=c(),R=C==null?void 0:C.meta.connectUri;return I.useEffect(()=>{let B=Date.now(),S=setInterval(async()=>{var ae,K,N,k,b,x,P,D,O,j,T,L,M,X,le;let U=await C.pollForReady.execute(),G=Date.now()-B;if(U){clearInterval(S),E(!0);try{await u(),_(!0)}catch(H){let ee={retryable:!1,message:"Authentication failed"};if((H==null?void 0:H.privyErrorCode)===Se.ALLOWLIST_REJECTED)return void s(ye.ALLOWLIST_REJECTION_SCREEN);if((H==null?void 0:H.privyErrorCode)===Se.USER_LIMIT_REACHED)return console.error(new Yv(H).toString()),void s(ye.USER_LIMIT_REACHED_SCREEN);if((H==null?void 0:H.privyErrorCode)===Se.USER_DOES_NOT_EXIST)return void s(ye.ACCOUNT_NOT_FOUND_SCREEN);if((H==null?void 0:H.privyErrorCode)===Se.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)===Se.ACCOUNT_TRANSFER_REQUIRED&&((K=(ae=H.data)==null?void 0:ae.data)!=null&&K.nonce))return o({accountTransfer:{nonce:(k=(N=H.data)==null?void 0:N.data)==null?void 0:k.nonce,account:(x=(b=H.data)==null?void 0:b.data)==null?void 0:x.subject,displayName:(O=(D=(P=H.data)==null?void 0:P.data)==null?void 0:D.account)==null?void 0:O.displayName,linkMethod:"farcaster",embeddedWalletAddress:(L=(T=(j=H.data)==null?void 0:j.data)==null?void 0:T.otherUser)==null?void 0:L.embeddedWalletAddress,farcasterEmbeddedAddress:(le=(X=(M=H.data)==null?void 0:M.data)==null?void 0:X.otherUser)==null?void 0:le.farcasterEmbeddedAddress}}),void s(ye.LINK_CONFLICT_SCREEN);(H==null?void 0:H.privyErrorCode)===Se.INVALID_CREDENTIALS?(ee.retryable=!0,ee.detail="Something went wrong. Try again."):(H==null?void 0:H.privyErrorCode)===Se.TOO_MANY_REQUESTS&&(ee.detail="Too many requests. Please wait before trying again.")}m(ee)}}else G>12e4&&(clearInterval(S),m({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},2e3);return()=>{clearInterval(S),A.current.forEach(U=>clearTimeout(U))}},[]),I.useEffect(()=>{if(r&&t&&v&&n){if(l!=null&&l.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let B=setTimeout(()=>{s(ye.AFFIRMATIVE_CONSENT_SCREEN)},Mn);return()=>clearTimeout(B)}v&&(_d(n,l==null?void 0:l.embeddedWallets.createOnLogin)?A.current.push(setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:B=>{console.error(B),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:B,screen:"FarcasterConnectStatusScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),s(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Mn)):A.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Mn)))}},[v,r,t,n]),d.jsxs(d.Fragment,cs||w?{children:[d.jsx(ft,{backFn:i?a:void 0,onClose:f},"header"),d.jsx(Qr,{}),d.jsx(d.Fragment,V$?{children:d.jsxs(gYe,{children:[d.jsx(Da,{children:d.jsxs("div",{children:[d.jsx(ec,{success:v,fail:!!g}),d.jsx(u0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(yo,{children:[d.jsx(un,{children:g?g.message:"Sign in with Farcaster"}),d.jsx(dn,{children:g?g.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),R&&d.jsx(Dt,{onClick:B=>{B.preventDefault(),window.location.href=R},children:"Open Warpcast app"})]})}:{children:d.jsxs(UW,{children:[d.jsx(Da,{children:d.jsxs("div",{children:[d.jsx(ec,{success:v,fail:!!g}),d.jsx(u0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(yo,{children:[d.jsx(un,{children:g?g.message:"Signing in with Farcaster"}),d.jsx(dn,{children:g?g.detail:"This should only take a moment"}),d.jsx(rc,{children:R&&cs&&d.jsx(rne,{text:"Take me to Warpcast",url:R,color:FW})})]})]})}),d.jsx($r,{})]}:{children:[d.jsx(ft,{backFn:i?a:void 0,onClose:f},"header"),d.jsx(Qr,{}),d.jsx(UW,{children:d.jsxs("div",{children:[d.jsx(un,{children:"Sign in with Farcaster"}),d.jsx(dn,{children:"Scan with your phone's camera to continue."}),d.jsx(AN,{children:R?d.jsx(cx,{url:R,size:275,squareLogoElement:u0}):d.jsx(nl,{})}),d.jsxs(rc,{children:[d.jsx(dn,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),R&&d.jsx(ix,{text:R,itemName:"link",color:FW})]})]})}),d.jsx($r,{})]})};let UW=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;"]),gYe=fe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-5a361367-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),BW="#8a63d2";const mYe=()=>{let{lastScreen:t,navigateBack:e,data:r,app:n}=vt(),{requestFarcasterSignerStatus:i,closePrivyModal:s}=xt(),[a,o]=I.useState(void 0),[l,c]=I.useState(!1),[u,f]=I.useState(!1),h=I.useRef([]),g=r==null?void 0:r.farcasterSigner;I.useEffect(()=>{let w=Date.now(),E=setInterval(async()=>{if(!(g!=null&&g.public_key))return clearInterval(E),void o({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});g.status==="approved"&&(clearInterval(E),c(!1),f(!0),h.current.push(setTimeout(()=>s({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Mn)));let v=await i(g==null?void 0:g.public_key),_=Date.now()-w;v.status==="approved"?(clearInterval(E),c(!1),f(!0),h.current.push(setTimeout(()=>s({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Mn))):_>3e5?(clearInterval(E),o({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):v.status==="revoked"&&(clearInterval(E),o({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},2e3);return()=>{clearInterval(E),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,cs||l?{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:s},"header"),d.jsx(Qr,{}),d.jsx(d.Fragment,V$?{children:d.jsxs(yYe,{children:[d.jsx(Da,{children:d.jsxs("div",{children:[d.jsx(ec,{success:u,fail:!!a}),d.jsx(u0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(yo,{children:[d.jsx(un,{children:a?a.message:"Add a signer to Farcaster"}),d.jsx(dn,{children:a?a.detail:"This will allow "+n.name+" to add casts, likes, follows, and more on your behalf."})]}),m&&d.jsx(Dt,{onClick:w=>{w.preventDefault(),window.location.href=m},children:"Open Warpcast app"})]})}:{children:d.jsxs(WW,{children:[d.jsx(Da,{children:d.jsxs("div",{children:[d.jsx(ec,{success:u,fail:!!a}),d.jsx(u0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(yo,{children:[d.jsx(un,{children:a?a.message:"Requesting signer from Farcaster"}),d.jsx(dn,{children:a?a.detail:"This should only take a moment"}),d.jsx(rc,{children:m&&cs&&d.jsx(rne,{text:"Take me to Warpcast",url:m,color:BW})})]})]})}),d.jsx($r,{})]}:{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:s},"header"),d.jsx(Qr,{}),d.jsx(WW,{children:d.jsxs("div",{children:[d.jsx(un,{children:"Add a signer to Farcaster"}),d.jsxs(dn,{children:["This will allow ",n.name," to add casts, likes, follows, and more on your behalf."]}),d.jsx(AN,{children:(g==null?void 0:g.status)==="pending_approval"?d.jsx(cx,{url:g.signer_approval_url,size:275,squareLogoElement:u0}):d.jsx(nl,{})}),d.jsxs(rc,{children:[d.jsx(dn,{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(ix,{text:g.signer_approval_url,itemName:"link",color:BW})]})]})}),d.jsx($r,{})]})};let WW=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;"]),yYe=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 Ua({title:t}){var a,o;let{currentScreen:e,navigateBack:r,navigate:n,data:i,setModalData:s}=vt();return d.jsx(ft,{title:t,backFn:e===ye.FUNDING_MANUAL_TRANSFER_SCREEN?r:e===((a=i==null?void 0:i.funding)==null?void 0:a.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),s({funding:l}),n(l.methodScreen)}:void 0})}const lm=({size:t})=>d.jsx(vYe,{$size:t,children:d.jsxs(wYe,{children:[d.jsx(bYe,{}),d.jsx(_Ye,{})]})});let vYe=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"),wYe=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;"]),bYe=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%;}"]),_Ye=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 wne=({enabled:t=!0}={})=>{let{showFiatPrices:e,getUsdPriceForSol:r}=xt(),[n,i]=I.useState(!0),[s,a]=I.useState(void 0),[o,l]=I.useState(void 0);return I.useEffect(()=>{(async()=>{if(e&&t)try{i(!0);let c=await r();c?l(c):a(Error("Unable to fetch SOL price"))}catch(c){a(c)}finally{i(!1)}else i(!1)})()},[]),{solPrice:o,isSolPriceLoading:n,solPriceError:s}};function cm(t){let{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}=(o=>{let{showFiatPrices:l,getUsdTokenPrice:c,chains:u}=xt(),[f,h]=I.useState(!0),[g,m]=I.useState(void 0),[w,E]=I.useState(void 0);return I.useEffect(()=>{o||(o=tv);let v=pN(u).find(_=>_.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 _=await c(v);_?E(_):m(Error(`Unable to fetch token price on chain id ${v.id}`))}catch(_){m(_)}finally{h(!1)}}else h(!1)})()},[o]),{tokenPrice:w,isTokenPriceLoading:f,tokenPriceError:g}})(t==="solana"?-1:t),{solPrice:i,isSolPriceLoading:s,solPriceError:a}=wne({enabled:t==="solana"});return t==="solana"?{tokenPrice:i,isTokenPriceLoading:s,tokenPriceError:a}:{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}}const bne=I.createContext(null);function dp(){let t=I.useContext(bne);return t===null?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):t}const Td="sdk_fiat_on_ramp_completed_with_status";let zW="0x0000000000000000000000000000000000000000";const mv=({destinationCurrency:t,...e})=>({tradeType:"EXACT_OUTPUT",originCurrency:zW,destinationCurrency:t??zW,...e}),yv=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},w6=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}},xYe=(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 EYe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function Mf(t,e=6,r=!1,n=!1){let i=(parseFloat(t.toString())/1e9).toFixed(e).replace(/0+$/,"").replace(/\.$/,""),s=n?"":" SOL";return r?`${i}${s}`:`${i==="0"?"<0.001":i}${s}`}function d0(t,e){let r=parseFloat(t.toString())/1e9,n=EYe.format(e*r);return n==="$0.00"?"<$0.01":n}function _ne({amount:t,fee:e,tokenPrice:r}){let n=BigInt(1e9*parseFloat(t)),i=n+e;return{fundingAmountInBaseUnit:n,fundingAmountInUsd:r?d0(n,r):void 0,totalPriceInUsd:r?d0(i,r):void 0,totalPriceInNativeCurrency:Mf(i),feePriceInNativeCurrency:Mf(e),feePriceInUsd:r?d0(e,r):void 0}}function dh(t){return"version"in t}function bC(t,e,r=0){var s,a,o;let n=e==="from"?0:e==="to"?1:2;if(dh(t)){let l=t.message.getAccountKeys(),c=(s=t.message.compiledInstructions.at(r))==null?void 0:s.accountKeyIndexes[n];return c&&l.get(c)||null}let i=(o=(a=t.instructions.at(r))==null?void 0:a.keys.at(n))==null?void 0:o.pubkey;if(i==null)throw Error(`Transaction does not contain a "${e}" public key`);return i}function CYe(t,e=!1,r=0){var s,a;let n=e?1:4;if(dh(t)){let o=(s=t.message.compiledInstructions.at(r))==null?void 0:s.data;if(!o)return 0n;try{return xYe(Buffer.from(o),n)}catch{return 0n}}let i=(a=t.instructions.at(r))==null?void 0:a.data.readBigInt64LE(n);return i??0n}function AYe(t,e){if(dh(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 SYe(t,e=0){var n,i,s;let r;if(dh(t)){let a=(n=t.message.compiledInstructions.at(e))==null?void 0:n.programIdIndex;if(a==null)throw Error("Transaction does not contain a Program ID");r=(i=t.message.getAccountKeys().get(a))==null?void 0:i.toBase58()}else r=(s=t.instructions.at(e))==null?void 0:s.programId.toBase58();if(!r)throw Error("Transaction does not contain a Program ID");return r==="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"?"approve":r==="11111111111111111111111111111111"?"transfer":"instruction"}async function IYe(t,e){return dh(t)?(await e.getFeeForMessage(t.message)).value:await t.getEstimatedFee(e)}function xne(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 Ene(t,e){let r=[],n=dh(t)?t.message.compiledInstructions.length:t.instructions.length,i={},s=BigInt(await IYe(t,e)||0);for(let a=0;a=u})}return{fees:s,instructions:r}}const Cne=({chains:t,appId:e,address:r,rpcConfig:n})=>Promise.all(t.map(async i=>({balance:await Xl({chain:i,transport:Ql(Bf(i,n,e))}).getBalance({address:r}).catch(()=>0n),chain:i})));let Ane=I.createContext({plugins:{current:{}}});const TYe=({children:t})=>{let e=I.useRef({});return d.jsx(Ane.Provider,{value:{plugins:e},children:t})},Tw=()=>{let{plugins:t}=I.useContext(Ane);return I.useCallback(e=>t.current[e],[t])},$w=Symbol("solana-funding-plugin"),kw=fe.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),qr=fe.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]),zr=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;"]),$Ye=fe(zr).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),an=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;",""],Hee);function kYe({title:t,titleId:e,...r},n){return I.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?I.createElement("title",{id:e},t):null,I.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 Sne=I.forwardRef(kYe),NYe=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"})]})]})})]})})}),PYe=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"})]}),RYe=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"})]}),MYe=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"})]}),OYe=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)"})})})]}),jYe=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"})]}),LYe=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"})]}),DYe=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"})]}),FYe=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_)"})]}),UYe=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 BYe={[nh.id]:NYe,[iN.id]:PYe,[Nd.id]:RYe,[sN.id]:MYe,[MX.id]:OYe,[pu.id]:jYe,[ep.id]:LYe,[Pd.id]:DYe,[DX.id]:UYe};const Ine=({chainId:t,...e})=>{if(t==="solana")return d.jsx(FYe,{...e});let r=BYe[t];return d.jsx(r||Sne,{...e})},WYe=({balance:t,className:e,chain:r})=>d.jsx(JN,{className:e,$state:void 0,children:d.jsx(rT,{balance:t,chain:r})}),rT=({balance:t,chain:e})=>d.jsxs(d.Fragment,{children:[d.jsxs(zYe,{children:[d.jsx(qYe,{chainId:"id"in e?e.id:"solana"}),d.jsx(an,{children:e.name})]}),d.jsxs(nc,{isLoading:!1,isPulsing:!1,color:"gray",children:[d.jsx(HYe,{children:d.jsx(cw,{})}),t]})]});let zYe=fe.div.withConfig({displayName:"Container",componentId:"sc-6d3c340d-0"})(["display:flex;align-items:center;"]),HYe=fe.div.withConfig({displayName:"IconContainer",componentId:"sc-6d3c340d-1"})(["height:0.75rem;width:0.75rem;margin-right:0.2rem;"]),qYe=fe(Ine).withConfig({displayName:"StyledNetworkIcon",componentId:"sc-6d3c340d-2"})(["height:1.25rem;width:1.25rem;display:inline-block;margin-right:0.5rem;border-radius:4px;"]);const Tne=typeof document<"u"?It.useLayoutEffect:()=>{};function VYe(t){const e=I.useRef(null);return Tne(()=>{e.current=t},[t]),I.useCallback((...r)=>{const n=e.current;return n==null?void 0:n(...r)},[])}const Nw=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},Xh=t=>t&&"window"in t&&t.window===t?t:Nw(t).defaultView||window;function GYe(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 KYe(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 $ne(t){let e=null;return()=>(e==null&&(e=t()),e)}const YYe=$ne(function(){return KYe(/^Mac/i)}),ZYe=$ne(function(){return GYe(/Android/i)});function JYe(t){return t.mozInputSource===0&&t.isTrusted?!0:ZYe()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}class QYe{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 kne(t){let e=I.useRef({isFocused:!1,observer:null});Tne(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=VYe(n=>{t==null||t(n)});return I.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,s=a=>{e.current.isFocused=!1,i.disabled&&r(new QYe("blur",a)),e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",s,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){var a;(a=e.current.observer)===null||a===void 0||a.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 XYe(t){let{isDisabled:e,onFocus:r,onBlur:n,onFocusChange:i}=t;const s=I.useCallback(l=>{if(l.target===l.currentTarget)return n&&n(l),i&&i(!1),!0},[n,i]),a=kne(s),o=I.useCallback(l=>{const c=Nw(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(r&&r(l),i&&i(!0),a(l))},[i,r,a]);return{focusProps:{onFocus:!e&&(r||i||n)?o:void 0,onBlur:!e&&(n||i)?s:void 0}}}let Pw=null,nT=new Set,n2=new Map,D0=!1,iT=!1;const eZe={Tab:!0,Escape:!0};function hP(t,e){for(let r of nT)r(t,e)}function tZe(t){return!(t.metaKey||!YYe()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function b6(t){D0=!0,tZe(t)&&(Pw="keyboard",hP("keyboard",t))}function Go(t){Pw="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(D0=!0,hP("pointer",t))}function Nne(t){JYe(t)&&(D0=!0,Pw="virtual")}function Pne(t){t.target===window||t.target===document||(!D0&&!iT&&(Pw="virtual",hP("virtual",t)),D0=!1,iT=!1)}function Rne(){D0=!1,iT=!0}function sT(t){if(typeof window>"u"||n2.get(Xh(t)))return;const e=Xh(t),r=Nw(t);let n=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){D0=!0,n.apply(this,arguments)},r.addEventListener("keydown",b6,!0),r.addEventListener("keyup",b6,!0),r.addEventListener("click",Nne,!0),e.addEventListener("focus",Pne,!0),e.addEventListener("blur",Rne,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",Go,!0),r.addEventListener("pointermove",Go,!0),r.addEventListener("pointerup",Go,!0)):(r.addEventListener("mousedown",Go,!0),r.addEventListener("mousemove",Go,!0),r.addEventListener("mouseup",Go,!0)),e.addEventListener("beforeunload",()=>{Mne(t)},{once:!0}),n2.set(e,{focus:n})}const Mne=(t,e)=>{const r=Xh(t),n=Nw(t);e&&n.removeEventListener("DOMContentLoaded",e),n2.has(r)&&(r.HTMLElement.prototype.focus=n2.get(r).focus,n.removeEventListener("keydown",b6,!0),n.removeEventListener("keyup",b6,!0),n.removeEventListener("click",Nne,!0),r.removeEventListener("focus",Pne,!0),r.removeEventListener("blur",Rne,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",Go,!0),n.removeEventListener("pointermove",Go,!0),n.removeEventListener("pointerup",Go,!0)):(n.removeEventListener("mousedown",Go,!0),n.removeEventListener("mousemove",Go,!0),n.removeEventListener("mouseup",Go,!0)),n2.delete(r))};function rZe(t){const e=Nw(t);let r;return e.readyState!=="loading"?sT(t):(r=()=>{sT(t)},e.addEventListener("DOMContentLoaded",r)),()=>Mne(t,r)}typeof document<"u"&&rZe();function One(){return Pw!=="pointer"}const nZe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function iZe(t,e,r){var n;const i=typeof window<"u"?Xh(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Xh(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?Xh(r==null?void 0:r.target).HTMLElement:HTMLElement,o=typeof window<"u"?Xh(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return t=t||(r==null?void 0:r.target)instanceof i&&!nZe.has(r==null||(n=r.target)===null||n===void 0?void 0:n.type)||(r==null?void 0:r.target)instanceof s||(r==null?void 0:r.target)instanceof a&&(r==null?void 0:r.target.isContentEditable),!(t&&e==="keyboard"&&r instanceof o&&!eZe[r.key])}function sZe(t,e,r){sT(),I.useEffect(()=>{let n=(i,s)=>{iZe(!!(r!=null&&r.isTextInput),i,s)&&t(One())};return nT.add(n),()=>{nT.delete(n)}},e)}function aZe(t){let{isDisabled:e,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=t,s=I.useRef({isFocusWithin:!1}),a=I.useCallback(c=>{s.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(s.current.isFocusWithin=!1,r&&r(c),i&&i(!1))},[r,i,s]),o=kne(a),l=I.useCallback(c=>{!s.current.isFocusWithin&&document.activeElement===c.target&&(n&&n(c),i&&i(!0),s.current.isFocusWithin=!0,o(c))},[n,i,o]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:a}}}let _6=!1,_C=0;function aT(){_6=!0,setTimeout(()=>{_6=!1},50)}function HW(t){t.pointerType==="touch"&&aT()}function oZe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",HW):document.addEventListener("touchend",aT),_C++,()=>{_C--,!(_C>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",HW):document.removeEventListener("touchend",aT))}}function lZe(t){let{onHoverStart:e,onHoverChange:r,onHoverEnd:n,isDisabled:i}=t,[s,a]=I.useState(!1),o=I.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;I.useEffect(oZe,[]);let{hoverProps:l,triggerHoverEnd:c}=I.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),a(!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),a(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=g=>{_6&&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&&!_6&&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 I.useEffect(()=>{i&&c({currentTarget:o.target},o.pointerType)},[i]),{hoverProps:l,isHovered:s}}function cZe(t={}){let{autoFocus:e=!1,isTextInput:r,within:n}=t,i=I.useRef({isFocused:!1,isFocusVisible:e||One()}),[s,a]=I.useState(!1),[o,l]=I.useState(()=>i.current.isFocused&&i.current.isFocusVisible),c=I.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),u=I.useCallback(g=>{i.current.isFocused=g,a(g),c()},[c]);sZe(g=>{i.current.isFocusVisible=g,c()},[],{isTextInput:r});let{focusProps:f}=XYe({isDisabled:n,onFocusChange:u}),{focusWithinProps:h}=aZe({isDisabled:!n,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:o,focusProps:n?h:f}}var uZe=Object.defineProperty,dZe=(t,e,r)=>e in t?uZe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xC=(t,e,r)=>(dZe(t,typeof e!="symbol"?e+"":e,r),r);let fZe=class{constructor(){xC(this,"current",this.detect()),xC(this,"handoffState","pending"),xC(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"}},f0=new fZe;function fp(t){return f0.isServer?null:t instanceof Node?t.ownerDocument:t!=null&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function ux(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function yu(){let t=[],e={addEventListener(r,n,i,s){return r.addEventListener(n,i,s),e.add(()=>r.removeEventListener(n,i,s))},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 ux(()=>{n.current&&r[0]()}),e.add(()=>{n.current=!1})},style(r,n,i){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:s})})},group(r){let n=yu();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 um(){let[t]=I.useState(yu);return I.useEffect(()=>()=>t.dispose(),[t]),t}let vn=(t,e)=>{f0.isServer?I.useEffect(t,e):I.useLayoutEffect(t,e)};function hp(t){let e=I.useRef(t);return vn(()=>{e.current=t},[t]),e}let pr=function(t){let e=hp(t);return It.useCallback((...r)=>e.current(...r),[e])};function hZe(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 pZe(t,e){return!(!t||!e||t.righte.right||t.bottome.bottom)}function gZe({disabled:t=!1}={}){let e=I.useRef(null),[r,n]=I.useState(!1),i=um(),s=pr(()=>{e.current=null,n(!1),i.dispose()}),a=pr(o=>{if(i.dispose(),e.current===null){e.current=o.currentTarget,n(!0);{let l=fp(o.currentTarget);i.addEventListener(l,"pointerup",s,!1),i.addEventListener(l,"pointermove",c=>{if(e.current){let u=hZe(c);n(pZe(u,e.current.getBoundingClientRect()))}},!1),i.addEventListener(l,"pointercancel",s,!1)}}});return{pressed:r,pressProps:t?{}:{onPointerDown:a,onPointerUp:s,onClick:s}}}let mZe=I.createContext(void 0);function jne(){return I.useContext(mZe)}function oT(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function lu(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,lu),n}var Ag=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(Ag||{}),xf=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(xf||{});function bi(){let t=vZe();return I.useCallback(e=>yZe({mergeRefs:t,...e}),[t])}function yZe({ourProps:t,theirProps:e,slot:r,defaultTag:n,features:i,visible:s=!0,name:a,mergeRefs:o}){o=o??wZe;let l=Lne(e,t);if(s)return zb(l,r,n,a,o);let c=i??0;if(c&2){let{static:u=!1,...f}=l;if(u)return zb(f,r,n,a,o)}if(c&1){let{unmount:u=!0,...f}=l;return lu(u?0:1,{0(){return null},1(){return zb({...f,hidden:!0,style:{display:"none"}},r,n,a,o)}})}return zb(l,r,n,a,o)}function zb(t,e={},r,n,i){let{as:s=r,children:a,refName:o="ref",...l}=EC(t,["unmount","static"]),c=t.ref!==void 0?{[o]:t.ref}:{},u=typeof a=="function"?a(e):a;"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,E=>`-${E.toLowerCase()}`));if(h){f["data-headlessui-state"]=g.join(" ");for(let m of g)f[`data-${m}`]=""}}if(s===I.Fragment&&(Object.keys(jh(l)).length>0||Object.keys(jh(f)).length>0))if(!I.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(jh(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(jh(l)).concat(Object.keys(jh(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)=>eT(g(...v),l.className):eT(g,l.className),w=m?{className:m}:{},E=fne(u.props,Rh(mC(l,["ref"])));for(let v in f)v in E&&delete f[v];return T.cloneElement(u,Object.assign({},E,f,c,{ref:i(_Ye(u),c.ref)},w))}return T.createElement(s,Object.assign({},mC(l,["ref"]),s!==T.Fragment&&c,s!==T.Fragment&&f),u)}function wYe(){let t=T.useRef([]),e=T.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 bYe(...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 fne(...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 s;return(s=i==null?void 0:i.preventDefault)==null?void 0:s.call(i)}]);for(let n in r)Object.assign(e,{[n](i,...s){let o=r[n];for(let a of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...s)}}});return e}function hne(...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 s=r[n];for(let o of s)o==null||o(...i)}});return e}function ri(t){var e;return Object.assign(T.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function Rh(t){let e=Object.assign({},t);for(let r in e)e[r]===void 0&&delete e[r];return e}function mC(t,e=[]){let r=Object.assign({},t);for(let n of e)n in r&&delete r[n];return r}function _Ye(t){return It.version.split(".")[0]>="19"?t.props.ref:t.ref}let xYe="span";var y4=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(y4||{});function EYe(t,e){var r;let{features:n=1,...i}=t,s={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 bi()({ourProps:s,theirProps:i,slot:{},defaultTag:xYe,name:"Hidden"})}let tT=ri(EYe),CYe=T.createContext(void 0);function AYe(){return T.useContext(CYe)}function SYe(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&&IYe(r)?!1:n}function IYe(t){if(!t)return!1;let e=t.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}let pne=Symbol();function TYe(t,e=!0){return Object.assign(t,{[pne]:e})}function lo(...t){let e=T.useRef(t);T.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[pne]))?void 0:r}let nP=T.createContext(null);nP.displayName="DescriptionContext";function gne(){let t=T.useContext(nP);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,gne),e}return t}function mne(){let[t,e]=T.useState([]);return[t.length>0?t.join(" "):void 0,T.useMemo(()=>function(r){let n=pr(s=>(e(o=>[...o,s]),()=>e(o=>{let a=o.slice(),l=a.indexOf(s);return l!==-1&&a.splice(l,1),a}))),i=T.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 It.createElement(nP.Provider,{value:i},r.children)},[e])]}let $Ye="p";function kYe(t,e){let r=T.useId(),n=dne(),{id:i=`headlessui-description-${r}`,...s}=t,o=gne(),a=lo(e);vn(()=>o.register(i),[i,o.register]);let l=n||!1,c=T.useMemo(()=>({...o.slot,disabled:l}),[o.slot,l]),u={ref:a,...o.props,id:i};return bi()({ourProps:u,theirProps:s,slot:c,defaultTag:$Ye,name:o.name||"Description"})}let NYe=ri(kYe),PYe=Object.assign(NYe,{});var Fi=(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))(Fi||{});let s7=T.createContext(null);s7.displayName="LabelContext";function iP(){let t=T.useContext(s7);if(t===null){let e=new Error("You used a