@dcl/profile-site 0.6.6 → 0.6.7-6162920852.commit-91b418e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{d as El,s as Cl,c as O,b as Or,B as U,a as Il,j as kl,e as Lr,g as Hn,f as Yi,h as Ja,p as xl,i as Rl,l as Ml,k as Qa,_ as b,r as jr,m as Tl}from"./index-c289309c.js";function Al(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var bs={},$n={},$r={};Object.defineProperty($r,"__esModule",{value:!0});$r.walletLogo=void 0;const Nl=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 `}};$r.walletLogo=Nl;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.ScopedLocalStorage=void 0;class Ol{constructor(e){this.scope=e}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`${this.scope}:${e}`}}Dr.ScopedLocalStorage=Ol;var nn={},bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.EVENTS=void 0;bn.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Wn={},Y={},Pr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Pr);Object.defineProperty(Y,"__esModule",{value:!0});Y.EthereumAddressFromSignedMessageResponse=Y.SubmitEthereumTransactionResponse=Y.SignEthereumTransactionResponse=Y.SignEthereumMessageResponse=Y.isRequestEthereumAccountsResponse=Y.SelectProviderResponse=Y.WatchAssetReponse=Y.RequestEthereumAccountsResponse=Y.SwitchEthereumChainResponse=Y.AddEthereumChainResponse=Y.isErrorResponse=void 0;const ot=Pr;function Ll(t){var e,n;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((n=t)===null||n===void 0?void 0:n.errorMessage)!==void 0}Y.isErrorResponse=Ll;function jl(t){return{method:ot.Web3Method.addEthereumChain,result:t}}Y.AddEthereumChainResponse=jl;function $l(t){return{method:ot.Web3Method.switchEthereumChain,result:t}}Y.SwitchEthereumChainResponse=$l;function Dl(t){return{method:ot.Web3Method.requestEthereumAccounts,result:t}}Y.RequestEthereumAccountsResponse=Dl;function Pl(t){return{method:ot.Web3Method.watchAsset,result:t}}Y.WatchAssetReponse=Pl;function Fl(t){return{method:ot.Web3Method.selectProvider,result:t}}Y.SelectProviderResponse=Fl;function Bl(t){return t&&t.method===ot.Web3Method.requestEthereumAccounts}Y.isRequestEthereumAccountsResponse=Bl;function Vl(t){return{method:ot.Web3Method.signEthereumMessage,result:t}}Y.SignEthereumMessageResponse=Vl;function Hl(t){return{method:ot.Web3Method.signEthereumTransaction,result:t}}Y.SignEthereumTransactionResponse=Hl;function Wl(t){return{method:ot.Web3Method.submitEthereumTransaction,result:t}}Y.SubmitEthereumTransactionResponse=Wl;function Ul(t){return{method:ot.Web3Method.ethereumAddressFromSignedMessage,result:t}}Y.EthereumAddressFromSignedMessageResponse=Ul;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.LIB_VERSION=void 0;Un.LIB_VERSION="3.7.1";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=El,n=Y,r=Un;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(h){return h!==void 0?(0,e.getMessageFromCode)(h):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(h="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${h}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(h,u){const d=(0,e.serializeError)(o(h),{shouldIncludeStack:!0}),f=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");f.searchParams.set("version",r.LIB_VERSION),f.searchParams.set("code",d.code.toString());const p=a(d.data,u);return p&&f.searchParams.set("method",p),f.searchParams.set("message",d.message),Object.assign(Object.assign({},d),{docUrl:f.href})}t.serializeError=s;function o(h){return typeof h=="string"?{message:h,code:t.standardErrorCodes.rpc.internal}:(0,n.isErrorResponse)(h)?Object.assign(Object.assign({},h),{message:h.errorMessage,code:h.errorCode,data:{method:h.method,result:h.result}}):h}function a(h,u){var d;const f=(d=h)===null||d===void 0?void 0:d.method;if(f)return f;if(u!==void 0)return typeof u=="string"?u:Array.isArray(u)?u.length>0?u[0].method:void 0:u.method}function c(h){var u;if(typeof h=="number")return h;if(l(h))return(u=h.code)!==null&&u!==void 0?u:h.errorCode}t.getErrorCode=c;function l(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}})(Wn);var gn={},I={},zl=String.prototype.replace,ql=/%20/g,Ii={RFC1738:"RFC1738",RFC3986:"RFC3986"},gs={default:Ii.RFC3986,formatters:{RFC1738:function(t){return zl.call(t,ql,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ii.RFC1738,RFC3986:Ii.RFC3986},Gl=gs,ki=Object.prototype.hasOwnProperty,xt=Array.isArray,Qe=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Jl=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if(xt(r)){for(var i=[],s=0;s<r.length;++s)typeof r[s]<"u"&&i.push(r[s]);n.obj[n.prop]=i}}},Za=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},Ql=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if(xt(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!ki.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return xt(e)&&!xt(n)&&(i=Za(e,r)),xt(e)&&xt(n)?(n.forEach(function(s,o){if(ki.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,r):e.push(s)}else e[o]=s}),e):Object.keys(n).reduce(function(s,o){var a=n[o];return ki.call(s,o)?s[o]=t(s[o],a,r):s[o]=a,s},i)},Zl=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},Yl=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Kl=function(e,n,r,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var a="",c=0;c<o.length;++c){var l=o.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===Gl.RFC1738&&(l===40||l===41)){a+=o.charAt(c);continue}if(l<128){a=a+Qe[l];continue}if(l<2048){a=a+(Qe[192|l>>6]+Qe[128|l&63]);continue}if(l<55296||l>=57344){a=a+(Qe[224|l>>12]+Qe[128|l>>6&63]+Qe[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|o.charCodeAt(c)&1023),a+=Qe[240|l>>18]+Qe[128|l>>12&63]+Qe[128|l>>6&63]+Qe[128|l&63]}return a},Xl=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var s=n[i],o=s.obj[s.prop],a=Object.keys(o),c=0;c<a.length;++c){var l=a[c],h=o[l];typeof h=="object"&&h!==null&&r.indexOf(h)===-1&&(n.push({obj:o,prop:l}),r.push(h))}return Jl(n),e},eh=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},th=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},nh=function(e,n){return[].concat(e,n)},rh=function(e,n){if(xt(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},Ya={arrayToObject:Za,assign:Zl,combine:nh,compact:Xl,decode:Yl,encode:Kl,isBuffer:th,isRegExp:eh,maybeMap:rh,merge:Ql},Ka=Cl,yr=Ya,Tn=gs,ih=Object.prototype.hasOwnProperty,fo={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},ct=Array.isArray,sh=Array.prototype.push,Xa=function(t,e){sh.apply(t,ct(e)?e:[e])},oh=Date.prototype.toISOString,po=Tn.default,_e={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:yr.encode,encodeValuesOnly:!1,format:po,formatter:Tn.formatters[po],indices:!1,serializeDate:function(e){return oh.call(e)},skipNulls:!1,strictNullHandling:!1},ah=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},xi={},ch=function t(e,n,r,i,s,o,a,c,l,h,u,d,f,p,g,S){for(var v=e,m=S,E=0,C=!1;(m=m.get(xi))!==void 0&&!C;){var y=m.get(e);if(E+=1,typeof y<"u"){if(y===E)throw new RangeError("Cyclic object value");C=!0}typeof m.get(xi)>"u"&&(E=0)}if(typeof c=="function"?v=c(n,v):v instanceof Date?v=u(v):r==="comma"&&ct(v)&&(v=yr.maybeMap(v,function(k){return k instanceof Date?u(k):k})),v===null){if(s)return a&&!p?a(n,_e.encoder,g,"key",d):n;v=""}if(ah(v)||yr.isBuffer(v)){if(a){var T=p?n:a(n,_e.encoder,g,"key",d);return[f(T)+"="+f(a(v,_e.encoder,g,"value",d))]}return[f(n)+"="+f(String(v))]}var F=[];if(typeof v>"u")return F;var K;if(r==="comma"&&ct(v))p&&a&&(v=yr.maybeMap(v,a)),K=[{value:v.length>0?v.join(",")||null:void 0}];else if(ct(c))K=c;else{var L=Object.keys(v);K=l?L.sort(l):L}for(var V=i&&ct(v)&&v.length===1?n+"[]":n,fe=0;fe<K.length;++fe){var q=K[fe],_=typeof q=="object"&&typeof q.value<"u"?q.value:v[q];if(!(o&&_===null)){var w=ct(v)?typeof r=="function"?r(V,q):V:V+(h?"."+q:"["+q+"]");S.set(e,E);var M=Ka();M.set(xi,S),Xa(F,t(_,w,r,i,s,o,r==="comma"&&p&&ct(v)?null:a,c,l,h,u,d,f,p,g,M))}}return F},uh=function(e){if(!e)return _e;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||_e.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Tn.default;if(typeof e.format<"u"){if(!ih.call(Tn.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Tn.formatters[r],s=_e.filter;return(typeof e.filter=="function"||ct(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:_e.addQueryPrefix,allowDots:typeof e.allowDots>"u"?_e.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:_e.charsetSentinel,delimiter:typeof e.delimiter>"u"?_e.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:_e.encode,encoder:typeof e.encoder=="function"?e.encoder:_e.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:_e.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:_e.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:_e.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:_e.strictNullHandling}},lh=function(t,e){var n=t,r=uh(e),i,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):ct(r.filter)&&(s=r.filter,i=s);var o=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in fo?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=fo[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var h=Ka(),u=0;u<i.length;++u){var d=i[u];r.skipNulls&&n[d]===null||Xa(o,ch(n[d],d,c,l,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,h))}var f=o.join(r.delimiter),p=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""},rn=Ya,Ki=Object.prototype.hasOwnProperty,hh=Array.isArray,de={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:rn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},fh=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},ec=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},dh="utf8=%26%2310003%3B",ph="utf8=%E2%9C%93",bh=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=n.parameterLimit===1/0?void 0:n.parameterLimit,o=i.split(n.delimiter,s),a=-1,c,l=n.charset;if(n.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===ph?l="utf-8":o[c]===dh&&(l="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var h=o[c],u=h.indexOf("]="),d=u===-1?h.indexOf("="):u+1,f,p;d===-1?(f=n.decoder(h,de.decoder,l,"key"),p=n.strictNullHandling?null:""):(f=n.decoder(h.slice(0,d),de.decoder,l,"key"),p=rn.maybeMap(ec(h.slice(d+1),n),function(g){return n.decoder(g,de.decoder,l,"value")})),p&&n.interpretNumericEntities&&l==="iso-8859-1"&&(p=fh(p)),h.indexOf("[]=")>-1&&(p=hh(p)?[p]:p),Ki.call(r,f)?r[f]=rn.combine(r[f],p):r[f]=p}return r},gh=function(t,e,n,r){for(var i=r?e:ec(e,n),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!n.parseArrays&&c===""?o={0:i}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(o=[],o[l]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},mh=function(e,n,r,i){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=r.depth>0&&o.exec(s),l=c?s.slice(0,c.index):s,h=[];if(l){if(!r.plainObjects&&Ki.call(Object.prototype,l)&&!r.allowPrototypes)return;h.push(l)}for(var u=0;r.depth>0&&(c=a.exec(s))!==null&&u<r.depth;){if(u+=1,!r.plainObjects&&Ki.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;h.push(c[1])}return c&&h.push("["+s.slice(c.index)+"]"),gh(h,n,r,i)}},vh=function(e){if(!e)return de;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?de.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?de.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:de.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:de.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:de.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:de.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:de.comma,decoder:typeof e.decoder=="function"?e.decoder:de.decoder,delimiter:typeof e.delimiter=="string"||rn.isRegExp(e.delimiter)?e.delimiter:de.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:de.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:de.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:de.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:de.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:de.strictNullHandling}},yh=function(t,e){var n=vh(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?bh(t,n):t,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],c=mh(a,r[a],n,typeof t=="string");i=rn.merge(i,c,n)}return n.allowSparse===!0?i:rn.compact(i)},wh=lh,_h=yh,Sh=gs,Eh={formats:Sh,parse:_h,stringify:wh},zn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return r=>r}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function n(r){return Math.floor(r)}t.IntNumber=n,t.RegExpString=e(),function(r){r.CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(zn);var Ch=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(I,"__esModule",{value:!0});I.isInIFrame=I.createQrUrl=I.getFavicon=I.range=I.isBigNumber=I.ensureParsedJSONObject=I.ensureBN=I.ensureRegExpString=I.ensureIntNumber=I.ensureBuffer=I.ensureAddressString=I.ensureEvenLengthHexString=I.ensureHexString=I.isHexString=I.prepend0x=I.strip0x=I.has0xPrefix=I.hexStringFromIntNumber=I.intNumberFromHexString=I.bigIntStringFromBN=I.hexStringFromBuffer=I.hexStringToUint8Array=I.uint8ArrayToHex=I.randomBytesHex=void 0;const vt=Ch(Or),Ih=Eh,Pt=Wn,Pe=zn,tc=/^[0-9]*$/,nc=/^[a-f0-9]*$/;function kh(t){return rc(crypto.getRandomValues(new Uint8Array(t)))}I.randomBytesHex=kh;function rc(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}I.uint8ArrayToHex=rc;function xh(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}I.hexStringToUint8Array=xh;function Rh(t,e=!1){const n=t.toString("hex");return(0,Pe.HexString)(e?"0x"+n:n)}I.hexStringFromBuffer=Rh;function Mh(t){return(0,Pe.BigIntString)(t.toString(10))}I.bigIntStringFromBN=Mh;function Th(t){return(0,Pe.IntNumber)(new vt.default(Gn(t,!1),16).toNumber())}I.intNumberFromHexString=Th;function Ah(t){return(0,Pe.HexString)("0x"+new vt.default(t).toString(16))}I.hexStringFromIntNumber=Ah;function ms(t){return t.startsWith("0x")||t.startsWith("0X")}I.has0xPrefix=ms;function Fr(t){return ms(t)?t.slice(2):t}I.strip0x=Fr;function ic(t){return ms(t)?"0x"+t.slice(2):"0x"+t}I.prepend0x=ic;function qn(t){if(typeof t!="string")return!1;const e=Fr(t).toLowerCase();return nc.test(e)}I.isHexString=qn;function sc(t,e=!1){if(typeof t=="string"){const n=Fr(t).toLowerCase();if(nc.test(n))return(0,Pe.HexString)(e?"0x"+n:n)}throw Pt.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}I.ensureHexString=sc;function Gn(t,e=!1){let n=sc(t,!1);return n.length%2===1&&(n=(0,Pe.HexString)("0"+n)),e?(0,Pe.HexString)("0x"+n):n}I.ensureEvenLengthHexString=Gn;function Nh(t){if(typeof t=="string"){const e=Fr(t).toLowerCase();if(qn(e)&&e.length===40)return(0,Pe.AddressString)(ic(e))}throw Pt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}I.ensureAddressString=Nh;function Oh(t){if(U.isBuffer(t))return t;if(typeof t=="string")if(qn(t)){const e=Gn(t,!1);return U.from(e,"hex")}else return U.from(t,"utf8");throw Pt.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}I.ensureBuffer=Oh;function oc(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Pe.IntNumber)(t);if(typeof t=="string"){if(tc.test(t))return(0,Pe.IntNumber)(Number(t));if(qn(t))return(0,Pe.IntNumber)(new vt.default(Gn(t,!1),16).toNumber())}throw Pt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}I.ensureIntNumber=oc;function Lh(t){if(t instanceof RegExp)return(0,Pe.RegExpString)(t.toString());throw Pt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}I.ensureRegExpString=Lh;function jh(t){if(t!==null&&(vt.default.isBN(t)||ac(t)))return new vt.default(t.toString(10),10);if(typeof t=="number")return new vt.default(oc(t));if(typeof t=="string"){if(tc.test(t))return new vt.default(t,10);if(qn(t))return new vt.default(Gn(t,!1),16)}throw Pt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}I.ensureBN=jh;function $h(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Pt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}I.ensureParsedJSONObject=$h;function ac(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}I.isBigNumber=ac;function Dh(t,e){return Array.from({length:e-t},(n,r)=>t+r)}I.range=Dh;function Ph(){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:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`}I.getFavicon=Ph;function Fh(t,e,n,r,i,s){const o=r?"parent-id":"id",a=(0,Ih.stringify)({[o]:t,secret:e,server:n,v:i,chainId:s});return`${n}/#/link?${a}`}I.createQrUrl=Fh;function Bh(){try{return window.frameElement!==null}catch{return!1}}I.isInIFrame=Bh;Object.defineProperty(gn,"__esModule",{value:!0});gn.Session=void 0;const bo=Il,go=I,mo="session:id",vo="session:secret",yo="session:linked";class vs{constructor(e,n,r,i){this._storage=e,this._id=n||(0,go.randomBytesHex)(16),this._secret=r||(0,go.randomBytesHex)(32),this._key=new bo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const n=e.getItem(mo),r=e.getItem(yo),i=e.getItem(vo);return n&&i?new vs(e,n,i,r==="1"):null}static hash(e){return new bo.sha256().update(e).digest("hex")}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(mo,this._id),this._storage.setItem(vo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(yo,this._linked?"1":"0")}}gn.Session=vs;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.WalletSDKRelayAbstract=qe.APP_VERSION_KEY=qe.LOCAL_STORAGE_ADDRESSES_KEY=qe.WALLET_USER_NAME_KEY=void 0;const wo=Wn;qe.WALLET_USER_NAME_KEY="walletUsername";qe.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";qe.APP_VERSION_KEY="AppVersion";class Vh{async makeEthereumJSONRPCRequest(e,n){if(!n)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(n,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(r=>r.json()).then(r=>{if(!r)throw wo.standardErrors.rpc.parse({});const i=r,{error:s}=i;if(s)throw(0,wo.serializeError)(s,e.method);return i})}}qe.WalletSDKRelayAbstract=Vh;const Hh=kl,Wh=Or;function cc(t){return U.allocUnsafe(t).fill(0)}function uc(t,e,n){const r=cc(e);return t=Br(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function Uh(t,e){return uc(t,e,!0)}function Br(t){if(!U.isBuffer(t))if(Array.isArray(t))t=U.from(t);else if(typeof t=="string")lc(t)?t=U.from(Gh(hc(t)),"hex"):t=U.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=U.allocUnsafe(0);else if(Wh.isBN(t))t=t.toArrayLike(U);else if(t.toArray)t=U.from(t.toArray());else throw new Error("invalid type");return t}function zh(t){return t=Br(t),"0x"+t.toString("hex")}function qh(t,e){return t=Br(t),e||(e=256),Hh("keccak"+e).update(t).digest()}function Gh(t){return t.length%2?"0"+t:t}function lc(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function hc(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var fc={zeros:cc,setLength:uc,setLengthRight:Uh,isHexString:lc,stripHexPrefix:hc,toBuffer:Br,bufferToHex:zh,keccak:qh};const Lt=fc,Nt=Or;function dc(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function Yt(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function _o(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function pc(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function Rt(t){var e=typeof t;if(e==="string")return Lt.isHexString(t)?new Nt(Lt.stripHexPrefix(t),16):new Nt(t,10);if(e==="number")return new Nt(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Xe(t,e){var n,r,i,s;if(t==="address")return Xe("uint160",Rt(e));if(t==="bool")return Xe("uint8",e?1:0);if(t==="string")return Xe("bytes",new U(e,"utf8"));if(Qh(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(n=pc(t),n!=="dynamic"&&n!==0&&e.length>n)throw new Error("Elements exceed array size: "+n);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(Xe(t,e[s]));if(n==="dynamic"){var o=Xe("uint256",e.length);i.unshift(o)}return U.concat(i)}else{if(t==="bytes")return e=new U(e),i=U.concat([Xe("uint256",e.length),e]),e.length%32!==0&&(i=U.concat([i,Lt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(n=Yt(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return Lt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(n=Yt(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Rt(e),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());if(r<0)throw new Error("Supplied uint is negative");return r.toArrayLike(U,"be",32)}else if(t.startsWith("int")){if(n=Yt(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Rt(e),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(U,"be",32)}else if(t.startsWith("ufixed")){if(n=_o(t),r=Rt(e),r<0)throw new Error("Supplied ufixed is negative");return Xe("uint256",r.mul(new Nt(2).pow(new Nt(n[1]))))}else if(t.startsWith("fixed"))return n=_o(t),Xe("int256",Rt(e).mul(new Nt(2).pow(new Nt(n[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Jh(t){return t==="string"||t==="bytes"||pc(t)==="dynamic"}function Qh(t){return t.lastIndexOf("]")===t.length-1}function Zh(t,e){var n=[],r=[],i=32*t.length;for(var s in t){var o=dc(t[s]),a=e[s],c=Xe(o,a);Jh(o)?(n.push(Xe("uint256",i)),r.push(c),i+=c.length):n.push(c)}return U.concat(n.concat(r))}function bc(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],s=0;s<t.length;s++){var o=dc(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new U(a,"utf8"));else if(o==="bool")i.push(new U(a?"01":"00","hex"));else if(o==="address")i.push(Lt.setLength(a,20));else if(o.startsWith("bytes")){if(n=Yt(o),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(Lt.setLengthRight(a,n))}else if(o.startsWith("uint")){if(n=Yt(o),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Rt(a),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(U,"be",n/8))}else if(o.startsWith("int")){if(n=Yt(o),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Rt(a),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());i.push(r.toTwos(n).toArrayLike(U,"be",n/8))}else throw new Error("Unsupported or invalid type: "+o)}return U.concat(i)}function Yh(t,e){return Lt.keccak(bc(t,e))}var Kh={rawEncode:Zh,solidityPack:bc,soliditySHA3:Yh};const We=fc,An=Kh,gc={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"]},Ri={encodeData(t,e,n,r=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(r){const o=(a,c,l)=>{if(n[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":We.keccak(this.encodeData(c,l,n,r))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",We.keccak(l)];if(c==="string")return typeof l=="string"&&(l=U.from(l,"utf8")),["bytes32",We.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const h=c.slice(0,c.lastIndexOf("[")),u=l.map(d=>o(a,h,d));return["bytes32",We.keccak(An.rawEncode(u.map(([d])=>d),u.map(([,d])=>d)))]}return[c,l]};for(const a of n[t]){const[c,l]=o(a.name,a.type,e[a.name]);i.push(c),s.push(l)}}else for(const o of n[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=We.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=U.from(a,"utf8")),a=We.keccak(a),s.push(a);else if(n[o.type]!==void 0)i.push("bytes32"),a=We.keccak(this.encodeData(o.type,a,n,r)),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 An.rawEncode(i,s)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter(i=>i!==t);r=[t].concat(r.sort());for(const i of r){if(!e[i])throw new Error("No type definition specified: "+i);n+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||e[t]===void 0)return n;n.push(t);for(const r of e[t])for(const i of this.findTypeDependencies(r.type,e,n))!n.includes(i)&&n.push(i);return n},hashStruct(t,e,n,r=!0){return We.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return We.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in gc.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[U.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),n.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),We.keccak(U.concat(r))}};var Xh={TYPED_MESSAGE_SCHEMA:gc,TypedDataUtils:Ri,hashForSignTypedDataLegacy:function(t){return ef(t.data)},hashForSignTypedData_v3:function(t){return Ri.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Ri.hash(t.data)}};function ef(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const n=t.map(function(s){return s.type==="bytes"?We.toBuffer(s.value):s.value}),r=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return An.soliditySHA3(["bytes32","bytes32"],[An.soliditySHA3(new Array(t.length).fill("string"),i),An.soliditySHA3(r,n)])}var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.filterFromParam=sn.FilterPolyfill=void 0;const Jt=zn,Se=I,tf=5*60*1e3,Mt={jsonrpc:"2.0",id:0};class nf{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Jt.IntNumber)(1),this.provider=e}async newFilter(e){const n=mc(e),r=this.makeFilterId(),i=await this.setInitialCursorPosition(r,n.fromBlock);return console.log(`Installing new log filter(${r}):`,n,"initial cursor position:",i),this.logFilters.set(r,n),this.setFilterTimeout(r),(0,Se.hexStringFromIntNumber)(r)}async newBlockFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Se.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Se.hexStringFromIntNumber)(e)}uninstallFilter(e){const n=(0,Se.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${n})`),this.deleteFilter(n),!0}getFilterChanges(e){const n=(0,Se.intNumberFromHexString)(e);return this.timeouts.has(n)&&this.setFilterTimeout(n),this.logFilters.has(n)?this.getLogFilterChanges(n):this.blockFilters.has(n)?this.getBlockFilterChanges(n):this.pendingTransactionFilters.has(n)?this.getPendingTransactionFilterChanges(n):Promise.resolve(cr())}async getFilterLogs(e){const n=(0,Se.intNumberFromHexString)(e),r=this.logFilters.get(n);return r?this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getLogs",params:[So(r)]})):cr()}makeFilterId(){return(0,Jt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((n,r)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return r(i);if(Array.isArray(s)||s==null)return r(new Error(`unexpected response received: ${JSON.stringify(s)}`));n(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const n=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!n)return cr();const i=await this.getCurrentBlockHeight(),s=n.toBlock==="latest"?i:n.toBlock;if(r>i||r>n.toBlock)return ur();console.log(`Fetching logs from ${r} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getLogs",params:[So(Object.assign(Object.assign({},n),{fromBlock:r,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,Se.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>r){const l=(0,Jt.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${r} to ${l}`),this.cursors.set(e,l)}}return o}async getBlockFilterChanges(e){const n=this.cursors.get(e);if(!n)return cr();const r=await this.getCurrentBlockHeight();if(n>r)return ur();console.log(`Fetching blocks from ${n} to ${r} for filter (${e})`);const i=(await Promise.all((0,Se.range)(n,r+1).map(o=>this.getBlockHashByNumber((0,Jt.IntNumber)(o))))).filter(o=>!!o),s=(0,Jt.IntNumber)(n+i.length);return console.log(`Moving cursor position for filter (${e}) from ${n} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Mt),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(ur())}async setInitialCursorPosition(e,n){const r=await this.getCurrentBlockHeight(),i=typeof n=="number"&&n>r?n:r;return this.cursors.set(e,i),i}setFilterTimeout(e){const n=this.timeouts.get(e);n&&window.clearTimeout(n);const r=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},tf);this.timeouts.set(e,r)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_blockNumber",params:[]}));return(0,Se.intNumberFromHexString)((0,Se.ensureHexString)(e))}async getBlockHashByNumber(e){const n=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getBlockByNumber",params:[(0,Se.hexStringFromIntNumber)(e),!1]}));return n.result&&typeof n.result.hash=="string"?(0,Se.ensureHexString)(n.result.hash):null}}sn.FilterPolyfill=nf;function mc(t){return{fromBlock:Eo(t.fromBlock),toBlock:Eo(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}sn.filterFromParam=mc;function So(t){const e={fromBlock:Co(t.fromBlock),toBlock:Co(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Eo(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Jt.IntNumber)(0);if((0,Se.isHexString)(t))return(0,Se.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Co(t){return t==="latest"?t:(0,Se.hexStringFromIntNumber)(t)}function cr(){return Object.assign(Object.assign({},Mt),{error:{code:-32e3,message:"filter not found"}})}function ur(){return Object.assign(Object.assign({},Mt),{result:[]})}var vc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(vc);var Vr={},yc={},Hr={},Jn={},rf=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.BaseBlockTracker=void 0;const sf=rf(Lr),of=1e3,af=(t,e)=>t+e,Io=["sync","latest"];class cf extends sf.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*of,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(n=>this.once("latest",n))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){Io.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Io.map(e=>this.listenerCount(e)).reduce(af)}_newPotentialLatest(e){const n=this._currentBlock;n&&ko(e)<=ko(n)||this._setCurrentBlock(e)}_setCurrentBlock(e){const n=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:n,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Jn.BaseBlockTracker=cf;function ko(t){return Number.parseInt(t,16)}var wc={},_c={},ye={};class Sc extends TypeError{constructor(e,n){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...n()])}}function uf(t){return Fe(t)&&typeof t[Symbol.iterator]=="function"}function Fe(t){return typeof t=="object"&&t!=null}function xo(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function he(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function lf(t){const{done:e,value:n}=t.next();return e?void 0:n}function hf(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${he(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*Xi(t,e,n,r){uf(t)||(t=[t]);for(const i of t){const s=hf(i,e,n,r);s&&(yield s)}}function*ys(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Fe(e.schema)&&Fe(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c="valid";for(const l of e.validator(t,a))l.explanation=n.message,c="not_valid",yield[l,void 0];for(let[l,h,u]of e.entries(t,a)){const d=ys(h,u,{path:l===void 0?r:[...r,l],branch:l===void 0?i:[...i,h],coerce:s,mask:o,message:n.message});for(const f of d)f[0]?(c=f[0].refinement!=null?"not_refined":"not_valid",yield[f[0],void 0]):s&&(h=f[1],l===void 0?t=h:t instanceof Map?t.set(l,h):t instanceof Set?t.add(h):Fe(t)&&(h!==void 0||l in t)&&(t[l]=h))}if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=n.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}class ae{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const h=i(c,l);return Xi(h,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const h=s(c,l);return Xi(h,l,this,c)}:this.refiner=()=>[]}assert(e,n){return Ec(e,this,n)}create(e,n){return Cc(e,this,n)}is(e){return ws(e,this)}mask(e,n){return Ic(e,this,n)}validate(e,n={}){return mn(e,this,n)}}function Ec(t,e,n){const r=mn(t,e,{message:n});if(r[0])throw r[0]}function Cc(t,e,n){const r=mn(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function Ic(t,e,n){const r=mn(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function ws(t,e){return!mn(t,e)[0]}function mn(t,e,n={}){const r=ys(t,e,n),i=lf(r);return i[0]?[new Sc(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function ff(...t){const e=t[0].type==="type",n=t.map(i=>i.schema),r=Object.assign({},...n);return e?Ss(r):Qn(r)}function Re(t,e){return new ae({type:t,schema:null,validator:e})}function df(t,e){return new ae({...t,refiner:(n,r)=>n===void 0||t.refiner(n,r),validator(n,r){return n===void 0?!0:(e(n,r),t.validator(n,r))}})}function pf(t){return new ae({type:"dynamic",schema:null,*entries(e,n){yield*t(e,n).entries(e,n)},validator(e,n){return t(e,n).validator(e,n)},coercer(e,n){return t(e,n).coercer(e,n)},refiner(e,n){return t(e,n).refiner(e,n)}})}function bf(t){let e;return new ae({type:"lazy",schema:null,*entries(n,r){e??(e=t()),yield*e.entries(n,r)},validator(n,r){return e??(e=t()),e.validator(n,r)},coercer(n,r){return e??(e=t()),e.coercer(n,r)},refiner(n,r){return e??(e=t()),e.refiner(n,r)}})}function gf(t,e){const{schema:n}=t,r={...n};for(const i of e)delete r[i];switch(t.type){case"type":return Ss(r);default:return Qn(r)}}function mf(t){const e=t instanceof ae?{...t.schema}:{...t};for(const n in e)e[n]=kc(e[n]);return Qn(e)}function vf(t,e){const{schema:n}=t,r={};for(const i of e)r[i]=n[i];return Qn(r)}function yf(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Re(t,e)}function wf(){return Re("any",()=>!0)}function _f(t){return new ae({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${he(e)}`}})}function Sf(){return Re("bigint",t=>typeof t=="bigint")}function Ef(){return Re("boolean",t=>typeof t=="boolean")}function Cf(){return Re("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${he(t)}`)}function If(t){const e={},n=t.map(r=>he(r)).join();for(const r of t)e[r]=r;return new ae({type:"enums",schema:e,validator(r){return t.includes(r)||`Expected one of \`${n}\`, but received: ${he(r)}`}})}function kf(){return Re("func",t=>typeof t=="function"||`Expected a function, but received: ${he(t)}`)}function xf(t){return Re("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${he(e)}`)}function Rf(){return Re("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${he(t)}`)}function Mf(t){return new ae({type:"intersection",schema:null,*entries(e,n){for(const r of t)yield*r.entries(e,n)},*validator(e,n){for(const r of t)yield*r.validator(e,n)},*refiner(e,n){for(const r of t)yield*r.refiner(e,n)}})}function Tf(t){const e=he(t),n=typeof t;return new ae({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${he(r)}`}})}function Af(t,e){return new ae({type:"map",schema:null,*entries(n){if(t&&e&&n instanceof Map)for(const[r,i]of n.entries())yield[r,r,t],yield[r,i,e]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${he(n)}`}})}function _s(){return Re("never",()=>!1)}function Nf(t){return new ae({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function Of(){return Re("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${he(t)}`)}function Qn(t){const e=t?Object.keys(t):[],n=_s();return new ae({type:"object",schema:t||null,*entries(r){if(t&&Fe(r)){const i=new Set(Object.keys(r));for(const s of e)i.delete(s),yield[s,r[s],t[s]];for(const s of i)yield[s,r[s],n]}},validator(r){return Fe(r)||`Expected an object, but received: ${he(r)}`},coercer(r){return Fe(r)?{...r}:r}})}function kc(t){return new ae({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function Lf(t,e){return new ae({type:"record",schema:null,*entries(n){if(Fe(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return Fe(n)||`Expected an object, but received: ${he(n)}`}})}function jf(){return Re("regexp",t=>t instanceof RegExp)}function $f(t){return new ae({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const n of e)yield[n,n,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${he(e)}`}})}function xc(){return Re("string",t=>typeof t=="string"||`Expected a string, but received: ${he(t)}`)}function Df(t){const e=_s();return new ae({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${he(n)}`}})}function Ss(t){const e=Object.keys(t);return new ae({type:"type",schema:t,*entries(n){if(Fe(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Fe(n)||`Expected an object, but received: ${he(n)}`},coercer(n){return Fe(n)?{...n}:n}})}function Pf(t){const e=t.map(n=>n.type).join(" | ");return new ae({type:"union",schema:null,coercer(n){for(const r of t){const[i,s]=r.validate(n,{coerce:!0});if(!i)return s}return n},validator(n,r){const i=[];for(const s of t){const[...o]=ys(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${he(n)}`,...i]}})}function Rc(){return Re("unknown",()=>!0)}function Es(t,e,n){return new ae({...t,coercer:(r,i)=>ws(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}function Ff(t,e,n={}){return Es(t,Rc(),r=>{const i=typeof e=="function"?e():e;if(r===void 0)return i;if(!n.strict&&xo(r)&&xo(i)){const s={...r};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return r})}function Bf(t){return Es(t,xc(),e=>e.trim())}function Vf(t){return Ft(t,"empty",e=>{const n=Mc(e);return n===0||`Expected an empty ${t.type} but received one with a size of \`${n}\``})}function Mc(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Hf(t,e,n={}){const{exclusive:r}=n;return Ft(t,"max",i=>r?i<e:i<=e||`Expected a ${t.type} less than ${r?"":"or equal to "}${e} but received \`${i}\``)}function Wf(t,e,n={}){const{exclusive:r}=n;return Ft(t,"min",i=>r?i>e:i>=e||`Expected a ${t.type} greater than ${r?"":"or equal to "}${e} but received \`${i}\``)}function Uf(t){return Ft(t,"nonempty",e=>Mc(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function zf(t,e){return Ft(t,"pattern",n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`)}function qf(t,e,n=e){const r=`Expected a ${t.type}`,i=e===n?`of \`${e}\``:`between \`${e}\` and \`${n}\``;return Ft(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=n||`${r} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=n||`${r} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=n||`${r} with a length ${i} but received one with a length of \`${o}\``}})}function Ft(t,e,n){return new ae({...t,*refiner(r,i){yield*t.refiner(r,i);const s=n(r,i),o=Xi(s,i,t,r);for(const a of o)yield{...a,refinement:e}}})}const Gf=Object.freeze(Object.defineProperty({__proto__:null,Struct:ae,StructError:Sc,any:wf,array:_f,assert:Ec,assign:ff,bigint:Sf,boolean:Ef,coerce:Es,create:Cc,date:Cf,defaulted:Ff,define:Re,deprecated:df,dynamic:pf,empty:Vf,enums:If,func:kf,instance:xf,integer:Rf,intersection:Mf,is:ws,lazy:bf,literal:Tf,map:Af,mask:Ic,max:Hf,min:Wf,never:_s,nonempty:Uf,nullable:Nf,number:Of,object:Qn,omit:gf,optional:kc,partial:mf,pattern:zf,pick:vf,record:Lf,refine:Ft,regexp:jf,set:$f,size:qf,string:xc,struct:yf,trimmed:Bf,tuple:Df,type:Ss,union:Pf,unknown:Rc,validate:mn},Symbol.toStringTag,{value:"Module"})),Bt=Hn(Gf);Object.defineProperty(ye,"__esModule",{value:!0});ye.assertExhaustive=ye.assertStruct=ye.assert=ye.AssertionError=void 0;const Jf=Bt;function Qf(t){return typeof t=="object"&&t!==null&&"message"in t}function Zf(t){var e,n;return typeof((n=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||n===void 0?void 0:n.name)=="string"}function Yf(t){const e=Qf(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Tc(t,e){return Zf(t)?new t({message:e}):t({message:e})}class Cs extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}ye.AssertionError=Cs;function Kf(t,e="Assertion failed.",n=Cs){if(!t)throw e instanceof Error?e:Tc(n,e)}ye.assert=Kf;function Xf(t,e,n="Assertion failed",r=Cs){try{(0,Jf.assert)(t,e)}catch(i){throw Tc(r,`${n}: ${Yf(i)}.`)}}ye.assertStruct=Xf;function ed(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}ye.assertExhaustive=ed;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.base64=void 0;const td=Bt,nd=ye,rd=(t,e={})=>{var n,r;const i=(n=e.paddingRequired)!==null&&n!==void 0?n:!1,s=(r=e.characterSet)!==null&&r!==void 0?r:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,nd.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,td.pattern)(t,a)};Zn.base64=rd;var W={},Yn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Bt,n=ye;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function r(l){return(0,e.is)(l,t.HexStruct)}t.isHexString=r;function i(l){return(0,e.is)(l,t.StrictHexStruct)}t.isStrictHexString=i;function s(l){(0,n.assert)(r(l),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(l){(0,n.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}t.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}t.remove0x=c})(Yn);Object.defineProperty(W,"__esModule",{value:!0});W.createDataView=W.concatBytes=W.valueToBytes=W.stringToBytes=W.numberToBytes=W.signedBigIntToBytes=W.bigIntToBytes=W.hexToBytes=W.bytesToString=W.bytesToNumber=W.bytesToSignedBigInt=W.bytesToBigInt=W.bytesToHex=W.assertIsBytes=W.isBytes=void 0;const Ae=ye,es=Yn,Ro=48,Mo=58,To=87;function id(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const sd=id();function Is(t){return t instanceof Uint8Array}W.isBytes=Is;function vn(t){(0,Ae.assert)(Is(t),"Value must be a Uint8Array.")}W.assertIsBytes=vn;function Ac(t){if(vn(t),t.length===0)return"0x";const e=sd(),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return(0,es.add0x)(n.join(""))}W.bytesToHex=Ac;function Nc(t){vn(t);const e=Ac(t);return BigInt(e)}W.bytesToBigInt=Nc;function od(t){vn(t);let e=BigInt(0);for(const n of t)e=(e<<BigInt(8))+BigInt(n);return BigInt.asIntN(t.length*8,e)}W.bytesToSignedBigInt=od;function ad(t){vn(t);const e=Nc(t);return(0,Ae.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}W.bytesToNumber=ad;function cd(t){return vn(t),new TextDecoder().decode(t)}W.bytesToString=cd;function Wr(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,es.assertIsHexString)(t);const n=(0,es.remove0x)(t).toLowerCase(),r=n.length%2===0?n:`0${n}`,i=new Uint8Array(r.length/2);for(let s=0;s<i.length;s++){const o=r.charCodeAt(s*2),a=r.charCodeAt(s*2+1),c=o-(o<Mo?Ro:To),l=a-(a<Mo?Ro:To);i[s]=c*16+l}return i}W.hexToBytes=Wr;function Oc(t){(0,Ae.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ae.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Wr(e)}W.bigIntToBytes=Oc;function ud(t,e){(0,Ae.assert)(e>0);const n=t>>BigInt(31);return!((~t&n)+(t&~n)>>BigInt(e*8+-1))}function ld(t,e){(0,Ae.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ae.assert)(typeof e=="number","Byte length must be a number."),(0,Ae.assert)(e>0,"Byte length must be greater than 0."),(0,Ae.assert)(ud(t,e),"Byte length is too small to represent the given value.");let n=t;const r=new Uint8Array(e);for(let i=0;i<r.length;i++)r[i]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return r.reverse()}W.signedBigIntToBytes=ld;function Lc(t){(0,Ae.assert)(typeof t=="number","Value must be a number."),(0,Ae.assert)(t>=0,"Value must be a non-negative number."),(0,Ae.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Wr(e)}W.numberToBytes=Lc;function jc(t){return(0,Ae.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}W.stringToBytes=jc;function $c(t){if(typeof t=="bigint")return Oc(t);if(typeof t=="number")return Lc(t);if(typeof t=="string")return t.startsWith("0x")?Wr(t):jc(t);if(Is(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}W.valueToBytes=$c;function hd(t){const e=new Array(t.length);let n=0;for(let i=0;i<t.length;i++){const s=$c(t[i]);e[i]=s,n+=s.length}const r=new Uint8Array(n);for(let i=0,s=0;i<e.length;i++)r.set(e[i],s),s+=e[i].length;return r}W.concatBytes=hd;function fd(t){if(typeof U<"u"&&t instanceof U){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}W.createDataView=fd;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.ChecksumStruct=void 0;const Ao=Bt,dd=Zn;Ur.ChecksumStruct=(0,Ao.size)((0,dd.base64)((0,Ao.string)(),{paddingRequired:!0}),44,44);var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.createHex=nt.createBytes=nt.createBigInt=nt.createNumber=void 0;const ne=Bt,pd=ye,Dc=W,zr=Yn,Pc=(0,ne.union)([(0,ne.number)(),(0,ne.bigint)(),(0,ne.string)(),zr.StrictHexStruct]),bd=(0,ne.coerce)((0,ne.number)(),Pc,Number),gd=(0,ne.coerce)((0,ne.bigint)(),Pc,BigInt);(0,ne.union)([zr.StrictHexStruct,(0,ne.instance)(Uint8Array)]);const md=(0,ne.coerce)((0,ne.instance)(Uint8Array),(0,ne.union)([zr.StrictHexStruct]),Dc.hexToBytes),vd=(0,ne.coerce)(zr.StrictHexStruct,(0,ne.instance)(Uint8Array),Dc.bytesToHex);function yd(t){try{const e=(0,ne.create)(t,bd);return(0,pd.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof ne.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}nt.createNumber=yd;function wd(t){try{return(0,ne.create)(t,gd)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}nt.createBigInt=wd;function _d(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,ne.create)(t,md)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nt.createBytes=_d;function Sd(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,ne.create)(t,vd)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nt.createHex=Sd;var on={},Fc=O&&O.__classPrivateFieldSet||function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},Ee=O&&O.__classPrivateFieldGet||function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Ve,Ze;Object.defineProperty(on,"__esModule",{value:!0});on.FrozenSet=on.FrozenMap=void 0;class ks{constructor(e){Ve.set(this,void 0),Fc(this,Ve,new Map(e),"f"),Object.freeze(this)}get size(){return Ee(this,Ve,"f").size}[(Ve=new WeakMap,Symbol.iterator)](){return Ee(this,Ve,"f")[Symbol.iterator]()}entries(){return Ee(this,Ve,"f").entries()}forEach(e,n){return Ee(this,Ve,"f").forEach((r,i,s)=>e.call(n,r,i,this))}get(e){return Ee(this,Ve,"f").get(e)}has(e){return Ee(this,Ve,"f").has(e)}keys(){return Ee(this,Ve,"f").keys()}values(){return Ee(this,Ve,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,n])=>`${String(e)} => ${String(n)}`).join(", ")} `:""}}`}}on.FrozenMap=ks;class xs{constructor(e){Ze.set(this,void 0),Fc(this,Ze,new Set(e),"f"),Object.freeze(this)}get size(){return Ee(this,Ze,"f").size}[(Ze=new WeakMap,Symbol.iterator)](){return Ee(this,Ze,"f")[Symbol.iterator]()}entries(){return Ee(this,Ze,"f").entries()}forEach(e,n){return Ee(this,Ze,"f").forEach((r,i,s)=>e.call(n,r,i,this))}has(e){return Ee(this,Ze,"f").has(e)}keys(){return Ee(this,Ze,"f").keys()}values(){return Ee(this,Ze,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}on.FrozenSet=xs;Object.freeze(ks);Object.freeze(ks.prototype);Object.freeze(xs);Object.freeze(xs.prototype);var Bc={},Rs={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(l){return Array.isArray(l)&&l.length>0}t.isNonEmptyArray=e;function n(l){return l==null}t.isNullOrUndefined=n;function r(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}t.isObject=r;const i=(l,h)=>Object.hasOwnProperty.call(l,h);t.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let h=l;for(;Object.getPrototypeOf(h)!==null;)h=Object.getPrototypeOf(h);return Object.getPrototypeOf(l)===h}catch{return!1}}t.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}t.isASCII=o;function a(l){var h;return l.split("").reduce((d,f)=>o(f)?d+1:d+2,0)+((h=l.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&h!==void 0?h:[]).length}t.calculateStringSize=a;function c(l){return l.toString().length}t.calculateNumberSize=c})(Rs);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Bt,n=ye,r=Rs;t.JsonStruct=(0,e.define)("Json",y=>{const[T]=C(y,!0);return T?!0:"Expected a valid JSON-serializable value"});function i(y){return(0,e.is)(y,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(y){return(0,e.is)(y,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(y,T){(0,n.assertStruct)(y,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",T)}t.assertIsJsonRpcNotification=o;function a(y){return(0,e.is)(y,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(y,T){(0,n.assertStruct)(y,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",T)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function l(y){return(0,e.is)(y,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=l;function h(y,T){(0,n.assertStruct)(y,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",T)}t.assertIsPendingJsonRpcResponse=h;function u(y){return(0,e.is)(y,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=u;function d(y,T){(0,n.assertStruct)(y,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",T)}t.assertIsJsonRpcResponse=d;function f(y){return(0,e.is)(y,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=f;function p(y,T){(0,n.assertStruct)(y,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",T)}t.assertIsJsonRpcSuccess=p;function g(y){return(0,e.is)(y,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=g;function S(y,T){(0,n.assertStruct)(y,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",T)}t.assertIsJsonRpcFailure=S;function v(y){return(0,e.is)(y,t.JsonRpcErrorStruct)}t.isJsonRpcError=v;function m(y,T){(0,n.assertStruct)(y,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",T)}t.assertIsJsonRpcError=m;function E(y){const{permitEmptyString:T,permitFractions:F,permitNull:K}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},y);return V=>!!(typeof V=="number"&&(F||Number.isInteger(V))||typeof V=="string"&&(T||V.length>0)||K&&V===null)}t.getJsonRpcIdValidator=E;function C(y,T=!1){const F=new Set;function K(L,V){if(L===void 0)return[!1,0];if(L===null)return[!0,V?0:r.JsonSize.Null];const fe=typeof L;try{if(fe==="function")return[!1,0];if(fe==="string"||L instanceof String)return[!0,V?0:(0,r.calculateStringSize)(L)+r.JsonSize.Quote*2];if(fe==="boolean"||L instanceof Boolean)return V?[!0,0]:[!0,L==!0?r.JsonSize.True:r.JsonSize.False];if(fe==="number"||L instanceof Number)return V?[!0,0]:[!0,(0,r.calculateNumberSize)(L)];if(L instanceof Date)return V?[!0,0]:[!0,isNaN(L.getDate())?r.JsonSize.Null:r.JsonSize.Date+r.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,r.isPlainObject)(L)&&!Array.isArray(L))return[!1,0];if(F.has(L))return[!1,0];F.add(L);try{return[!0,Object.entries(L).reduce((q,[_,w],M,k)=>{let[A,x]=K(w,V);if(!A)throw new Error("JSON validation did not pass. Validation process stopped.");if(F.delete(L),V)return 0;const $=Array.isArray(L)?0:_.length+r.JsonSize.Comma+r.JsonSize.Colon*2,G=M<k.length-1?r.JsonSize.Comma:0;return q+$+x+G},V?0:r.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return K(y,T)}t.validateJsonAndGetSize=C})(Bc);var an={},ts={exports:{}},Mi,No;function Ed(){if(No)return Mi;No=1;var t=1e3,e=t*60,n=e*60,r=n*24,i=r*7,s=r*365.25;Mi=function(h,u){u=u||{};var d=typeof h;if(d==="string"&&h.length>0)return o(h);if(d==="number"&&isFinite(h))return u.long?c(h):a(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function o(h){if(h=String(h),!(h.length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(u){var d=parseFloat(u[1]),f=(u[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return d*s;case"weeks":case"week":case"w":return d*i;case"days":case"day":case"d":return d*r;case"hours":case"hour":case"hrs":case"hr":case"h":return d*n;case"minutes":case"minute":case"mins":case"min":case"m":return d*e;case"seconds":case"second":case"secs":case"sec":case"s":return d*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function a(h){var u=Math.abs(h);return u>=r?Math.round(h/r)+"d":u>=n?Math.round(h/n)+"h":u>=e?Math.round(h/e)+"m":u>=t?Math.round(h/t)+"s":h+"ms"}function c(h){var u=Math.abs(h);return u>=r?l(h,u,r,"day"):u>=n?l(h,u,n,"hour"):u>=e?l(h,u,e,"minute"):u>=t?l(h,u,t,"second"):h+" ms"}function l(h,u,d,f){var p=u>=d*1.5;return Math.round(h/d)+" "+f+(p?"s":"")}return Mi}function Cd(t){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=i,n.enabled=o,n.humanize=Ed(),n.destroy=l,Object.keys(t).forEach(h=>{n[h]=t[h]}),n.names=[],n.skips=[],n.formatters={};function e(h){let u=0;for(let d=0;d<h.length;d++)u=(u<<5)-u+h.charCodeAt(d),u|=0;return n.colors[Math.abs(u)%n.colors.length]}n.selectColor=e;function n(h){let u,d=null,f,p;function g(...S){if(!g.enabled)return;const v=g,m=Number(new Date),E=m-(u||m);v.diff=E,v.prev=u,v.curr=m,u=m,S[0]=n.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let C=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(T,F)=>{if(T==="%%")return"%";C++;const K=n.formatters[F];if(typeof K=="function"){const L=S[C];T=K.call(v,L),S.splice(C,1),C--}return T}),n.formatArgs.call(v,S),(v.log||n.log).apply(v,S)}return g.namespace=h,g.useColors=n.useColors(),g.color=n.selectColor(h),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(f!==n.namespaces&&(f=n.namespaces,p=n.enabled(h)),p),set:S=>{d=S}}),typeof n.init=="function"&&n.init(g),g}function r(h,u){const d=n(this.namespace+(typeof u>"u"?":":u)+h);return d.log=this.log,d}function i(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let u;const d=(typeof h=="string"?h:"").split(/[\s,]+/),f=d.length;for(u=0;u<f;u++)d[u]&&(h=d[u].replace(/\*/g,".*?"),h[0]==="-"?n.skips.push(new RegExp("^"+h.slice(1)+"$")):n.names.push(new RegExp("^"+h+"$")))}function s(){const h=[...n.names.map(a),...n.skips.map(a).map(u=>"-"+u)].join(",");return n.enable(""),h}function o(h){if(h[h.length-1]==="*")return!0;let u,d;for(u=0,d=n.skips.length;u<d;u++)if(n.skips[u].test(h))return!1;for(u=0,d=n.names.length;u<d;u++)if(n.names[u].test(h))return!0;return!1}function a(h){return h.toString().substring(2,h.toString().length-2).replace(/\.\*\?$/,"*")}function c(h){return h instanceof Error?h.stack||h.message:h}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var Id=Cd;(function(t,e){e.formatArgs=r,e.save=i,e.load=s,e.useColors=n,e.storage=o(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let h=0,u=0;c[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(h++,d==="%c"&&(u=h))}),c.splice(u,0,l)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof Yi<"u"&&"env"in Yi&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=Id(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(ts,ts.exports);var kd=ts.exports,xd=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(an,"__esModule",{value:!0});an.createModuleLogger=an.createProjectLogger=void 0;const Rd=xd(kd),Md=(0,Rd.default)("metamask");function Td(t){return Md.extend(t)}an.createProjectLogger=Td;function Ad(t,e){return t.extend(e)}an.createModuleLogger=Ad;var rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.hexToBigInt=rt.hexToNumber=rt.bigIntToHex=rt.numberToHex=void 0;const Kt=ye,Dn=Yn,Nd=t=>((0,Kt.assert)(typeof t=="number","Value must be a number."),(0,Kt.assert)(t>=0,"Value must be a non-negative number."),(0,Kt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Dn.add0x)(t.toString(16)));rt.numberToHex=Nd;const Od=t=>((0,Kt.assert)(typeof t=="bigint","Value must be a bigint."),(0,Kt.assert)(t>=0,"Value must be a non-negative bigint."),(0,Dn.add0x)(t.toString(16)));rt.bigIntToHex=Od;const Ld=t=>{(0,Dn.assertIsHexString)(t);const e=parseInt(t,16);return(0,Kt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};rt.hexToNumber=Ld;const jd=t=>((0,Dn.assertIsHexString)(t),BigInt((0,Dn.add0x)(t)));rt.hexToBigInt=jd;var Vc={};Object.defineProperty(Vc,"__esModule",{value:!0});var Hc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,n=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function r(s,o){return n(s,"count"),s*o}t.inMilliseconds=r;function i(s){return n(s,"timestamp"),Date.now()-s}t.timeSince=i})(Hc);var Wc={},ns={exports:{}};const $d="2.0.0",Uc=256,Dd=Number.MAX_SAFE_INTEGER||9007199254740991,Pd=16,Fd=Uc-6,Bd=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var qr={MAX_LENGTH:Uc,MAX_SAFE_COMPONENT_LENGTH:Pd,MAX_SAFE_BUILD_LENGTH:Fd,MAX_SAFE_INTEGER:Dd,RELEASE_TYPES:Bd,SEMVER_SPEC_VERSION:$d,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Vd=typeof Yi=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Gr=Vd;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r}=qr,i=Gr;e=t.exports={};const s=e.re=[],o=e.safeRe=[],a=e.src=[],c=e.t={};let l=0;const h="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",n],[h,r]],d=p=>{for(const[g,S]of u)p=p.split(`${g}*`).join(`${g}{0,${S}}`).split(`${g}+`).join(`${g}{1,${S}}`);return p},f=(p,g,S)=>{const v=d(g),m=l++;i(p,m,g),c[p]=m,a[m]=g,s[m]=new RegExp(g,S?"g":void 0),o[m]=new RegExp(v,S?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),f("MAINVERSION",`(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${a[c.NUMERICIDENTIFIER]}|${a[c.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${a[c.NUMERICIDENTIFIERLOOSE]}|${a[c.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${a[c.PRERELEASEIDENTIFIER]}(?:\\.${a[c.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${a[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[c.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${h}+`),f("BUILD",`(?:\\+(${a[c.BUILDIDENTIFIER]}(?:\\.${a[c.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${a[c.MAINVERSION]}${a[c.PRERELEASE]}?${a[c.BUILD]}?`),f("FULL",`^${a[c.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${a[c.MAINVERSIONLOOSE]}${a[c.PRERELEASELOOSE]}?${a[c.BUILD]}?`),f("LOOSE",`^${a[c.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${a[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${a[c.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:${a[c.PRERELEASE]})?${a[c.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:${a[c.PRERELEASELOOSE]})?${a[c.BUILD]}?)?)?`),f("XRANGE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAINLOOSE]}$`),f("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),f("COERCERTL",a[c.COERCE],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${a[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",f("TILDE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${a[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",f("CARET",`^${a[c.LONECARET]}${a[c.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${a[c.LONECARET]}${a[c.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${a[c.GTLT]}\\s*(${a[c.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]}|${a[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${a[c.XRANGEPLAIN]})\\s+-\\s+(${a[c.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${a[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[c.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ns,ns.exports);var Kn=ns.exports;const Hd=Object.freeze({loose:!0}),Wd=Object.freeze({}),Ud=t=>t?typeof t!="object"?Hd:t:Wd;var Ms=Ud;const Oo=/^[0-9]+$/,zc=(t,e)=>{const n=Oo.test(t),r=Oo.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},zd=(t,e)=>zc(e,t);var qc={compareIdentifiers:zc,rcompareIdentifiers:zd};const lr=Gr,{MAX_LENGTH:Lo,MAX_SAFE_INTEGER:hr}=qr,{safeRe:jo,t:$o}=Kn,qd=Ms,{compareIdentifiers:Wt}=qc;let Gd=class Ke{constructor(e,n){if(n=qd(n),e instanceof Ke){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Lo)throw new TypeError(`version is longer than ${Lo} characters`);lr("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?jo[$o.LOOSE]:jo[$o.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>hr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hr||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<hr)return s}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(lr("SemVer.compare",this.version,this.options,e),!(e instanceof Ke)){if(typeof e=="string"&&e===this.version)return 0;e=new Ke(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Ke||(e=new Ke(e,this.options)),Wt(this.major,e.major)||Wt(this.minor,e.minor)||Wt(this.patch,e.patch)}comparePre(e){if(e instanceof Ke||(e=new Ke(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=e.prerelease[n];if(lr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Wt(r,i)}while(++n)}compareBuild(e){e instanceof Ke||(e=new Ke(e,this.options));let n=0;do{const r=this.build[n],i=e.build[n];if(lr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Wt(r,i)}while(++n)}inc(e,n,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(r)?1:0;if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let s=[n,i];r===!1&&(s=[n]),Wt(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var ke=Gd;const Do=ke,Jd=(t,e,n=!1)=>{if(t instanceof Do)return t;try{return new Do(t,e)}catch(r){if(!n)return null;throw r}};var yn=Jd;const Qd=yn,Zd=(t,e)=>{const n=Qd(t,e);return n?n.version:null};var Yd=Zd;const Kd=yn,Xd=(t,e)=>{const n=Kd(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};var ep=Xd;const Po=ke,tp=(t,e,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new Po(t instanceof Po?t.version:t,n).inc(e,r,i).version}catch{return null}};var np=tp;const Fo=yn,rp=(t,e)=>{const n=Fo(t,null,!0),r=Fo(e,null,!0),i=n.compare(r);if(i===0)return null;const s=i>0,o=s?n:r,a=s?r:n,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const h=c?"pre":"";return n.major!==r.major?h+"major":n.minor!==r.minor?h+"minor":n.patch!==r.patch?h+"patch":"prerelease"};var ip=rp;const sp=ke,op=(t,e)=>new sp(t,e).major;var ap=op;const cp=ke,up=(t,e)=>new cp(t,e).minor;var lp=up;const hp=ke,fp=(t,e)=>new hp(t,e).patch;var dp=fp;const pp=yn,bp=(t,e)=>{const n=pp(t,e);return n&&n.prerelease.length?n.prerelease:null};var gp=bp;const Bo=ke,mp=(t,e,n)=>new Bo(t,n).compare(new Bo(e,n));var Ge=mp;const vp=Ge,yp=(t,e,n)=>vp(e,t,n);var wp=yp;const _p=Ge,Sp=(t,e)=>_p(t,e,!0);var Ep=Sp;const Vo=ke,Cp=(t,e,n)=>{const r=new Vo(t,n),i=new Vo(e,n);return r.compare(i)||r.compareBuild(i)};var Ts=Cp;const Ip=Ts,kp=(t,e)=>t.sort((n,r)=>Ip(n,r,e));var xp=kp;const Rp=Ts,Mp=(t,e)=>t.sort((n,r)=>Rp(r,n,e));var Tp=Mp;const Ap=Ge,Np=(t,e,n)=>Ap(t,e,n)>0;var Jr=Np;const Op=Ge,Lp=(t,e,n)=>Op(t,e,n)<0;var As=Lp;const jp=Ge,$p=(t,e,n)=>jp(t,e,n)===0;var Gc=$p;const Dp=Ge,Pp=(t,e,n)=>Dp(t,e,n)!==0;var Jc=Pp;const Fp=Ge,Bp=(t,e,n)=>Fp(t,e,n)>=0;var Ns=Bp;const Vp=Ge,Hp=(t,e,n)=>Vp(t,e,n)<=0;var Os=Hp;const Wp=Gc,Up=Jc,zp=Jr,qp=Ns,Gp=As,Jp=Os,Qp=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Wp(t,n,r);case"!=":return Up(t,n,r);case">":return zp(t,n,r);case">=":return qp(t,n,r);case"<":return Gp(t,n,r);case"<=":return Jp(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};var Qc=Qp;const Zp=ke,Yp=yn,{safeRe:fr,t:dr}=Kn,Kp=(t,e)=>{if(t instanceof Zp)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(fr[dr.COERCE]);else{let r;for(;(r=fr[dr.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||r.index+r[0].length!==n.index+n[0].length)&&(n=r),fr[dr.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;fr[dr.COERCERTL].lastIndex=-1}return n===null?null:Yp(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,e)};var Xp=Kp,Ti,Ho;function e0(){return Ho||(Ho=1,Ti=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ti}var t0=z;z.Node=jt;z.create=z;function z(t){var e=this;if(e instanceof z||(e=new z),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}z.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e};z.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};z.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};z.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)r0(this,arguments[t]);return this.length};z.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)i0(this,arguments[t]);return this.length};z.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};z.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};z.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;n!==null;r++)t.call(e,n.value,r,this),n=n.next};z.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;n!==null;r--)t.call(e,n.value,r,this),n=n.prev};z.prototype.get=function(t){for(var e=0,n=this.head;n!==null&&e<t;e++)n=n.next;if(e===t&&n!==null)return n.value};z.prototype.getReverse=function(t){for(var e=0,n=this.tail;n!==null&&e<t;e++)n=n.prev;if(e===t&&n!==null)return n.value};z.prototype.map=function(t,e){e=e||this;for(var n=new z,r=this.head;r!==null;)n.push(t.call(e,r.value,this)),r=r.next;return n};z.prototype.mapReverse=function(t,e){e=e||this;for(var n=new z,r=this.tail;r!==null;)n.push(t.call(e,r.value,this)),r=r.prev;return n};z.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=t(n,r.value,i),r=r.next;return n};z.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=t(n,r.value,i),r=r.prev;return n};z.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};z.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};z.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(;i!==null&&r<e;r++,i=i.next)n.push(i.value);return n};z.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;i!==null&&r>e;r--)i=i.prev;for(;i!==null&&r>t;r--,i=i.prev)n.push(i.value);return n};z.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(var s=[],r=0;i&&r<e;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=n0(this,i,n[r]);return s};z.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};function n0(t,e,n){var r=e===t.head?new jt(n,null,e,t):new jt(n,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function r0(t,e){t.tail=new jt(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function i0(t,e){t.head=new jt(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function jt(t,e,n,r){if(!(this instanceof jt))return new jt(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{e0()(z)}catch{}const s0=t0,Tt=Symbol("max"),ut=Symbol("length"),Ut=Symbol("lengthCalculator"),Nn=Symbol("allowStale"),Ot=Symbol("maxAge"),at=Symbol("dispose"),Wo=Symbol("noDisposeOnSet"),pe=Symbol("lruList"),Ue=Symbol("cache"),Zc=Symbol("updateAgeOnGet"),Ai=()=>1;class o0{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[Tt]=e.max||1/0;const n=e.length||Ai;if(this[Ut]=typeof n!="function"?Ai:n,this[Nn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Ot]=e.maxAge||0,this[at]=e.dispose,this[Wo]=e.noDisposeOnSet||!1,this[Zc]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Tt]=e||1/0,In(this)}get max(){return this[Tt]}set allowStale(e){this[Nn]=!!e}get allowStale(){return this[Nn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Ot]=e,In(this)}get maxAge(){return this[Ot]}set lengthCalculator(e){typeof e!="function"&&(e=Ai),e!==this[Ut]&&(this[Ut]=e,this[ut]=0,this[pe].forEach(n=>{n.length=this[Ut](n.value,n.key),this[ut]+=n.length})),In(this)}get lengthCalculator(){return this[Ut]}get length(){return this[ut]}get itemCount(){return this[pe].length}rforEach(e,n){n=n||this;for(let r=this[pe].tail;r!==null;){const i=r.prev;Uo(this,e,r,n),r=i}}forEach(e,n){n=n||this;for(let r=this[pe].head;r!==null;){const i=r.next;Uo(this,e,r,n),r=i}}keys(){return this[pe].toArray().map(e=>e.key)}values(){return this[pe].toArray().map(e=>e.value)}reset(){this[at]&&this[pe]&&this[pe].length&&this[pe].forEach(e=>this[at](e.key,e.value)),this[Ue]=new Map,this[pe]=new s0,this[ut]=0}dump(){return this[pe].map(e=>Cr(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[pe]}set(e,n,r){if(r=r||this[Ot],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[Ut](n,e);if(this[Ue].has(e)){if(s>this[Tt])return Xt(this,this[Ue].get(e)),!1;const c=this[Ue].get(e).value;return this[at]&&(this[Wo]||this[at](e,c.value)),c.now=i,c.maxAge=r,c.value=n,this[ut]+=s-c.length,c.length=s,this.get(e),In(this),!0}const o=new a0(e,n,s,i,r);return o.length>this[Tt]?(this[at]&&this[at](e,n),!1):(this[ut]+=o.length,this[pe].unshift(o),this[Ue].set(e,this[pe].head),In(this),!0)}has(e){if(!this[Ue].has(e))return!1;const n=this[Ue].get(e).value;return!Cr(this,n)}get(e){return Ni(this,e,!0)}peek(e){return Ni(this,e,!1)}pop(){const e=this[pe].tail;return e?(Xt(this,e),e.value):null}del(e){Xt(this,this[Ue].get(e))}load(e){this.reset();const n=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-n;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Ue].forEach((e,n)=>Ni(this,n,!1))}}const Ni=(t,e,n)=>{const r=t[Ue].get(e);if(r){const i=r.value;if(Cr(t,i)){if(Xt(t,r),!t[Nn])return}else n&&(t[Zc]&&(r.value.now=Date.now()),t[pe].unshiftNode(r));return i.value}},Cr=(t,e)=>{if(!e||!e.maxAge&&!t[Ot])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Ot]&&n>t[Ot]},In=t=>{if(t[ut]>t[Tt])for(let e=t[pe].tail;t[ut]>t[Tt]&&e!==null;){const n=e.prev;Xt(t,e),e=n}},Xt=(t,e)=>{if(e){const n=e.value;t[at]&&t[at](n.key,n.value),t[ut]-=n.length,t[Ue].delete(n.key),t[pe].removeNode(e)}};class a0{constructor(e,n,r,i,s){this.key=e,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Uo=(t,e,n,r)=>{let i=n.value;Cr(t,i)&&(Xt(t,n),t[Nn]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};var c0=o0,Oi,zo;function Je(){if(zo)return Oi;zo=1;class t{constructor(w,M){if(M=r(M),w instanceof t)return w.loose===!!M.loose&&w.includePrerelease===!!M.includePrerelease?w:new t(w.raw,M);if(w instanceof i)return this.raw=w.value,this.set=[[w]],this.format(),this;if(this.options=M,this.loose=!!M.loose,this.includePrerelease=!!M.includePrerelease,this.raw=w.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(k=>this.parseRange(k)).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(A=>!p(A[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const A of this.set)if(A.length===1&&g(A[0])){this.set=[A];break}}}this.format()}format(){return this.range=this.set.map(w=>w.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(w){const k=((this.options.includePrerelease&&d)|(this.options.loose&&f))+":"+w,A=n.get(k);if(A)return A;const x=this.options.loose,$=x?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];w=w.replace($,fe(this.options.includePrerelease)),s("hyphen replace",w),w=w.replace(a[c.COMPARATORTRIM],l),s("comparator trim",w),w=w.replace(a[c.TILDETRIM],h),s("tilde trim",w),w=w.replace(a[c.CARETTRIM],u),s("caret trim",w);let G=w.split(" ").map(ce=>v(ce,this.options)).join(" ").split(/\s+/).map(ce=>V(ce,this.options));x&&(G=G.filter(ce=>(s("loose invalid filter",ce,this.options),!!ce.match(a[c.COMPARATORLOOSE])))),s("range list",G);const B=new Map,ee=G.map(ce=>new i(ce,this.options));for(const ce of ee){if(p(ce))return[ce];B.set(ce.value,ce)}B.size>1&&B.has("")&&B.delete("");const Me=[...B.values()];return n.set(k,Me),Me}intersects(w,M){if(!(w instanceof t))throw new TypeError("a Range is required");return this.set.some(k=>S(k,M)&&w.set.some(A=>S(A,M)&&k.every(x=>A.every($=>x.intersects($,M)))))}test(w){if(!w)return!1;if(typeof w=="string")try{w=new o(w,this.options)}catch{return!1}for(let M=0;M<this.set.length;M++)if(q(this.set[M],w,this.options))return!0;return!1}}Oi=t;const e=c0,n=new e({max:1e3}),r=Ms,i=Qr(),s=Gr,o=ke,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:h,caretTrimReplace:u}=Kn,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:f}=qr,p=_=>_.value==="<0.0.0-0",g=_=>_.value==="",S=(_,w)=>{let M=!0;const k=_.slice();let A=k.pop();for(;M&&k.length;)M=k.every(x=>A.intersects(x,w)),A=k.pop();return M},v=(_,w)=>(s("comp",_,w),_=y(_,w),s("caret",_),_=E(_,w),s("tildes",_),_=F(_,w),s("xrange",_),_=L(_,w),s("stars",_),_),m=_=>!_||_.toLowerCase()==="x"||_==="*",E=(_,w)=>_.trim().split(/\s+/).map(M=>C(M,w)).join(" "),C=(_,w)=>{const M=w.loose?a[c.TILDELOOSE]:a[c.TILDE];return _.replace(M,(k,A,x,$,G)=>{s("tilde",_,k,A,x,$,G);let B;return m(A)?B="":m(x)?B=`>=${A}.0.0 <${+A+1}.0.0-0`:m($)?B=`>=${A}.${x}.0 <${A}.${+x+1}.0-0`:G?(s("replaceTilde pr",G),B=`>=${A}.${x}.${$}-${G} <${A}.${+x+1}.0-0`):B=`>=${A}.${x}.${$} <${A}.${+x+1}.0-0`,s("tilde return",B),B})},y=(_,w)=>_.trim().split(/\s+/).map(M=>T(M,w)).join(" "),T=(_,w)=>{s("caret",_,w);const M=w.loose?a[c.CARETLOOSE]:a[c.CARET],k=w.includePrerelease?"-0":"";return _.replace(M,(A,x,$,G,B)=>{s("caret",_,A,x,$,G,B);let ee;return m(x)?ee="":m($)?ee=`>=${x}.0.0${k} <${+x+1}.0.0-0`:m(G)?x==="0"?ee=`>=${x}.${$}.0${k} <${x}.${+$+1}.0-0`:ee=`>=${x}.${$}.0${k} <${+x+1}.0.0-0`:B?(s("replaceCaret pr",B),x==="0"?$==="0"?ee=`>=${x}.${$}.${G}-${B} <${x}.${$}.${+G+1}-0`:ee=`>=${x}.${$}.${G}-${B} <${x}.${+$+1}.0-0`:ee=`>=${x}.${$}.${G}-${B} <${+x+1}.0.0-0`):(s("no pr"),x==="0"?$==="0"?ee=`>=${x}.${$}.${G}${k} <${x}.${$}.${+G+1}-0`:ee=`>=${x}.${$}.${G}${k} <${x}.${+$+1}.0-0`:ee=`>=${x}.${$}.${G} <${+x+1}.0.0-0`),s("caret return",ee),ee})},F=(_,w)=>(s("replaceXRanges",_,w),_.split(/\s+/).map(M=>K(M,w)).join(" ")),K=(_,w)=>{_=_.trim();const M=w.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return _.replace(M,(k,A,x,$,G,B)=>{s("xRange",_,k,A,x,$,G,B);const ee=m(x),Me=ee||m($),ce=Me||m(G),Cn=ce;return A==="="&&Cn&&(A=""),B=w.includePrerelease?"-0":"",ee?A===">"||A==="<"?k="<0.0.0-0":k="*":A&&Cn?(Me&&($=0),G=0,A===">"?(A=">=",Me?(x=+x+1,$=0,G=0):($=+$+1,G=0)):A==="<="&&(A="<",Me?x=+x+1:$=+$+1),A==="<"&&(B="-0"),k=`${A+x}.${$}.${G}${B}`):Me?k=`>=${x}.0.0${B} <${+x+1}.0.0-0`:ce&&(k=`>=${x}.${$}.0${B} <${x}.${+$+1}.0-0`),s("xRange return",k),k})},L=(_,w)=>(s("replaceStars",_,w),_.trim().replace(a[c.STAR],"")),V=(_,w)=>(s("replaceGTE0",_,w),_.trim().replace(a[w.includePrerelease?c.GTE0PRE:c.GTE0],"")),fe=_=>(w,M,k,A,x,$,G,B,ee,Me,ce,Cn,j2)=>(m(k)?M="":m(A)?M=`>=${k}.0.0${_?"-0":""}`:m(x)?M=`>=${k}.${A}.0${_?"-0":""}`:$?M=`>=${M}`:M=`>=${M}${_?"-0":""}`,m(ee)?B="":m(Me)?B=`<${+ee+1}.0.0-0`:m(ce)?B=`<${ee}.${+Me+1}.0-0`:Cn?B=`<=${ee}.${Me}.${ce}-${Cn}`:_?B=`<${ee}.${Me}.${+ce+1}-0`:B=`<=${B}`,`${M} ${B}`.trim()),q=(_,w,M)=>{for(let k=0;k<_.length;k++)if(!_[k].test(w))return!1;if(w.prerelease.length&&!M.includePrerelease){for(let k=0;k<_.length;k++)if(s(_[k].semver),_[k].semver!==i.ANY&&_[k].semver.prerelease.length>0){const A=_[k].semver;if(A.major===w.major&&A.minor===w.minor&&A.patch===w.patch)return!0}return!1}return!0};return Oi}var Li,qo;function Qr(){if(qo)return Li;qo=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(h,u){if(u=n(u),h instanceof e){if(h.loose===!!u.loose)return h;h=h.value}h=h.trim().split(/\s+/).join(" "),o("comparator",h,u),this.options=u,this.loose=!!u.loose,this.parse(h),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(h){const u=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=h.match(u);if(!d)throw new TypeError(`Invalid comparator: ${h}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=t}toString(){return this.value}test(h){if(o("Comparator.test",h,this.options.loose),this.semver===t||h===t)return!0;if(typeof h=="string")try{h=new a(h,this.options)}catch{return!1}return s(h,this.operator,this.semver,this.options)}intersects(h,u){if(!(h instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(h.value,u).test(this.value):h.operator===""?h.value===""?!0:new c(this.value,u).test(h.semver):(u=n(u),u.includePrerelease&&(this.value==="<0.0.0-0"||h.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||h.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&h.operator.startsWith(">")||this.operator.startsWith("<")&&h.operator.startsWith("<")||this.semver.version===h.semver.version&&this.operator.includes("=")&&h.operator.includes("=")||s(this.semver,"<",h.semver,u)&&this.operator.startsWith(">")&&h.operator.startsWith("<")||s(this.semver,">",h.semver,u)&&this.operator.startsWith("<")&&h.operator.startsWith(">")))}}Li=e;const n=Ms,{safeRe:r,t:i}=Kn,s=Qc,o=Gr,a=ke,c=Je();return Li}const u0=Je(),l0=(t,e,n)=>{try{e=new u0(e,n)}catch{return!1}return e.test(t)};var Zr=l0;const h0=Je(),f0=(t,e)=>new h0(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));var d0=f0;const p0=ke,b0=Je(),g0=(t,e,n)=>{let r=null,i=null,s=null;try{s=new b0(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new p0(r,n))}),r};var m0=g0;const v0=ke,y0=Je(),w0=(t,e,n)=>{let r=null,i=null,s=null;try{s=new y0(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new v0(r,n))}),r};var _0=w0;const ji=ke,S0=Je(),Go=Jr,E0=(t,e)=>{t=new S0(t,e);let n=new ji("0.0.0");if(t.test(n)||(n=new ji("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){const i=t.set[r];let s=null;i.forEach(o=>{const a=new ji(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Go(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!n||Go(n,s))&&(n=s)}return n&&t.test(n)?n:null};var C0=E0;const I0=Je(),k0=(t,e)=>{try{return new I0(t,e).range||"*"}catch{return null}};var x0=k0;const R0=ke,Yc=Qr(),{ANY:M0}=Yc,T0=Je(),A0=Zr,Jo=Jr,Qo=As,N0=Os,O0=Ns,L0=(t,e,n,r)=>{t=new R0(t,r),e=new T0(e,r);let i,s,o,a,c;switch(n){case">":i=Jo,s=N0,o=Qo,a=">",c=">=";break;case"<":i=Qo,s=O0,o=Jo,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(A0(t,e,r))return!1;for(let l=0;l<e.set.length;++l){const h=e.set[l];let u=null,d=null;if(h.forEach(f=>{f.semver===M0&&(f=new Yc(">=0.0.0")),u=u||f,d=d||f,i(f.semver,u.semver,r)?u=f:o(f.semver,d.semver,r)&&(d=f)}),u.operator===a||u.operator===c||(!d.operator||d.operator===a)&&s(t,d.semver))return!1;if(d.operator===c&&o(t,d.semver))return!1}return!0};var Ls=L0;const j0=Ls,$0=(t,e,n)=>j0(t,e,">",n);var D0=$0;const P0=Ls,F0=(t,e,n)=>P0(t,e,"<",n);var B0=F0;const Zo=Je(),V0=(t,e,n)=>(t=new Zo(t,n),e=new Zo(e,n),t.intersects(e,n));var H0=V0;const W0=Zr,U0=Ge;var z0=(t,e,n)=>{const r=[];let i=null,s=null;const o=t.sort((h,u)=>U0(h,u,n));for(const h of o)W0(h,e,n)?(s=h,i||(i=h)):(s&&r.push([i,s]),s=null,i=null);i&&r.push([i,null]);const a=[];for(const[h,u]of r)h===u?a.push(h):!u&&h===o[0]?a.push("*"):u?h===o[0]?a.push(`<=${u}`):a.push(`${h} - ${u}`):a.push(`>=${h}`);const c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e};const Yo=Je(),js=Qr(),{ANY:$i}=js,kn=Zr,$s=Ge,q0=(t,e,n={})=>{if(t===e)return!0;t=new Yo(t,n),e=new Yo(e,n);let r=!1;e:for(const i of t.set){for(const s of e.set){const o=J0(i,s,n);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},G0=[new js(">=0.0.0-0")],Ko=[new js(">=0.0.0")],J0=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===$i){if(e.length===1&&e[0].semver===$i)return!0;n.includePrerelease?t=G0:t=Ko}if(e.length===1&&e[0].semver===$i){if(n.includePrerelease)return!0;e=Ko}const r=new Set;let i,s;for(const f of t)f.operator===">"||f.operator===">="?i=Xo(i,f,n):f.operator==="<"||f.operator==="<="?s=ea(s,f,n):r.add(f.semver);if(r.size>1)return null;let o;if(i&&s){if(o=$s(i.semver,s.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const f of r){if(i&&!kn(f,String(i),n)||s&&!kn(f,String(s),n))return null;for(const p of e)if(!kn(f,String(p),n))return!1;return!0}let a,c,l,h,u=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;u&&u.prerelease.length===1&&s.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(const f of e){if(h=h||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",i){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator===">"||f.operator===">="){if(a=Xo(i,f,n),a===f&&a!==i)return!1}else if(i.operator===">="&&!kn(i.semver,String(f),n))return!1}if(s){if(u&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===u.major&&f.semver.minor===u.minor&&f.semver.patch===u.patch&&(u=!1),f.operator==="<"||f.operator==="<="){if(c=ea(s,f,n),c===f&&c!==s)return!1}else if(s.operator==="<="&&!kn(s.semver,String(f),n))return!1}if(!f.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&h&&!i&&o!==0||d||u)},Xo=(t,e,n)=>{if(!t)return e;const r=$s(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},ea=(t,e,n)=>{if(!t)return e;const r=$s(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};var Q0=q0;const Di=Kn,ta=qr,Z0=ke,na=qc,Y0=yn,K0=Yd,X0=ep,eb=np,tb=ip,nb=ap,rb=lp,ib=dp,sb=gp,ob=Ge,ab=wp,cb=Ep,ub=Ts,lb=xp,hb=Tp,fb=Jr,db=As,pb=Gc,bb=Jc,gb=Ns,mb=Os,vb=Qc,yb=Xp,wb=Qr(),_b=Je(),Sb=Zr,Eb=d0,Cb=m0,Ib=_0,kb=C0,xb=x0,Rb=Ls,Mb=D0,Tb=B0,Ab=H0,Nb=z0,Ob=Q0;var Lb={parse:Y0,valid:K0,clean:X0,inc:eb,diff:tb,major:nb,minor:rb,patch:ib,prerelease:sb,compare:ob,rcompare:ab,compareLoose:cb,compareBuild:ub,sort:lb,rsort:hb,gt:fb,lt:db,eq:pb,neq:bb,gte:gb,lte:mb,cmp:vb,coerce:yb,Comparator:wb,Range:_b,satisfies:Sb,toComparators:Eb,maxSatisfying:Cb,minSatisfying:Ib,minVersion:kb,validRange:xb,outside:Rb,gtr:Mb,ltr:Tb,intersects:Ab,simplifyRange:Nb,subset:Ob,SemVer:Z0,re:Di.re,src:Di.src,tokens:Di.t,SEMVER_SPEC_VERSION:ta.SEMVER_SPEC_VERSION,RELEASE_TYPES:ta.RELEASE_TYPES,compareIdentifiers:na.compareIdentifiers,rcompareIdentifiers:na.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=Lb,n=Bt,r=ye;t.VersionStruct=(0,n.refine)((0,n.string)(),"Version",u=>(0,e.valid)(u)===null?`Expected SemVer version, got "${u}"`:!0),t.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",u=>(0,e.validRange)(u)===null?`Expected SemVer range, got "${u}"`:!0);function i(u){return(0,n.is)(u,t.VersionStruct)}t.isValidSemVerVersion=i;function s(u){return(0,n.is)(u,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(u){(0,r.assertStruct)(u,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(u){(0,r.assertStruct)(u,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(u,d){return(0,e.gt)(u,d)}t.gtVersion=c;function l(u,d){return(0,e.gtr)(u,d)}t.gtRange=l;function h(u,d){return(0,e.satisfies)(u,d,{includePrerelease:!0})}t.satisfiesVersionRange=h})(Wc);(function(t){var e=O&&O.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=O&&O.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(ye,t),n(Zn,t),n(W,t),n(Ur,t),n(nt,t),n(on,t),n(Yn,t),n(Bc,t),n(an,t),n(Rs,t),n(rt,t),n(Vc,t),n(Hc,t),n(Wc,t)})(_c);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=_c;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(wc);var Kc=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.PollingBlockTracker=void 0;const jb=Kc(Ja),$b=Kc(xl),Db=Jn,ra=wc,ia=(0,ra.createModuleLogger)(ra.projectLogger,"polling-block-tracker"),Pb=(0,jb.default)(),Fb=1e3;class Bb extends Db.BaseBlockTracker{constructor(e={}){var n;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(n=e.blockResetDuration)!==null&&n!==void 0?n:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*Fb,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const n=sa(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}catch(n){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
1
+ import{d as El,s as Cl,c as O,b as Or,B as U,a as Il,j as kl,e as Lr,g as Hn,f as Yi,h as Ja,p as xl,i as Rl,l as Ml,k as Qa,_ as b,r as jr,m as Tl}from"./index-eaf6aff8.js";function Al(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var bs={},$n={},$r={};Object.defineProperty($r,"__esModule",{value:!0});$r.walletLogo=void 0;const Nl=(t,e)=>{let n;switch(t){case"standard":return n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 n=e,`data:image/svg+xml,%3Csvg width='${e}' height='${n}' 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 `}};$r.walletLogo=Nl;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.ScopedLocalStorage=void 0;class Ol{constructor(e){this.scope=e}setItem(e,n){localStorage.setItem(this.scopedKey(e),n)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),n=[];for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);typeof i=="string"&&i.startsWith(e)&&n.push(i)}n.forEach(r=>localStorage.removeItem(r))}scopedKey(e){return`${this.scope}:${e}`}}Dr.ScopedLocalStorage=Ol;var nn={},bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.EVENTS=void 0;bn.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Wn={},Y={},Pr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Pr);Object.defineProperty(Y,"__esModule",{value:!0});Y.EthereumAddressFromSignedMessageResponse=Y.SubmitEthereumTransactionResponse=Y.SignEthereumTransactionResponse=Y.SignEthereumMessageResponse=Y.isRequestEthereumAccountsResponse=Y.SelectProviderResponse=Y.WatchAssetReponse=Y.RequestEthereumAccountsResponse=Y.SwitchEthereumChainResponse=Y.AddEthereumChainResponse=Y.isErrorResponse=void 0;const ot=Pr;function Ll(t){var e,n;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((n=t)===null||n===void 0?void 0:n.errorMessage)!==void 0}Y.isErrorResponse=Ll;function jl(t){return{method:ot.Web3Method.addEthereumChain,result:t}}Y.AddEthereumChainResponse=jl;function $l(t){return{method:ot.Web3Method.switchEthereumChain,result:t}}Y.SwitchEthereumChainResponse=$l;function Dl(t){return{method:ot.Web3Method.requestEthereumAccounts,result:t}}Y.RequestEthereumAccountsResponse=Dl;function Pl(t){return{method:ot.Web3Method.watchAsset,result:t}}Y.WatchAssetReponse=Pl;function Fl(t){return{method:ot.Web3Method.selectProvider,result:t}}Y.SelectProviderResponse=Fl;function Bl(t){return t&&t.method===ot.Web3Method.requestEthereumAccounts}Y.isRequestEthereumAccountsResponse=Bl;function Vl(t){return{method:ot.Web3Method.signEthereumMessage,result:t}}Y.SignEthereumMessageResponse=Vl;function Hl(t){return{method:ot.Web3Method.signEthereumTransaction,result:t}}Y.SignEthereumTransactionResponse=Hl;function Wl(t){return{method:ot.Web3Method.submitEthereumTransaction,result:t}}Y.SubmitEthereumTransactionResponse=Wl;function Ul(t){return{method:ot.Web3Method.ethereumAddressFromSignedMessage,result:t}}Y.EthereumAddressFromSignedMessageResponse=Ul;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.LIB_VERSION=void 0;Un.LIB_VERSION="3.7.1";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=El,n=Y,r=Un;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(h){return h!==void 0?(0,e.getMessageFromCode)(h):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(h="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${h}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(h,u){const d=(0,e.serializeError)(o(h),{shouldIncludeStack:!0}),f=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");f.searchParams.set("version",r.LIB_VERSION),f.searchParams.set("code",d.code.toString());const p=a(d.data,u);return p&&f.searchParams.set("method",p),f.searchParams.set("message",d.message),Object.assign(Object.assign({},d),{docUrl:f.href})}t.serializeError=s;function o(h){return typeof h=="string"?{message:h,code:t.standardErrorCodes.rpc.internal}:(0,n.isErrorResponse)(h)?Object.assign(Object.assign({},h),{message:h.errorMessage,code:h.errorCode,data:{method:h.method,result:h.result}}):h}function a(h,u){var d;const f=(d=h)===null||d===void 0?void 0:d.method;if(f)return f;if(u!==void 0)return typeof u=="string"?u:Array.isArray(u)?u.length>0?u[0].method:void 0:u.method}function c(h){var u;if(typeof h=="number")return h;if(l(h))return(u=h.code)!==null&&u!==void 0?u:h.errorCode}t.getErrorCode=c;function l(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}})(Wn);var gn={},I={},zl=String.prototype.replace,ql=/%20/g,Ii={RFC1738:"RFC1738",RFC3986:"RFC3986"},gs={default:Ii.RFC3986,formatters:{RFC1738:function(t){return zl.call(t,ql,"+")},RFC3986:function(t){return String(t)}},RFC1738:Ii.RFC1738,RFC3986:Ii.RFC3986},Gl=gs,ki=Object.prototype.hasOwnProperty,xt=Array.isArray,Qe=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Jl=function(e){for(;e.length>1;){var n=e.pop(),r=n.obj[n.prop];if(xt(r)){for(var i=[],s=0;s<r.length;++s)typeof r[s]<"u"&&i.push(r[s]);n.obj[n.prop]=i}}},Za=function(e,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(r[i]=e[i]);return r},Ql=function t(e,n,r){if(!n)return e;if(typeof n!="object"){if(xt(e))e.push(n);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!ki.call(Object.prototype,n))&&(e[n]=!0);else return[e,n];return e}if(!e||typeof e!="object")return[e].concat(n);var i=e;return xt(e)&&!xt(n)&&(i=Za(e,r)),xt(e)&&xt(n)?(n.forEach(function(s,o){if(ki.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,r):e.push(s)}else e[o]=s}),e):Object.keys(n).reduce(function(s,o){var a=n[o];return ki.call(s,o)?s[o]=t(s[o],a,r):s[o]=a,s},i)},Zl=function(e,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},e)},Yl=function(t,e,n){var r=t.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},Kl=function(e,n,r,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(h){return"%26%23"+parseInt(h.slice(2),16)+"%3B"});for(var a="",c=0;c<o.length;++c){var l=o.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===Gl.RFC1738&&(l===40||l===41)){a+=o.charAt(c);continue}if(l<128){a=a+Qe[l];continue}if(l<2048){a=a+(Qe[192|l>>6]+Qe[128|l&63]);continue}if(l<55296||l>=57344){a=a+(Qe[224|l>>12]+Qe[128|l>>6&63]+Qe[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|o.charCodeAt(c)&1023),a+=Qe[240|l>>18]+Qe[128|l>>12&63]+Qe[128|l>>6&63]+Qe[128|l&63]}return a},Xl=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i<n.length;++i)for(var s=n[i],o=s.obj[s.prop],a=Object.keys(o),c=0;c<a.length;++c){var l=a[c],h=o[l];typeof h=="object"&&h!==null&&r.indexOf(h)===-1&&(n.push({obj:o,prop:l}),r.push(h))}return Jl(n),e},eh=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},th=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},nh=function(e,n){return[].concat(e,n)},rh=function(e,n){if(xt(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(n(e[i]));return r}return n(e)},Ya={arrayToObject:Za,assign:Zl,combine:nh,compact:Xl,decode:Yl,encode:Kl,isBuffer:th,isRegExp:eh,maybeMap:rh,merge:Ql},Ka=Cl,yr=Ya,Tn=gs,ih=Object.prototype.hasOwnProperty,fo={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,n){return e+"["+n+"]"},repeat:function(e){return e}},ct=Array.isArray,sh=Array.prototype.push,Xa=function(t,e){sh.apply(t,ct(e)?e:[e])},oh=Date.prototype.toISOString,po=Tn.default,_e={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:yr.encode,encodeValuesOnly:!1,format:po,formatter:Tn.formatters[po],indices:!1,serializeDate:function(e){return oh.call(e)},skipNulls:!1,strictNullHandling:!1},ah=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},xi={},ch=function t(e,n,r,i,s,o,a,c,l,h,u,d,f,p,g,S){for(var v=e,m=S,E=0,C=!1;(m=m.get(xi))!==void 0&&!C;){var y=m.get(e);if(E+=1,typeof y<"u"){if(y===E)throw new RangeError("Cyclic object value");C=!0}typeof m.get(xi)>"u"&&(E=0)}if(typeof c=="function"?v=c(n,v):v instanceof Date?v=u(v):r==="comma"&&ct(v)&&(v=yr.maybeMap(v,function(k){return k instanceof Date?u(k):k})),v===null){if(s)return a&&!p?a(n,_e.encoder,g,"key",d):n;v=""}if(ah(v)||yr.isBuffer(v)){if(a){var T=p?n:a(n,_e.encoder,g,"key",d);return[f(T)+"="+f(a(v,_e.encoder,g,"value",d))]}return[f(n)+"="+f(String(v))]}var F=[];if(typeof v>"u")return F;var K;if(r==="comma"&&ct(v))p&&a&&(v=yr.maybeMap(v,a)),K=[{value:v.length>0?v.join(",")||null:void 0}];else if(ct(c))K=c;else{var L=Object.keys(v);K=l?L.sort(l):L}for(var V=i&&ct(v)&&v.length===1?n+"[]":n,fe=0;fe<K.length;++fe){var q=K[fe],_=typeof q=="object"&&typeof q.value<"u"?q.value:v[q];if(!(o&&_===null)){var w=ct(v)?typeof r=="function"?r(V,q):V:V+(h?"."+q:"["+q+"]");S.set(e,E);var M=Ka();M.set(xi,S),Xa(F,t(_,w,r,i,s,o,r==="comma"&&p&&ct(v)?null:a,c,l,h,u,d,f,p,g,M))}}return F},uh=function(e){if(!e)return _e;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=e.charset||_e.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Tn.default;if(typeof e.format<"u"){if(!ih.call(Tn.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Tn.formatters[r],s=_e.filter;return(typeof e.filter=="function"||ct(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:_e.addQueryPrefix,allowDots:typeof e.allowDots>"u"?_e.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:_e.charsetSentinel,delimiter:typeof e.delimiter>"u"?_e.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:_e.encode,encoder:typeof e.encoder=="function"?e.encoder:_e.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:_e.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:_e.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:_e.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:_e.strictNullHandling}},lh=function(t,e){var n=t,r=uh(e),i,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):ct(r.filter)&&(s=r.filter,i=s);var o=[];if(typeof n!="object"||n===null)return"";var a;e&&e.arrayFormat in fo?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=fo[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var h=Ka(),u=0;u<i.length;++u){var d=i[u];r.skipNulls&&n[d]===null||Xa(o,ch(n[d],d,c,l,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,h))}var f=o.join(r.delimiter),p=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),f.length>0?p+f:""},rn=Ya,Ki=Object.prototype.hasOwnProperty,hh=Array.isArray,de={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:rn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},fh=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},ec=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},dh="utf8=%26%2310003%3B",ph="utf8=%E2%9C%93",bh=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=n.parameterLimit===1/0?void 0:n.parameterLimit,o=i.split(n.delimiter,s),a=-1,c,l=n.charset;if(n.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===ph?l="utf-8":o[c]===dh&&(l="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var h=o[c],u=h.indexOf("]="),d=u===-1?h.indexOf("="):u+1,f,p;d===-1?(f=n.decoder(h,de.decoder,l,"key"),p=n.strictNullHandling?null:""):(f=n.decoder(h.slice(0,d),de.decoder,l,"key"),p=rn.maybeMap(ec(h.slice(d+1),n),function(g){return n.decoder(g,de.decoder,l,"value")})),p&&n.interpretNumericEntities&&l==="iso-8859-1"&&(p=fh(p)),h.indexOf("[]=")>-1&&(p=hh(p)?[p]:p),Ki.call(r,f)?r[f]=rn.combine(r[f],p):r[f]=p}return r},gh=function(t,e,n,r){for(var i=r?e:ec(e,n),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!n.parseArrays&&c===""?o={0:i}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(o=[],o[l]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},mh=function(e,n,r,i){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=r.depth>0&&o.exec(s),l=c?s.slice(0,c.index):s,h=[];if(l){if(!r.plainObjects&&Ki.call(Object.prototype,l)&&!r.allowPrototypes)return;h.push(l)}for(var u=0;r.depth>0&&(c=a.exec(s))!==null&&u<r.depth;){if(u+=1,!r.plainObjects&&Ki.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;h.push(c[1])}return c&&h.push("["+s.slice(c.index)+"]"),gh(h,n,r,i)}},vh=function(e){if(!e)return de;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof e.charset>"u"?de.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?de.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:de.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:de.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:de.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:de.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:de.comma,decoder:typeof e.decoder=="function"?e.decoder:de.decoder,delimiter:typeof e.delimiter=="string"||rn.isRegExp(e.delimiter)?e.delimiter:de.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:de.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:de.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:de.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:de.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:de.strictNullHandling}},yh=function(t,e){var n=vh(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?bh(t,n):t,i=n.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],c=mh(a,r[a],n,typeof t=="string");i=rn.merge(i,c,n)}return n.allowSparse===!0?i:rn.compact(i)},wh=lh,_h=yh,Sh=gs,Eh={formats:Sh,parse:_h,stringify:wh},zn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return r=>r}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function n(r){return Math.floor(r)}t.IntNumber=n,t.RegExpString=e(),function(r){r.CoinbaseWallet="CoinbaseWallet",r.MetaMask="MetaMask",r.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(zn);var Ch=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(I,"__esModule",{value:!0});I.isInIFrame=I.createQrUrl=I.getFavicon=I.range=I.isBigNumber=I.ensureParsedJSONObject=I.ensureBN=I.ensureRegExpString=I.ensureIntNumber=I.ensureBuffer=I.ensureAddressString=I.ensureEvenLengthHexString=I.ensureHexString=I.isHexString=I.prepend0x=I.strip0x=I.has0xPrefix=I.hexStringFromIntNumber=I.intNumberFromHexString=I.bigIntStringFromBN=I.hexStringFromBuffer=I.hexStringToUint8Array=I.uint8ArrayToHex=I.randomBytesHex=void 0;const vt=Ch(Or),Ih=Eh,Pt=Wn,Pe=zn,tc=/^[0-9]*$/,nc=/^[a-f0-9]*$/;function kh(t){return rc(crypto.getRandomValues(new Uint8Array(t)))}I.randomBytesHex=kh;function rc(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}I.uint8ArrayToHex=rc;function xh(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}I.hexStringToUint8Array=xh;function Rh(t,e=!1){const n=t.toString("hex");return(0,Pe.HexString)(e?"0x"+n:n)}I.hexStringFromBuffer=Rh;function Mh(t){return(0,Pe.BigIntString)(t.toString(10))}I.bigIntStringFromBN=Mh;function Th(t){return(0,Pe.IntNumber)(new vt.default(Gn(t,!1),16).toNumber())}I.intNumberFromHexString=Th;function Ah(t){return(0,Pe.HexString)("0x"+new vt.default(t).toString(16))}I.hexStringFromIntNumber=Ah;function ms(t){return t.startsWith("0x")||t.startsWith("0X")}I.has0xPrefix=ms;function Fr(t){return ms(t)?t.slice(2):t}I.strip0x=Fr;function ic(t){return ms(t)?"0x"+t.slice(2):"0x"+t}I.prepend0x=ic;function qn(t){if(typeof t!="string")return!1;const e=Fr(t).toLowerCase();return nc.test(e)}I.isHexString=qn;function sc(t,e=!1){if(typeof t=="string"){const n=Fr(t).toLowerCase();if(nc.test(n))return(0,Pe.HexString)(e?"0x"+n:n)}throw Pt.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}I.ensureHexString=sc;function Gn(t,e=!1){let n=sc(t,!1);return n.length%2===1&&(n=(0,Pe.HexString)("0"+n)),e?(0,Pe.HexString)("0x"+n):n}I.ensureEvenLengthHexString=Gn;function Nh(t){if(typeof t=="string"){const e=Fr(t).toLowerCase();if(qn(e)&&e.length===40)return(0,Pe.AddressString)(ic(e))}throw Pt.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}I.ensureAddressString=Nh;function Oh(t){if(U.isBuffer(t))return t;if(typeof t=="string")if(qn(t)){const e=Gn(t,!1);return U.from(e,"hex")}else return U.from(t,"utf8");throw Pt.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}I.ensureBuffer=Oh;function oc(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Pe.IntNumber)(t);if(typeof t=="string"){if(tc.test(t))return(0,Pe.IntNumber)(Number(t));if(qn(t))return(0,Pe.IntNumber)(new vt.default(Gn(t,!1),16).toNumber())}throw Pt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}I.ensureIntNumber=oc;function Lh(t){if(t instanceof RegExp)return(0,Pe.RegExpString)(t.toString());throw Pt.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}I.ensureRegExpString=Lh;function jh(t){if(t!==null&&(vt.default.isBN(t)||ac(t)))return new vt.default(t.toString(10),10);if(typeof t=="number")return new vt.default(oc(t));if(typeof t=="string"){if(tc.test(t))return new vt.default(t,10);if(qn(t))return new vt.default(Gn(t,!1),16)}throw Pt.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}I.ensureBN=jh;function $h(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Pt.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}I.ensureParsedJSONObject=$h;function ac(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}I.isBigNumber=ac;function Dh(t,e){return Array.from({length:e-t},(n,r)=>t+r)}I.range=Dh;function Ph(){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:n}=document.location,r=t?t.getAttribute("href"):null;return!r||r.startsWith("javascript:")?null:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?e+r:`${e}//${n}${r}`}I.getFavicon=Ph;function Fh(t,e,n,r,i,s){const o=r?"parent-id":"id",a=(0,Ih.stringify)({[o]:t,secret:e,server:n,v:i,chainId:s});return`${n}/#/link?${a}`}I.createQrUrl=Fh;function Bh(){try{return window.frameElement!==null}catch{return!1}}I.isInIFrame=Bh;Object.defineProperty(gn,"__esModule",{value:!0});gn.Session=void 0;const bo=Il,go=I,mo="session:id",vo="session:secret",yo="session:linked";class vs{constructor(e,n,r,i){this._storage=e,this._id=n||(0,go.randomBytesHex)(16),this._secret=r||(0,go.randomBytesHex)(32),this._key=new bo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const n=e.getItem(mo),r=e.getItem(yo),i=e.getItem(vo);return n&&i?new vs(e,n,i,r==="1"):null}static hash(e){return new bo.sha256().update(e).digest("hex")}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(mo,this._id),this._storage.setItem(vo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(yo,this._linked?"1":"0")}}gn.Session=vs;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.WalletSDKRelayAbstract=qe.APP_VERSION_KEY=qe.LOCAL_STORAGE_ADDRESSES_KEY=qe.WALLET_USER_NAME_KEY=void 0;const wo=Wn;qe.WALLET_USER_NAME_KEY="walletUsername";qe.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";qe.APP_VERSION_KEY="AppVersion";class Vh{async makeEthereumJSONRPCRequest(e,n){if(!n)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(n,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(r=>r.json()).then(r=>{if(!r)throw wo.standardErrors.rpc.parse({});const i=r,{error:s}=i;if(s)throw(0,wo.serializeError)(s,e.method);return i})}}qe.WalletSDKRelayAbstract=Vh;const Hh=kl,Wh=Or;function cc(t){return U.allocUnsafe(t).fill(0)}function uc(t,e,n){const r=cc(e);return t=Br(t),n?t.length<e?(t.copy(r),r):t.slice(0,e):t.length<e?(t.copy(r,e-t.length),r):t.slice(-e)}function Uh(t,e){return uc(t,e,!0)}function Br(t){if(!U.isBuffer(t))if(Array.isArray(t))t=U.from(t);else if(typeof t=="string")lc(t)?t=U.from(Gh(hc(t)),"hex"):t=U.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=U.allocUnsafe(0);else if(Wh.isBN(t))t=t.toArrayLike(U);else if(t.toArray)t=U.from(t.toArray());else throw new Error("invalid type");return t}function zh(t){return t=Br(t),"0x"+t.toString("hex")}function qh(t,e){return t=Br(t),e||(e=256),Hh("keccak"+e).update(t).digest()}function Gh(t){return t.length%2?"0"+t:t}function lc(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function hc(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var fc={zeros:cc,setLength:uc,setLengthRight:Uh,isHexString:lc,stripHexPrefix:hc,toBuffer:Br,bufferToHex:zh,keccak:qh};const Lt=fc,Nt=Or;function dc(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function Yt(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function _o(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function pc(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function Rt(t){var e=typeof t;if(e==="string")return Lt.isHexString(t)?new Nt(Lt.stripHexPrefix(t),16):new Nt(t,10);if(e==="number")return new Nt(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Xe(t,e){var n,r,i,s;if(t==="address")return Xe("uint160",Rt(e));if(t==="bool")return Xe("uint8",e?1:0);if(t==="string")return Xe("bytes",new U(e,"utf8"));if(Qh(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(n=pc(t),n!=="dynamic"&&n!==0&&e.length>n)throw new Error("Elements exceed array size: "+n);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(Xe(t,e[s]));if(n==="dynamic"){var o=Xe("uint256",e.length);i.unshift(o)}return U.concat(i)}else{if(t==="bytes")return e=new U(e),i=U.concat([Xe("uint256",e.length),e]),e.length%32!==0&&(i=U.concat([i,Lt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(n=Yt(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return Lt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(n=Yt(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Rt(e),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());if(r<0)throw new Error("Supplied uint is negative");return r.toArrayLike(U,"be",32)}else if(t.startsWith("int")){if(n=Yt(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Rt(e),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());return r.toTwos(256).toArrayLike(U,"be",32)}else if(t.startsWith("ufixed")){if(n=_o(t),r=Rt(e),r<0)throw new Error("Supplied ufixed is negative");return Xe("uint256",r.mul(new Nt(2).pow(new Nt(n[1]))))}else if(t.startsWith("fixed"))return n=_o(t),Xe("int256",Rt(e).mul(new Nt(2).pow(new Nt(n[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Jh(t){return t==="string"||t==="bytes"||pc(t)==="dynamic"}function Qh(t){return t.lastIndexOf("]")===t.length-1}function Zh(t,e){var n=[],r=[],i=32*t.length;for(var s in t){var o=dc(t[s]),a=e[s],c=Xe(o,a);Jh(o)?(n.push(Xe("uint256",i)),r.push(c),i+=c.length):n.push(c)}return U.concat(n.concat(r))}function bc(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var n,r,i=[],s=0;s<t.length;s++){var o=dc(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new U(a,"utf8"));else if(o==="bool")i.push(new U(a?"01":"00","hex"));else if(o==="address")i.push(Lt.setLength(a,20));else if(o.startsWith("bytes")){if(n=Yt(o),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);i.push(Lt.setLengthRight(a,n))}else if(o.startsWith("uint")){if(n=Yt(o),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(r=Rt(a),r.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+r.bitLength());i.push(r.toArrayLike(U,"be",n/8))}else if(o.startsWith("int")){if(n=Yt(o),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(r=Rt(a),r.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+r.bitLength());i.push(r.toTwos(n).toArrayLike(U,"be",n/8))}else throw new Error("Unsupported or invalid type: "+o)}return U.concat(i)}function Yh(t,e){return Lt.keccak(bc(t,e))}var Kh={rawEncode:Zh,solidityPack:bc,soliditySHA3:Yh};const We=fc,An=Kh,gc={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"]},Ri={encodeData(t,e,n,r=!0){const i=["bytes32"],s=[this.hashType(t,n)];if(r){const o=(a,c,l)=>{if(n[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":We.keccak(this.encodeData(c,l,n,r))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",We.keccak(l)];if(c==="string")return typeof l=="string"&&(l=U.from(l,"utf8")),["bytes32",We.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const h=c.slice(0,c.lastIndexOf("[")),u=l.map(d=>o(a,h,d));return["bytes32",We.keccak(An.rawEncode(u.map(([d])=>d),u.map(([,d])=>d)))]}return[c,l]};for(const a of n[t]){const[c,l]=o(a.name,a.type,e[a.name]);i.push(c),s.push(l)}}else for(const o of n[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=We.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=U.from(a,"utf8")),a=We.keccak(a),s.push(a);else if(n[o.type]!==void 0)i.push("bytes32"),a=We.keccak(this.encodeData(o.type,a,n,r)),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 An.rawEncode(i,s)},encodeType(t,e){let n="",r=this.findTypeDependencies(t,e).filter(i=>i!==t);r=[t].concat(r.sort());for(const i of r){if(!e[i])throw new Error("No type definition specified: "+i);n+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return n},findTypeDependencies(t,e,n=[]){if(t=t.match(/^\w*/)[0],n.includes(t)||e[t]===void 0)return n;n.push(t);for(const r of e[t])for(const i of this.findTypeDependencies(r.type,e,n))!n.includes(i)&&n.push(i);return n},hashStruct(t,e,n,r=!0){return We.keccak(this.encodeData(t,e,n,r))},hashType(t,e){return We.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const n in gc.properties)t[n]&&(e[n]=t[n]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const n=this.sanitizeData(t),r=[U.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,e)),n.primaryType!=="EIP712Domain"&&r.push(this.hashStruct(n.primaryType,n.message,n.types,e)),We.keccak(U.concat(r))}};var Xh={TYPED_MESSAGE_SCHEMA:gc,TypedDataUtils:Ri,hashForSignTypedDataLegacy:function(t){return ef(t.data)},hashForSignTypedData_v3:function(t){return Ri.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Ri.hash(t.data)}};function ef(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const n=t.map(function(s){return s.type==="bytes"?We.toBuffer(s.value):s.value}),r=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return An.soliditySHA3(["bytes32","bytes32"],[An.soliditySHA3(new Array(t.length).fill("string"),i),An.soliditySHA3(r,n)])}var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.filterFromParam=sn.FilterPolyfill=void 0;const Jt=zn,Se=I,tf=5*60*1e3,Mt={jsonrpc:"2.0",id:0};class nf{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Jt.IntNumber)(1),this.provider=e}async newFilter(e){const n=mc(e),r=this.makeFilterId(),i=await this.setInitialCursorPosition(r,n.fromBlock);return console.log(`Installing new log filter(${r}):`,n,"initial cursor position:",i),this.logFilters.set(r,n),this.setFilterTimeout(r),(0,Se.hexStringFromIntNumber)(r)}async newBlockFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Se.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),n=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,n),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Se.hexStringFromIntNumber)(e)}uninstallFilter(e){const n=(0,Se.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${n})`),this.deleteFilter(n),!0}getFilterChanges(e){const n=(0,Se.intNumberFromHexString)(e);return this.timeouts.has(n)&&this.setFilterTimeout(n),this.logFilters.has(n)?this.getLogFilterChanges(n):this.blockFilters.has(n)?this.getBlockFilterChanges(n):this.pendingTransactionFilters.has(n)?this.getPendingTransactionFilterChanges(n):Promise.resolve(cr())}async getFilterLogs(e){const n=(0,Se.intNumberFromHexString)(e),r=this.logFilters.get(n);return r?this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getLogs",params:[So(r)]})):cr()}makeFilterId(){return(0,Jt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((n,r)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return r(i);if(Array.isArray(s)||s==null)return r(new Error(`unexpected response received: ${JSON.stringify(s)}`));n(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const n=this.logFilters.get(e),r=this.cursors.get(e);if(!r||!n)return cr();const i=await this.getCurrentBlockHeight(),s=n.toBlock==="latest"?i:n.toBlock;if(r>i||r>n.toBlock)return ur();console.log(`Fetching logs from ${r} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getLogs",params:[So(Object.assign(Object.assign({},n),{fromBlock:r,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,Se.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>r){const l=(0,Jt.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${r} to ${l}`),this.cursors.set(e,l)}}return o}async getBlockFilterChanges(e){const n=this.cursors.get(e);if(!n)return cr();const r=await this.getCurrentBlockHeight();if(n>r)return ur();console.log(`Fetching blocks from ${n} to ${r} for filter (${e})`);const i=(await Promise.all((0,Se.range)(n,r+1).map(o=>this.getBlockHashByNumber((0,Jt.IntNumber)(o))))).filter(o=>!!o),s=(0,Jt.IntNumber)(n+i.length);return console.log(`Moving cursor position for filter (${e}) from ${n} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},Mt),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(ur())}async setInitialCursorPosition(e,n){const r=await this.getCurrentBlockHeight(),i=typeof n=="number"&&n>r?n:r;return this.cursors.set(e,i),i}setFilterTimeout(e){const n=this.timeouts.get(e);n&&window.clearTimeout(n);const r=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},tf);this.timeouts.set(e,r)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_blockNumber",params:[]}));return(0,Se.intNumberFromHexString)((0,Se.ensureHexString)(e))}async getBlockHashByNumber(e){const n=await this.sendAsyncPromise(Object.assign(Object.assign({},Mt),{method:"eth_getBlockByNumber",params:[(0,Se.hexStringFromIntNumber)(e),!1]}));return n.result&&typeof n.result.hash=="string"?(0,Se.ensureHexString)(n.result.hash):null}}sn.FilterPolyfill=nf;function mc(t){return{fromBlock:Eo(t.fromBlock),toBlock:Eo(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}sn.filterFromParam=mc;function So(t){const e={fromBlock:Co(t.fromBlock),toBlock:Co(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Eo(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Jt.IntNumber)(0);if((0,Se.isHexString)(t))return(0,Se.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Co(t){return t==="latest"?t:(0,Se.hexStringFromIntNumber)(t)}function cr(){return Object.assign(Object.assign({},Mt),{error:{code:-32e3,message:"filter not found"}})}function ur(){return Object.assign(Object.assign({},Mt),{result:[]})}var vc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(vc);var Vr={},yc={},Hr={},Jn={},rf=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.BaseBlockTracker=void 0;const sf=rf(Lr),of=1e3,af=(t,e)=>t+e,Io=["sync","latest"];class cf extends sf.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*of,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(n=>this.once("latest",n))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){Io.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Io.map(e=>this.listenerCount(e)).reduce(af)}_newPotentialLatest(e){const n=this._currentBlock;n&&ko(e)<=ko(n)||this._setCurrentBlock(e)}_setCurrentBlock(e){const n=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:n,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Jn.BaseBlockTracker=cf;function ko(t){return Number.parseInt(t,16)}var wc={},_c={},ye={};class Sc extends TypeError{constructor(e,n){let r;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...n()])}}function uf(t){return Fe(t)&&typeof t[Symbol.iterator]=="function"}function Fe(t){return typeof t=="object"&&t!=null}function xo(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function he(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function lf(t){const{done:e,value:n}=t.next();return e?void 0:n}function hf(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${he(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*Xi(t,e,n,r){uf(t)||(t=[t]);for(const i of t){const s=hf(i,e,n,r);s&&(yield s)}}function*ys(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Fe(e.schema)&&Fe(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c="valid";for(const l of e.validator(t,a))l.explanation=n.message,c="not_valid",yield[l,void 0];for(let[l,h,u]of e.entries(t,a)){const d=ys(h,u,{path:l===void 0?r:[...r,l],branch:l===void 0?i:[...i,h],coerce:s,mask:o,message:n.message});for(const f of d)f[0]?(c=f[0].refinement!=null?"not_refined":"not_valid",yield[f[0],void 0]):s&&(h=f[1],l===void 0?t=h:t instanceof Map?t.set(l,h):t instanceof Set?t.add(h):Fe(t)&&(h!==void 0||l in t)&&(t[l]=h))}if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=n.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}class ae{constructor(e){const{type:n,schema:r,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const h=i(c,l);return Xi(h,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const h=s(c,l);return Xi(h,l,this,c)}:this.refiner=()=>[]}assert(e,n){return Ec(e,this,n)}create(e,n){return Cc(e,this,n)}is(e){return ws(e,this)}mask(e,n){return Ic(e,this,n)}validate(e,n={}){return mn(e,this,n)}}function Ec(t,e,n){const r=mn(t,e,{message:n});if(r[0])throw r[0]}function Cc(t,e,n){const r=mn(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function Ic(t,e,n){const r=mn(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function ws(t,e){return!mn(t,e)[0]}function mn(t,e,n={}){const r=ys(t,e,n),i=lf(r);return i[0]?[new Sc(i[0],function*(){for(const o of r)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function ff(...t){const e=t[0].type==="type",n=t.map(i=>i.schema),r=Object.assign({},...n);return e?Ss(r):Qn(r)}function Re(t,e){return new ae({type:t,schema:null,validator:e})}function df(t,e){return new ae({...t,refiner:(n,r)=>n===void 0||t.refiner(n,r),validator(n,r){return n===void 0?!0:(e(n,r),t.validator(n,r))}})}function pf(t){return new ae({type:"dynamic",schema:null,*entries(e,n){yield*t(e,n).entries(e,n)},validator(e,n){return t(e,n).validator(e,n)},coercer(e,n){return t(e,n).coercer(e,n)},refiner(e,n){return t(e,n).refiner(e,n)}})}function bf(t){let e;return new ae({type:"lazy",schema:null,*entries(n,r){e??(e=t()),yield*e.entries(n,r)},validator(n,r){return e??(e=t()),e.validator(n,r)},coercer(n,r){return e??(e=t()),e.coercer(n,r)},refiner(n,r){return e??(e=t()),e.refiner(n,r)}})}function gf(t,e){const{schema:n}=t,r={...n};for(const i of e)delete r[i];switch(t.type){case"type":return Ss(r);default:return Qn(r)}}function mf(t){const e=t instanceof ae?{...t.schema}:{...t};for(const n in e)e[n]=kc(e[n]);return Qn(e)}function vf(t,e){const{schema:n}=t,r={};for(const i of e)r[i]=n[i];return Qn(r)}function yf(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Re(t,e)}function wf(){return Re("any",()=>!0)}function _f(t){return new ae({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${he(e)}`}})}function Sf(){return Re("bigint",t=>typeof t=="bigint")}function Ef(){return Re("boolean",t=>typeof t=="boolean")}function Cf(){return Re("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${he(t)}`)}function If(t){const e={},n=t.map(r=>he(r)).join();for(const r of t)e[r]=r;return new ae({type:"enums",schema:e,validator(r){return t.includes(r)||`Expected one of \`${n}\`, but received: ${he(r)}`}})}function kf(){return Re("func",t=>typeof t=="function"||`Expected a function, but received: ${he(t)}`)}function xf(t){return Re("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${he(e)}`)}function Rf(){return Re("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${he(t)}`)}function Mf(t){return new ae({type:"intersection",schema:null,*entries(e,n){for(const r of t)yield*r.entries(e,n)},*validator(e,n){for(const r of t)yield*r.validator(e,n)},*refiner(e,n){for(const r of t)yield*r.refiner(e,n)}})}function Tf(t){const e=he(t),n=typeof t;return new ae({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${he(r)}`}})}function Af(t,e){return new ae({type:"map",schema:null,*entries(n){if(t&&e&&n instanceof Map)for(const[r,i]of n.entries())yield[r,r,t],yield[r,i,e]},coercer(n){return n instanceof Map?new Map(n):n},validator(n){return n instanceof Map||`Expected a \`Map\` object, but received: ${he(n)}`}})}function _s(){return Re("never",()=>!1)}function Nf(t){return new ae({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function Of(){return Re("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${he(t)}`)}function Qn(t){const e=t?Object.keys(t):[],n=_s();return new ae({type:"object",schema:t||null,*entries(r){if(t&&Fe(r)){const i=new Set(Object.keys(r));for(const s of e)i.delete(s),yield[s,r[s],t[s]];for(const s of i)yield[s,r[s],n]}},validator(r){return Fe(r)||`Expected an object, but received: ${he(r)}`},coercer(r){return Fe(r)?{...r}:r}})}function kc(t){return new ae({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function Lf(t,e){return new ae({type:"record",schema:null,*entries(n){if(Fe(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return Fe(n)||`Expected an object, but received: ${he(n)}`}})}function jf(){return Re("regexp",t=>t instanceof RegExp)}function $f(t){return new ae({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const n of e)yield[n,n,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${he(e)}`}})}function xc(){return Re("string",t=>typeof t=="string"||`Expected a string, but received: ${he(t)}`)}function Df(t){const e=_s();return new ae({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${he(n)}`}})}function Ss(t){const e=Object.keys(t);return new ae({type:"type",schema:t,*entries(n){if(Fe(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Fe(n)||`Expected an object, but received: ${he(n)}`},coercer(n){return Fe(n)?{...n}:n}})}function Pf(t){const e=t.map(n=>n.type).join(" | ");return new ae({type:"union",schema:null,coercer(n){for(const r of t){const[i,s]=r.validate(n,{coerce:!0});if(!i)return s}return n},validator(n,r){const i=[];for(const s of t){const[...o]=ys(n,s,r),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${he(n)}`,...i]}})}function Rc(){return Re("unknown",()=>!0)}function Es(t,e,n){return new ae({...t,coercer:(r,i)=>ws(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}function Ff(t,e,n={}){return Es(t,Rc(),r=>{const i=typeof e=="function"?e():e;if(r===void 0)return i;if(!n.strict&&xo(r)&&xo(i)){const s={...r};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return r})}function Bf(t){return Es(t,xc(),e=>e.trim())}function Vf(t){return Ft(t,"empty",e=>{const n=Mc(e);return n===0||`Expected an empty ${t.type} but received one with a size of \`${n}\``})}function Mc(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Hf(t,e,n={}){const{exclusive:r}=n;return Ft(t,"max",i=>r?i<e:i<=e||`Expected a ${t.type} less than ${r?"":"or equal to "}${e} but received \`${i}\``)}function Wf(t,e,n={}){const{exclusive:r}=n;return Ft(t,"min",i=>r?i>e:i>=e||`Expected a ${t.type} greater than ${r?"":"or equal to "}${e} but received \`${i}\``)}function Uf(t){return Ft(t,"nonempty",e=>Mc(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function zf(t,e){return Ft(t,"pattern",n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`)}function qf(t,e,n=e){const r=`Expected a ${t.type}`,i=e===n?`of \`${e}\``:`between \`${e}\` and \`${n}\``;return Ft(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=n||`${r} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=n||`${r} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=n||`${r} with a length ${i} but received one with a length of \`${o}\``}})}function Ft(t,e,n){return new ae({...t,*refiner(r,i){yield*t.refiner(r,i);const s=n(r,i),o=Xi(s,i,t,r);for(const a of o)yield{...a,refinement:e}}})}const Gf=Object.freeze(Object.defineProperty({__proto__:null,Struct:ae,StructError:Sc,any:wf,array:_f,assert:Ec,assign:ff,bigint:Sf,boolean:Ef,coerce:Es,create:Cc,date:Cf,defaulted:Ff,define:Re,deprecated:df,dynamic:pf,empty:Vf,enums:If,func:kf,instance:xf,integer:Rf,intersection:Mf,is:ws,lazy:bf,literal:Tf,map:Af,mask:Ic,max:Hf,min:Wf,never:_s,nonempty:Uf,nullable:Nf,number:Of,object:Qn,omit:gf,optional:kc,partial:mf,pattern:zf,pick:vf,record:Lf,refine:Ft,regexp:jf,set:$f,size:qf,string:xc,struct:yf,trimmed:Bf,tuple:Df,type:Ss,union:Pf,unknown:Rc,validate:mn},Symbol.toStringTag,{value:"Module"})),Bt=Hn(Gf);Object.defineProperty(ye,"__esModule",{value:!0});ye.assertExhaustive=ye.assertStruct=ye.assert=ye.AssertionError=void 0;const Jf=Bt;function Qf(t){return typeof t=="object"&&t!==null&&"message"in t}function Zf(t){var e,n;return typeof((n=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||n===void 0?void 0:n.name)=="string"}function Yf(t){const e=Qf(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Tc(t,e){return Zf(t)?new t({message:e}):t({message:e})}class Cs extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}ye.AssertionError=Cs;function Kf(t,e="Assertion failed.",n=Cs){if(!t)throw e instanceof Error?e:Tc(n,e)}ye.assert=Kf;function Xf(t,e,n="Assertion failed",r=Cs){try{(0,Jf.assert)(t,e)}catch(i){throw Tc(r,`${n}: ${Yf(i)}.`)}}ye.assertStruct=Xf;function ed(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}ye.assertExhaustive=ed;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.base64=void 0;const td=Bt,nd=ye,rd=(t,e={})=>{var n,r;const i=(n=e.paddingRequired)!==null&&n!==void 0?n:!1,s=(r=e.characterSet)!==null&&r!==void 0?r:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,nd.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,td.pattern)(t,a)};Zn.base64=rd;var W={},Yn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Bt,n=ye;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function r(l){return(0,e.is)(l,t.HexStruct)}t.isHexString=r;function i(l){return(0,e.is)(l,t.StrictHexStruct)}t.isStrictHexString=i;function s(l){(0,n.assert)(r(l),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(l){(0,n.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}t.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}t.remove0x=c})(Yn);Object.defineProperty(W,"__esModule",{value:!0});W.createDataView=W.concatBytes=W.valueToBytes=W.stringToBytes=W.numberToBytes=W.signedBigIntToBytes=W.bigIntToBytes=W.hexToBytes=W.bytesToString=W.bytesToNumber=W.bytesToSignedBigInt=W.bytesToBigInt=W.bytesToHex=W.assertIsBytes=W.isBytes=void 0;const Ae=ye,es=Yn,Ro=48,Mo=58,To=87;function id(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const sd=id();function Is(t){return t instanceof Uint8Array}W.isBytes=Is;function vn(t){(0,Ae.assert)(Is(t),"Value must be a Uint8Array.")}W.assertIsBytes=vn;function Ac(t){if(vn(t),t.length===0)return"0x";const e=sd(),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return(0,es.add0x)(n.join(""))}W.bytesToHex=Ac;function Nc(t){vn(t);const e=Ac(t);return BigInt(e)}W.bytesToBigInt=Nc;function od(t){vn(t);let e=BigInt(0);for(const n of t)e=(e<<BigInt(8))+BigInt(n);return BigInt.asIntN(t.length*8,e)}W.bytesToSignedBigInt=od;function ad(t){vn(t);const e=Nc(t);return(0,Ae.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}W.bytesToNumber=ad;function cd(t){return vn(t),new TextDecoder().decode(t)}W.bytesToString=cd;function Wr(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,es.assertIsHexString)(t);const n=(0,es.remove0x)(t).toLowerCase(),r=n.length%2===0?n:`0${n}`,i=new Uint8Array(r.length/2);for(let s=0;s<i.length;s++){const o=r.charCodeAt(s*2),a=r.charCodeAt(s*2+1),c=o-(o<Mo?Ro:To),l=a-(a<Mo?Ro:To);i[s]=c*16+l}return i}W.hexToBytes=Wr;function Oc(t){(0,Ae.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ae.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Wr(e)}W.bigIntToBytes=Oc;function ud(t,e){(0,Ae.assert)(e>0);const n=t>>BigInt(31);return!((~t&n)+(t&~n)>>BigInt(e*8+-1))}function ld(t,e){(0,Ae.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ae.assert)(typeof e=="number","Byte length must be a number."),(0,Ae.assert)(e>0,"Byte length must be greater than 0."),(0,Ae.assert)(ud(t,e),"Byte length is too small to represent the given value.");let n=t;const r=new Uint8Array(e);for(let i=0;i<r.length;i++)r[i]=Number(BigInt.asUintN(8,n)),n>>=BigInt(8);return r.reverse()}W.signedBigIntToBytes=ld;function Lc(t){(0,Ae.assert)(typeof t=="number","Value must be a number."),(0,Ae.assert)(t>=0,"Value must be a non-negative number."),(0,Ae.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Wr(e)}W.numberToBytes=Lc;function jc(t){return(0,Ae.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}W.stringToBytes=jc;function $c(t){if(typeof t=="bigint")return Oc(t);if(typeof t=="number")return Lc(t);if(typeof t=="string")return t.startsWith("0x")?Wr(t):jc(t);if(Is(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}W.valueToBytes=$c;function hd(t){const e=new Array(t.length);let n=0;for(let i=0;i<t.length;i++){const s=$c(t[i]);e[i]=s,n+=s.length}const r=new Uint8Array(n);for(let i=0,s=0;i<e.length;i++)r.set(e[i],s),s+=e[i].length;return r}W.concatBytes=hd;function fd(t){if(typeof U<"u"&&t instanceof U){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}W.createDataView=fd;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.ChecksumStruct=void 0;const Ao=Bt,dd=Zn;Ur.ChecksumStruct=(0,Ao.size)((0,dd.base64)((0,Ao.string)(),{paddingRequired:!0}),44,44);var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.createHex=nt.createBytes=nt.createBigInt=nt.createNumber=void 0;const ne=Bt,pd=ye,Dc=W,zr=Yn,Pc=(0,ne.union)([(0,ne.number)(),(0,ne.bigint)(),(0,ne.string)(),zr.StrictHexStruct]),bd=(0,ne.coerce)((0,ne.number)(),Pc,Number),gd=(0,ne.coerce)((0,ne.bigint)(),Pc,BigInt);(0,ne.union)([zr.StrictHexStruct,(0,ne.instance)(Uint8Array)]);const md=(0,ne.coerce)((0,ne.instance)(Uint8Array),(0,ne.union)([zr.StrictHexStruct]),Dc.hexToBytes),vd=(0,ne.coerce)(zr.StrictHexStruct,(0,ne.instance)(Uint8Array),Dc.bytesToHex);function yd(t){try{const e=(0,ne.create)(t,bd);return(0,pd.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof ne.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}nt.createNumber=yd;function wd(t){try{return(0,ne.create)(t,gd)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}nt.createBigInt=wd;function _d(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,ne.create)(t,md)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nt.createBytes=_d;function Sd(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,ne.create)(t,vd)}catch(e){throw e instanceof ne.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nt.createHex=Sd;var on={},Fc=O&&O.__classPrivateFieldSet||function(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n},Ee=O&&O.__classPrivateFieldGet||function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},Ve,Ze;Object.defineProperty(on,"__esModule",{value:!0});on.FrozenSet=on.FrozenMap=void 0;class ks{constructor(e){Ve.set(this,void 0),Fc(this,Ve,new Map(e),"f"),Object.freeze(this)}get size(){return Ee(this,Ve,"f").size}[(Ve=new WeakMap,Symbol.iterator)](){return Ee(this,Ve,"f")[Symbol.iterator]()}entries(){return Ee(this,Ve,"f").entries()}forEach(e,n){return Ee(this,Ve,"f").forEach((r,i,s)=>e.call(n,r,i,this))}get(e){return Ee(this,Ve,"f").get(e)}has(e){return Ee(this,Ve,"f").has(e)}keys(){return Ee(this,Ve,"f").keys()}values(){return Ee(this,Ve,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,n])=>`${String(e)} => ${String(n)}`).join(", ")} `:""}}`}}on.FrozenMap=ks;class xs{constructor(e){Ze.set(this,void 0),Fc(this,Ze,new Set(e),"f"),Object.freeze(this)}get size(){return Ee(this,Ze,"f").size}[(Ze=new WeakMap,Symbol.iterator)](){return Ee(this,Ze,"f")[Symbol.iterator]()}entries(){return Ee(this,Ze,"f").entries()}forEach(e,n){return Ee(this,Ze,"f").forEach((r,i,s)=>e.call(n,r,i,this))}has(e){return Ee(this,Ze,"f").has(e)}keys(){return Ee(this,Ze,"f").keys()}values(){return Ee(this,Ze,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}on.FrozenSet=xs;Object.freeze(ks);Object.freeze(ks.prototype);Object.freeze(xs);Object.freeze(xs.prototype);var Bc={},Rs={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(l){return Array.isArray(l)&&l.length>0}t.isNonEmptyArray=e;function n(l){return l==null}t.isNullOrUndefined=n;function r(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}t.isObject=r;const i=(l,h)=>Object.hasOwnProperty.call(l,h);t.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let h=l;for(;Object.getPrototypeOf(h)!==null;)h=Object.getPrototypeOf(h);return Object.getPrototypeOf(l)===h}catch{return!1}}t.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}t.isASCII=o;function a(l){var h;return l.split("").reduce((d,f)=>o(f)?d+1:d+2,0)+((h=l.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&h!==void 0?h:[]).length}t.calculateStringSize=a;function c(l){return l.toString().length}t.calculateNumberSize=c})(Rs);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Bt,n=ye,r=Rs;t.JsonStruct=(0,e.define)("Json",y=>{const[T]=C(y,!0);return T?!0:"Expected a valid JSON-serializable value"});function i(y){return(0,e.is)(y,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(y){return(0,e.is)(y,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(y,T){(0,n.assertStruct)(y,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",T)}t.assertIsJsonRpcNotification=o;function a(y){return(0,e.is)(y,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(y,T){(0,n.assertStruct)(y,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",T)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function l(y){return(0,e.is)(y,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=l;function h(y,T){(0,n.assertStruct)(y,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",T)}t.assertIsPendingJsonRpcResponse=h;function u(y){return(0,e.is)(y,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=u;function d(y,T){(0,n.assertStruct)(y,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",T)}t.assertIsJsonRpcResponse=d;function f(y){return(0,e.is)(y,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=f;function p(y,T){(0,n.assertStruct)(y,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",T)}t.assertIsJsonRpcSuccess=p;function g(y){return(0,e.is)(y,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=g;function S(y,T){(0,n.assertStruct)(y,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",T)}t.assertIsJsonRpcFailure=S;function v(y){return(0,e.is)(y,t.JsonRpcErrorStruct)}t.isJsonRpcError=v;function m(y,T){(0,n.assertStruct)(y,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",T)}t.assertIsJsonRpcError=m;function E(y){const{permitEmptyString:T,permitFractions:F,permitNull:K}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},y);return V=>!!(typeof V=="number"&&(F||Number.isInteger(V))||typeof V=="string"&&(T||V.length>0)||K&&V===null)}t.getJsonRpcIdValidator=E;function C(y,T=!1){const F=new Set;function K(L,V){if(L===void 0)return[!1,0];if(L===null)return[!0,V?0:r.JsonSize.Null];const fe=typeof L;try{if(fe==="function")return[!1,0];if(fe==="string"||L instanceof String)return[!0,V?0:(0,r.calculateStringSize)(L)+r.JsonSize.Quote*2];if(fe==="boolean"||L instanceof Boolean)return V?[!0,0]:[!0,L==!0?r.JsonSize.True:r.JsonSize.False];if(fe==="number"||L instanceof Number)return V?[!0,0]:[!0,(0,r.calculateNumberSize)(L)];if(L instanceof Date)return V?[!0,0]:[!0,isNaN(L.getDate())?r.JsonSize.Null:r.JsonSize.Date+r.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,r.isPlainObject)(L)&&!Array.isArray(L))return[!1,0];if(F.has(L))return[!1,0];F.add(L);try{return[!0,Object.entries(L).reduce((q,[_,w],M,k)=>{let[A,x]=K(w,V);if(!A)throw new Error("JSON validation did not pass. Validation process stopped.");if(F.delete(L),V)return 0;const $=Array.isArray(L)?0:_.length+r.JsonSize.Comma+r.JsonSize.Colon*2,G=M<k.length-1?r.JsonSize.Comma:0;return q+$+x+G},V?0:r.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return K(y,T)}t.validateJsonAndGetSize=C})(Bc);var an={},ts={exports:{}},Mi,No;function Ed(){if(No)return Mi;No=1;var t=1e3,e=t*60,n=e*60,r=n*24,i=r*7,s=r*365.25;Mi=function(h,u){u=u||{};var d=typeof h;if(d==="string"&&h.length>0)return o(h);if(d==="number"&&isFinite(h))return u.long?c(h):a(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function o(h){if(h=String(h),!(h.length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(u){var d=parseFloat(u[1]),f=(u[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return d*s;case"weeks":case"week":case"w":return d*i;case"days":case"day":case"d":return d*r;case"hours":case"hour":case"hrs":case"hr":case"h":return d*n;case"minutes":case"minute":case"mins":case"min":case"m":return d*e;case"seconds":case"second":case"secs":case"sec":case"s":return d*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function a(h){var u=Math.abs(h);return u>=r?Math.round(h/r)+"d":u>=n?Math.round(h/n)+"h":u>=e?Math.round(h/e)+"m":u>=t?Math.round(h/t)+"s":h+"ms"}function c(h){var u=Math.abs(h);return u>=r?l(h,u,r,"day"):u>=n?l(h,u,n,"hour"):u>=e?l(h,u,e,"minute"):u>=t?l(h,u,t,"second"):h+" ms"}function l(h,u,d,f){var p=u>=d*1.5;return Math.round(h/d)+" "+f+(p?"s":"")}return Mi}function Cd(t){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=i,n.enabled=o,n.humanize=Ed(),n.destroy=l,Object.keys(t).forEach(h=>{n[h]=t[h]}),n.names=[],n.skips=[],n.formatters={};function e(h){let u=0;for(let d=0;d<h.length;d++)u=(u<<5)-u+h.charCodeAt(d),u|=0;return n.colors[Math.abs(u)%n.colors.length]}n.selectColor=e;function n(h){let u,d=null,f,p;function g(...S){if(!g.enabled)return;const v=g,m=Number(new Date),E=m-(u||m);v.diff=E,v.prev=u,v.curr=m,u=m,S[0]=n.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let C=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(T,F)=>{if(T==="%%")return"%";C++;const K=n.formatters[F];if(typeof K=="function"){const L=S[C];T=K.call(v,L),S.splice(C,1),C--}return T}),n.formatArgs.call(v,S),(v.log||n.log).apply(v,S)}return g.namespace=h,g.useColors=n.useColors(),g.color=n.selectColor(h),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(f!==n.namespaces&&(f=n.namespaces,p=n.enabled(h)),p),set:S=>{d=S}}),typeof n.init=="function"&&n.init(g),g}function r(h,u){const d=n(this.namespace+(typeof u>"u"?":":u)+h);return d.log=this.log,d}function i(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let u;const d=(typeof h=="string"?h:"").split(/[\s,]+/),f=d.length;for(u=0;u<f;u++)d[u]&&(h=d[u].replace(/\*/g,".*?"),h[0]==="-"?n.skips.push(new RegExp("^"+h.slice(1)+"$")):n.names.push(new RegExp("^"+h+"$")))}function s(){const h=[...n.names.map(a),...n.skips.map(a).map(u=>"-"+u)].join(",");return n.enable(""),h}function o(h){if(h[h.length-1]==="*")return!0;let u,d;for(u=0,d=n.skips.length;u<d;u++)if(n.skips[u].test(h))return!1;for(u=0,d=n.names.length;u<d;u++)if(n.names[u].test(h))return!0;return!1}function a(h){return h.toString().substring(2,h.toString().length-2).replace(/\.\*\?$/,"*")}function c(h){return h instanceof Error?h.stack||h.message:h}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var Id=Cd;(function(t,e){e.formatArgs=r,e.save=i,e.load=s,e.useColors=n,e.storage=o(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let h=0,u=0;c[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(h++,d==="%c"&&(u=h))}),c.splice(u,0,l)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof Yi<"u"&&"env"in Yi&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=Id(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(ts,ts.exports);var kd=ts.exports,xd=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(an,"__esModule",{value:!0});an.createModuleLogger=an.createProjectLogger=void 0;const Rd=xd(kd),Md=(0,Rd.default)("metamask");function Td(t){return Md.extend(t)}an.createProjectLogger=Td;function Ad(t,e){return t.extend(e)}an.createModuleLogger=Ad;var rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.hexToBigInt=rt.hexToNumber=rt.bigIntToHex=rt.numberToHex=void 0;const Kt=ye,Dn=Yn,Nd=t=>((0,Kt.assert)(typeof t=="number","Value must be a number."),(0,Kt.assert)(t>=0,"Value must be a non-negative number."),(0,Kt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Dn.add0x)(t.toString(16)));rt.numberToHex=Nd;const Od=t=>((0,Kt.assert)(typeof t=="bigint","Value must be a bigint."),(0,Kt.assert)(t>=0,"Value must be a non-negative bigint."),(0,Dn.add0x)(t.toString(16)));rt.bigIntToHex=Od;const Ld=t=>{(0,Dn.assertIsHexString)(t);const e=parseInt(t,16);return(0,Kt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};rt.hexToNumber=Ld;const jd=t=>((0,Dn.assertIsHexString)(t),BigInt((0,Dn.add0x)(t)));rt.hexToBigInt=jd;var Vc={};Object.defineProperty(Vc,"__esModule",{value:!0});var Hc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,n=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function r(s,o){return n(s,"count"),s*o}t.inMilliseconds=r;function i(s){return n(s,"timestamp"),Date.now()-s}t.timeSince=i})(Hc);var Wc={},ns={exports:{}};const $d="2.0.0",Uc=256,Dd=Number.MAX_SAFE_INTEGER||9007199254740991,Pd=16,Fd=Uc-6,Bd=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var qr={MAX_LENGTH:Uc,MAX_SAFE_COMPONENT_LENGTH:Pd,MAX_SAFE_BUILD_LENGTH:Fd,MAX_SAFE_INTEGER:Dd,RELEASE_TYPES:Bd,SEMVER_SPEC_VERSION:$d,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Vd=typeof Yi=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Gr=Vd;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r}=qr,i=Gr;e=t.exports={};const s=e.re=[],o=e.safeRe=[],a=e.src=[],c=e.t={};let l=0;const h="[a-zA-Z0-9-]",u=[["\\s",1],["\\d",n],[h,r]],d=p=>{for(const[g,S]of u)p=p.split(`${g}*`).join(`${g}{0,${S}}`).split(`${g}+`).join(`${g}{1,${S}}`);return p},f=(p,g,S)=>{const v=d(g),m=l++;i(p,m,g),c[p]=m,a[m]=g,s[m]=new RegExp(g,S?"g":void 0),o[m]=new RegExp(v,S?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),f("MAINVERSION",`(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${a[c.NUMERICIDENTIFIER]}|${a[c.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${a[c.NUMERICIDENTIFIERLOOSE]}|${a[c.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${a[c.PRERELEASEIDENTIFIER]}(?:\\.${a[c.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${a[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[c.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${h}+`),f("BUILD",`(?:\\+(${a[c.BUILDIDENTIFIER]}(?:\\.${a[c.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${a[c.MAINVERSION]}${a[c.PRERELEASE]}?${a[c.BUILD]}?`),f("FULL",`^${a[c.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${a[c.MAINVERSIONLOOSE]}${a[c.PRERELEASELOOSE]}?${a[c.BUILD]}?`),f("LOOSE",`^${a[c.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${a[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${a[c.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:${a[c.PRERELEASE]})?${a[c.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:${a[c.PRERELEASELOOSE]})?${a[c.BUILD]}?)?)?`),f("XRANGE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAINLOOSE]}$`),f("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),f("COERCERTL",a[c.COERCE],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${a[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",f("TILDE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${a[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",f("CARET",`^${a[c.LONECARET]}${a[c.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${a[c.LONECARET]}${a[c.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${a[c.GTLT]}\\s*(${a[c.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]}|${a[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${a[c.XRANGEPLAIN]})\\s+-\\s+(${a[c.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${a[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[c.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ns,ns.exports);var Kn=ns.exports;const Hd=Object.freeze({loose:!0}),Wd=Object.freeze({}),Ud=t=>t?typeof t!="object"?Hd:t:Wd;var Ms=Ud;const Oo=/^[0-9]+$/,zc=(t,e)=>{const n=Oo.test(t),r=Oo.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},zd=(t,e)=>zc(e,t);var qc={compareIdentifiers:zc,rcompareIdentifiers:zd};const lr=Gr,{MAX_LENGTH:Lo,MAX_SAFE_INTEGER:hr}=qr,{safeRe:jo,t:$o}=Kn,qd=Ms,{compareIdentifiers:Wt}=qc;let Gd=class Ke{constructor(e,n){if(n=qd(n),e instanceof Ke){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Lo)throw new TypeError(`version is longer than ${Lo} characters`);lr("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?jo[$o.LOOSE]:jo[$o.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>hr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hr||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<hr)return s}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(lr("SemVer.compare",this.version,this.options,e),!(e instanceof Ke)){if(typeof e=="string"&&e===this.version)return 0;e=new Ke(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Ke||(e=new Ke(e,this.options)),Wt(this.major,e.major)||Wt(this.minor,e.minor)||Wt(this.patch,e.patch)}comparePre(e){if(e instanceof Ke||(e=new Ke(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=e.prerelease[n];if(lr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Wt(r,i)}while(++n)}compareBuild(e){e instanceof Ke||(e=new Ke(e,this.options));let n=0;do{const r=this.build[n],i=e.build[n];if(lr("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Wt(r,i)}while(++n)}inc(e,n,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(r)?1:0;if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let s=[n,i];r===!1&&(s=[n]),Wt(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var ke=Gd;const Do=ke,Jd=(t,e,n=!1)=>{if(t instanceof Do)return t;try{return new Do(t,e)}catch(r){if(!n)return null;throw r}};var yn=Jd;const Qd=yn,Zd=(t,e)=>{const n=Qd(t,e);return n?n.version:null};var Yd=Zd;const Kd=yn,Xd=(t,e)=>{const n=Kd(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};var ep=Xd;const Po=ke,tp=(t,e,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new Po(t instanceof Po?t.version:t,n).inc(e,r,i).version}catch{return null}};var np=tp;const Fo=yn,rp=(t,e)=>{const n=Fo(t,null,!0),r=Fo(e,null,!0),i=n.compare(r);if(i===0)return null;const s=i>0,o=s?n:r,a=s?r:n,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const h=c?"pre":"";return n.major!==r.major?h+"major":n.minor!==r.minor?h+"minor":n.patch!==r.patch?h+"patch":"prerelease"};var ip=rp;const sp=ke,op=(t,e)=>new sp(t,e).major;var ap=op;const cp=ke,up=(t,e)=>new cp(t,e).minor;var lp=up;const hp=ke,fp=(t,e)=>new hp(t,e).patch;var dp=fp;const pp=yn,bp=(t,e)=>{const n=pp(t,e);return n&&n.prerelease.length?n.prerelease:null};var gp=bp;const Bo=ke,mp=(t,e,n)=>new Bo(t,n).compare(new Bo(e,n));var Ge=mp;const vp=Ge,yp=(t,e,n)=>vp(e,t,n);var wp=yp;const _p=Ge,Sp=(t,e)=>_p(t,e,!0);var Ep=Sp;const Vo=ke,Cp=(t,e,n)=>{const r=new Vo(t,n),i=new Vo(e,n);return r.compare(i)||r.compareBuild(i)};var Ts=Cp;const Ip=Ts,kp=(t,e)=>t.sort((n,r)=>Ip(n,r,e));var xp=kp;const Rp=Ts,Mp=(t,e)=>t.sort((n,r)=>Rp(r,n,e));var Tp=Mp;const Ap=Ge,Np=(t,e,n)=>Ap(t,e,n)>0;var Jr=Np;const Op=Ge,Lp=(t,e,n)=>Op(t,e,n)<0;var As=Lp;const jp=Ge,$p=(t,e,n)=>jp(t,e,n)===0;var Gc=$p;const Dp=Ge,Pp=(t,e,n)=>Dp(t,e,n)!==0;var Jc=Pp;const Fp=Ge,Bp=(t,e,n)=>Fp(t,e,n)>=0;var Ns=Bp;const Vp=Ge,Hp=(t,e,n)=>Vp(t,e,n)<=0;var Os=Hp;const Wp=Gc,Up=Jc,zp=Jr,qp=Ns,Gp=As,Jp=Os,Qp=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Wp(t,n,r);case"!=":return Up(t,n,r);case">":return zp(t,n,r);case">=":return qp(t,n,r);case"<":return Gp(t,n,r);case"<=":return Jp(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};var Qc=Qp;const Zp=ke,Yp=yn,{safeRe:fr,t:dr}=Kn,Kp=(t,e)=>{if(t instanceof Zp)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(fr[dr.COERCE]);else{let r;for(;(r=fr[dr.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||r.index+r[0].length!==n.index+n[0].length)&&(n=r),fr[dr.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;fr[dr.COERCERTL].lastIndex=-1}return n===null?null:Yp(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,e)};var Xp=Kp,Ti,Ho;function e0(){return Ho||(Ho=1,Ti=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ti}var t0=z;z.Node=jt;z.create=z;function z(t){var e=this;if(e instanceof z||(e=new z),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}z.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e};z.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};z.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};z.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)r0(this,arguments[t]);return this.length};z.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)i0(this,arguments[t]);return this.length};z.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};z.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};z.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;n!==null;r++)t.call(e,n.value,r,this),n=n.next};z.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;n!==null;r--)t.call(e,n.value,r,this),n=n.prev};z.prototype.get=function(t){for(var e=0,n=this.head;n!==null&&e<t;e++)n=n.next;if(e===t&&n!==null)return n.value};z.prototype.getReverse=function(t){for(var e=0,n=this.tail;n!==null&&e<t;e++)n=n.prev;if(e===t&&n!==null)return n.value};z.prototype.map=function(t,e){e=e||this;for(var n=new z,r=this.head;r!==null;)n.push(t.call(e,r.value,this)),r=r.next;return n};z.prototype.mapReverse=function(t,e){e=e||this;for(var n=new z,r=this.tail;r!==null;)n.push(t.call(e,r.value,this)),r=r.prev;return n};z.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=t(n,r.value,i),r=r.next;return n};z.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=t(n,r.value,i),r=r.prev;return n};z.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};z.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};z.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(;i!==null&&r<e;r++,i=i.next)n.push(i.value);return n};z.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new z;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;i!==null&&r>e;r--)i=i.prev;for(;i!==null&&r>t;r--,i=i.prev)n.push(i.value);return n};z.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,i=this.head;i!==null&&r<t;r++)i=i.next;for(var s=[],r=0;i&&r<e;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=n0(this,i,n[r]);return s};z.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};function n0(t,e,n){var r=e===t.head?new jt(n,null,e,t):new jt(n,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function r0(t,e){t.tail=new jt(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function i0(t,e){t.head=new jt(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function jt(t,e,n,r){if(!(this instanceof jt))return new jt(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{e0()(z)}catch{}const s0=t0,Tt=Symbol("max"),ut=Symbol("length"),Ut=Symbol("lengthCalculator"),Nn=Symbol("allowStale"),Ot=Symbol("maxAge"),at=Symbol("dispose"),Wo=Symbol("noDisposeOnSet"),pe=Symbol("lruList"),Ue=Symbol("cache"),Zc=Symbol("updateAgeOnGet"),Ai=()=>1;class o0{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[Tt]=e.max||1/0;const n=e.length||Ai;if(this[Ut]=typeof n!="function"?Ai:n,this[Nn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Ot]=e.maxAge||0,this[at]=e.dispose,this[Wo]=e.noDisposeOnSet||!1,this[Zc]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Tt]=e||1/0,In(this)}get max(){return this[Tt]}set allowStale(e){this[Nn]=!!e}get allowStale(){return this[Nn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Ot]=e,In(this)}get maxAge(){return this[Ot]}set lengthCalculator(e){typeof e!="function"&&(e=Ai),e!==this[Ut]&&(this[Ut]=e,this[ut]=0,this[pe].forEach(n=>{n.length=this[Ut](n.value,n.key),this[ut]+=n.length})),In(this)}get lengthCalculator(){return this[Ut]}get length(){return this[ut]}get itemCount(){return this[pe].length}rforEach(e,n){n=n||this;for(let r=this[pe].tail;r!==null;){const i=r.prev;Uo(this,e,r,n),r=i}}forEach(e,n){n=n||this;for(let r=this[pe].head;r!==null;){const i=r.next;Uo(this,e,r,n),r=i}}keys(){return this[pe].toArray().map(e=>e.key)}values(){return this[pe].toArray().map(e=>e.value)}reset(){this[at]&&this[pe]&&this[pe].length&&this[pe].forEach(e=>this[at](e.key,e.value)),this[Ue]=new Map,this[pe]=new s0,this[ut]=0}dump(){return this[pe].map(e=>Cr(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[pe]}set(e,n,r){if(r=r||this[Ot],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[Ut](n,e);if(this[Ue].has(e)){if(s>this[Tt])return Xt(this,this[Ue].get(e)),!1;const c=this[Ue].get(e).value;return this[at]&&(this[Wo]||this[at](e,c.value)),c.now=i,c.maxAge=r,c.value=n,this[ut]+=s-c.length,c.length=s,this.get(e),In(this),!0}const o=new a0(e,n,s,i,r);return o.length>this[Tt]?(this[at]&&this[at](e,n),!1):(this[ut]+=o.length,this[pe].unshift(o),this[Ue].set(e,this[pe].head),In(this),!0)}has(e){if(!this[Ue].has(e))return!1;const n=this[Ue].get(e).value;return!Cr(this,n)}get(e){return Ni(this,e,!0)}peek(e){return Ni(this,e,!1)}pop(){const e=this[pe].tail;return e?(Xt(this,e),e.value):null}del(e){Xt(this,this[Ue].get(e))}load(e){this.reset();const n=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-n;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Ue].forEach((e,n)=>Ni(this,n,!1))}}const Ni=(t,e,n)=>{const r=t[Ue].get(e);if(r){const i=r.value;if(Cr(t,i)){if(Xt(t,r),!t[Nn])return}else n&&(t[Zc]&&(r.value.now=Date.now()),t[pe].unshiftNode(r));return i.value}},Cr=(t,e)=>{if(!e||!e.maxAge&&!t[Ot])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[Ot]&&n>t[Ot]},In=t=>{if(t[ut]>t[Tt])for(let e=t[pe].tail;t[ut]>t[Tt]&&e!==null;){const n=e.prev;Xt(t,e),e=n}},Xt=(t,e)=>{if(e){const n=e.value;t[at]&&t[at](n.key,n.value),t[ut]-=n.length,t[Ue].delete(n.key),t[pe].removeNode(e)}};class a0{constructor(e,n,r,i,s){this.key=e,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Uo=(t,e,n,r)=>{let i=n.value;Cr(t,i)&&(Xt(t,n),t[Nn]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};var c0=o0,Oi,zo;function Je(){if(zo)return Oi;zo=1;class t{constructor(w,M){if(M=r(M),w instanceof t)return w.loose===!!M.loose&&w.includePrerelease===!!M.includePrerelease?w:new t(w.raw,M);if(w instanceof i)return this.raw=w.value,this.set=[[w]],this.format(),this;if(this.options=M,this.loose=!!M.loose,this.includePrerelease=!!M.includePrerelease,this.raw=w.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(k=>this.parseRange(k)).filter(k=>k.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const k=this.set[0];if(this.set=this.set.filter(A=>!p(A[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(const A of this.set)if(A.length===1&&g(A[0])){this.set=[A];break}}}this.format()}format(){return this.range=this.set.map(w=>w.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(w){const k=((this.options.includePrerelease&&d)|(this.options.loose&&f))+":"+w,A=n.get(k);if(A)return A;const x=this.options.loose,$=x?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];w=w.replace($,fe(this.options.includePrerelease)),s("hyphen replace",w),w=w.replace(a[c.COMPARATORTRIM],l),s("comparator trim",w),w=w.replace(a[c.TILDETRIM],h),s("tilde trim",w),w=w.replace(a[c.CARETTRIM],u),s("caret trim",w);let G=w.split(" ").map(ce=>v(ce,this.options)).join(" ").split(/\s+/).map(ce=>V(ce,this.options));x&&(G=G.filter(ce=>(s("loose invalid filter",ce,this.options),!!ce.match(a[c.COMPARATORLOOSE])))),s("range list",G);const B=new Map,ee=G.map(ce=>new i(ce,this.options));for(const ce of ee){if(p(ce))return[ce];B.set(ce.value,ce)}B.size>1&&B.has("")&&B.delete("");const Me=[...B.values()];return n.set(k,Me),Me}intersects(w,M){if(!(w instanceof t))throw new TypeError("a Range is required");return this.set.some(k=>S(k,M)&&w.set.some(A=>S(A,M)&&k.every(x=>A.every($=>x.intersects($,M)))))}test(w){if(!w)return!1;if(typeof w=="string")try{w=new o(w,this.options)}catch{return!1}for(let M=0;M<this.set.length;M++)if(q(this.set[M],w,this.options))return!0;return!1}}Oi=t;const e=c0,n=new e({max:1e3}),r=Ms,i=Qr(),s=Gr,o=ke,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:h,caretTrimReplace:u}=Kn,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:f}=qr,p=_=>_.value==="<0.0.0-0",g=_=>_.value==="",S=(_,w)=>{let M=!0;const k=_.slice();let A=k.pop();for(;M&&k.length;)M=k.every(x=>A.intersects(x,w)),A=k.pop();return M},v=(_,w)=>(s("comp",_,w),_=y(_,w),s("caret",_),_=E(_,w),s("tildes",_),_=F(_,w),s("xrange",_),_=L(_,w),s("stars",_),_),m=_=>!_||_.toLowerCase()==="x"||_==="*",E=(_,w)=>_.trim().split(/\s+/).map(M=>C(M,w)).join(" "),C=(_,w)=>{const M=w.loose?a[c.TILDELOOSE]:a[c.TILDE];return _.replace(M,(k,A,x,$,G)=>{s("tilde",_,k,A,x,$,G);let B;return m(A)?B="":m(x)?B=`>=${A}.0.0 <${+A+1}.0.0-0`:m($)?B=`>=${A}.${x}.0 <${A}.${+x+1}.0-0`:G?(s("replaceTilde pr",G),B=`>=${A}.${x}.${$}-${G} <${A}.${+x+1}.0-0`):B=`>=${A}.${x}.${$} <${A}.${+x+1}.0-0`,s("tilde return",B),B})},y=(_,w)=>_.trim().split(/\s+/).map(M=>T(M,w)).join(" "),T=(_,w)=>{s("caret",_,w);const M=w.loose?a[c.CARETLOOSE]:a[c.CARET],k=w.includePrerelease?"-0":"";return _.replace(M,(A,x,$,G,B)=>{s("caret",_,A,x,$,G,B);let ee;return m(x)?ee="":m($)?ee=`>=${x}.0.0${k} <${+x+1}.0.0-0`:m(G)?x==="0"?ee=`>=${x}.${$}.0${k} <${x}.${+$+1}.0-0`:ee=`>=${x}.${$}.0${k} <${+x+1}.0.0-0`:B?(s("replaceCaret pr",B),x==="0"?$==="0"?ee=`>=${x}.${$}.${G}-${B} <${x}.${$}.${+G+1}-0`:ee=`>=${x}.${$}.${G}-${B} <${x}.${+$+1}.0-0`:ee=`>=${x}.${$}.${G}-${B} <${+x+1}.0.0-0`):(s("no pr"),x==="0"?$==="0"?ee=`>=${x}.${$}.${G}${k} <${x}.${$}.${+G+1}-0`:ee=`>=${x}.${$}.${G}${k} <${x}.${+$+1}.0-0`:ee=`>=${x}.${$}.${G} <${+x+1}.0.0-0`),s("caret return",ee),ee})},F=(_,w)=>(s("replaceXRanges",_,w),_.split(/\s+/).map(M=>K(M,w)).join(" ")),K=(_,w)=>{_=_.trim();const M=w.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return _.replace(M,(k,A,x,$,G,B)=>{s("xRange",_,k,A,x,$,G,B);const ee=m(x),Me=ee||m($),ce=Me||m(G),Cn=ce;return A==="="&&Cn&&(A=""),B=w.includePrerelease?"-0":"",ee?A===">"||A==="<"?k="<0.0.0-0":k="*":A&&Cn?(Me&&($=0),G=0,A===">"?(A=">=",Me?(x=+x+1,$=0,G=0):($=+$+1,G=0)):A==="<="&&(A="<",Me?x=+x+1:$=+$+1),A==="<"&&(B="-0"),k=`${A+x}.${$}.${G}${B}`):Me?k=`>=${x}.0.0${B} <${+x+1}.0.0-0`:ce&&(k=`>=${x}.${$}.0${B} <${x}.${+$+1}.0-0`),s("xRange return",k),k})},L=(_,w)=>(s("replaceStars",_,w),_.trim().replace(a[c.STAR],"")),V=(_,w)=>(s("replaceGTE0",_,w),_.trim().replace(a[w.includePrerelease?c.GTE0PRE:c.GTE0],"")),fe=_=>(w,M,k,A,x,$,G,B,ee,Me,ce,Cn,j2)=>(m(k)?M="":m(A)?M=`>=${k}.0.0${_?"-0":""}`:m(x)?M=`>=${k}.${A}.0${_?"-0":""}`:$?M=`>=${M}`:M=`>=${M}${_?"-0":""}`,m(ee)?B="":m(Me)?B=`<${+ee+1}.0.0-0`:m(ce)?B=`<${ee}.${+Me+1}.0-0`:Cn?B=`<=${ee}.${Me}.${ce}-${Cn}`:_?B=`<${ee}.${Me}.${+ce+1}-0`:B=`<=${B}`,`${M} ${B}`.trim()),q=(_,w,M)=>{for(let k=0;k<_.length;k++)if(!_[k].test(w))return!1;if(w.prerelease.length&&!M.includePrerelease){for(let k=0;k<_.length;k++)if(s(_[k].semver),_[k].semver!==i.ANY&&_[k].semver.prerelease.length>0){const A=_[k].semver;if(A.major===w.major&&A.minor===w.minor&&A.patch===w.patch)return!0}return!1}return!0};return Oi}var Li,qo;function Qr(){if(qo)return Li;qo=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(h,u){if(u=n(u),h instanceof e){if(h.loose===!!u.loose)return h;h=h.value}h=h.trim().split(/\s+/).join(" "),o("comparator",h,u),this.options=u,this.loose=!!u.loose,this.parse(h),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(h){const u=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=h.match(u);if(!d)throw new TypeError(`Invalid comparator: ${h}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=t}toString(){return this.value}test(h){if(o("Comparator.test",h,this.options.loose),this.semver===t||h===t)return!0;if(typeof h=="string")try{h=new a(h,this.options)}catch{return!1}return s(h,this.operator,this.semver,this.options)}intersects(h,u){if(!(h instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(h.value,u).test(this.value):h.operator===""?h.value===""?!0:new c(this.value,u).test(h.semver):(u=n(u),u.includePrerelease&&(this.value==="<0.0.0-0"||h.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||h.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&h.operator.startsWith(">")||this.operator.startsWith("<")&&h.operator.startsWith("<")||this.semver.version===h.semver.version&&this.operator.includes("=")&&h.operator.includes("=")||s(this.semver,"<",h.semver,u)&&this.operator.startsWith(">")&&h.operator.startsWith("<")||s(this.semver,">",h.semver,u)&&this.operator.startsWith("<")&&h.operator.startsWith(">")))}}Li=e;const n=Ms,{safeRe:r,t:i}=Kn,s=Qc,o=Gr,a=ke,c=Je();return Li}const u0=Je(),l0=(t,e,n)=>{try{e=new u0(e,n)}catch{return!1}return e.test(t)};var Zr=l0;const h0=Je(),f0=(t,e)=>new h0(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));var d0=f0;const p0=ke,b0=Je(),g0=(t,e,n)=>{let r=null,i=null,s=null;try{s=new b0(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===-1)&&(r=o,i=new p0(r,n))}),r};var m0=g0;const v0=ke,y0=Je(),w0=(t,e,n)=>{let r=null,i=null,s=null;try{s=new y0(e,n)}catch{return null}return t.forEach(o=>{s.test(o)&&(!r||i.compare(o)===1)&&(r=o,i=new v0(r,n))}),r};var _0=w0;const ji=ke,S0=Je(),Go=Jr,E0=(t,e)=>{t=new S0(t,e);let n=new ji("0.0.0");if(t.test(n)||(n=new ji("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){const i=t.set[r];let s=null;i.forEach(o=>{const a=new ji(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Go(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!n||Go(n,s))&&(n=s)}return n&&t.test(n)?n:null};var C0=E0;const I0=Je(),k0=(t,e)=>{try{return new I0(t,e).range||"*"}catch{return null}};var x0=k0;const R0=ke,Yc=Qr(),{ANY:M0}=Yc,T0=Je(),A0=Zr,Jo=Jr,Qo=As,N0=Os,O0=Ns,L0=(t,e,n,r)=>{t=new R0(t,r),e=new T0(e,r);let i,s,o,a,c;switch(n){case">":i=Jo,s=N0,o=Qo,a=">",c=">=";break;case"<":i=Qo,s=O0,o=Jo,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(A0(t,e,r))return!1;for(let l=0;l<e.set.length;++l){const h=e.set[l];let u=null,d=null;if(h.forEach(f=>{f.semver===M0&&(f=new Yc(">=0.0.0")),u=u||f,d=d||f,i(f.semver,u.semver,r)?u=f:o(f.semver,d.semver,r)&&(d=f)}),u.operator===a||u.operator===c||(!d.operator||d.operator===a)&&s(t,d.semver))return!1;if(d.operator===c&&o(t,d.semver))return!1}return!0};var Ls=L0;const j0=Ls,$0=(t,e,n)=>j0(t,e,">",n);var D0=$0;const P0=Ls,F0=(t,e,n)=>P0(t,e,"<",n);var B0=F0;const Zo=Je(),V0=(t,e,n)=>(t=new Zo(t,n),e=new Zo(e,n),t.intersects(e,n));var H0=V0;const W0=Zr,U0=Ge;var z0=(t,e,n)=>{const r=[];let i=null,s=null;const o=t.sort((h,u)=>U0(h,u,n));for(const h of o)W0(h,e,n)?(s=h,i||(i=h)):(s&&r.push([i,s]),s=null,i=null);i&&r.push([i,null]);const a=[];for(const[h,u]of r)h===u?a.push(h):!u&&h===o[0]?a.push("*"):u?h===o[0]?a.push(`<=${u}`):a.push(`${h} - ${u}`):a.push(`>=${h}`);const c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e};const Yo=Je(),js=Qr(),{ANY:$i}=js,kn=Zr,$s=Ge,q0=(t,e,n={})=>{if(t===e)return!0;t=new Yo(t,n),e=new Yo(e,n);let r=!1;e:for(const i of t.set){for(const s of e.set){const o=J0(i,s,n);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},G0=[new js(">=0.0.0-0")],Ko=[new js(">=0.0.0")],J0=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===$i){if(e.length===1&&e[0].semver===$i)return!0;n.includePrerelease?t=G0:t=Ko}if(e.length===1&&e[0].semver===$i){if(n.includePrerelease)return!0;e=Ko}const r=new Set;let i,s;for(const f of t)f.operator===">"||f.operator===">="?i=Xo(i,f,n):f.operator==="<"||f.operator==="<="?s=ea(s,f,n):r.add(f.semver);if(r.size>1)return null;let o;if(i&&s){if(o=$s(i.semver,s.semver,n),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const f of r){if(i&&!kn(f,String(i),n)||s&&!kn(f,String(s),n))return null;for(const p of e)if(!kn(f,String(p),n))return!1;return!0}let a,c,l,h,u=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;u&&u.prerelease.length===1&&s.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(const f of e){if(h=h||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",i){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator===">"||f.operator===">="){if(a=Xo(i,f,n),a===f&&a!==i)return!1}else if(i.operator===">="&&!kn(i.semver,String(f),n))return!1}if(s){if(u&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===u.major&&f.semver.minor===u.minor&&f.semver.patch===u.patch&&(u=!1),f.operator==="<"||f.operator==="<="){if(c=ea(s,f,n),c===f&&c!==s)return!1}else if(s.operator==="<="&&!kn(s.semver,String(f),n))return!1}if(!f.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&h&&!i&&o!==0||d||u)},Xo=(t,e,n)=>{if(!t)return e;const r=$s(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},ea=(t,e,n)=>{if(!t)return e;const r=$s(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};var Q0=q0;const Di=Kn,ta=qr,Z0=ke,na=qc,Y0=yn,K0=Yd,X0=ep,eb=np,tb=ip,nb=ap,rb=lp,ib=dp,sb=gp,ob=Ge,ab=wp,cb=Ep,ub=Ts,lb=xp,hb=Tp,fb=Jr,db=As,pb=Gc,bb=Jc,gb=Ns,mb=Os,vb=Qc,yb=Xp,wb=Qr(),_b=Je(),Sb=Zr,Eb=d0,Cb=m0,Ib=_0,kb=C0,xb=x0,Rb=Ls,Mb=D0,Tb=B0,Ab=H0,Nb=z0,Ob=Q0;var Lb={parse:Y0,valid:K0,clean:X0,inc:eb,diff:tb,major:nb,minor:rb,patch:ib,prerelease:sb,compare:ob,rcompare:ab,compareLoose:cb,compareBuild:ub,sort:lb,rsort:hb,gt:fb,lt:db,eq:pb,neq:bb,gte:gb,lte:mb,cmp:vb,coerce:yb,Comparator:wb,Range:_b,satisfies:Sb,toComparators:Eb,maxSatisfying:Cb,minSatisfying:Ib,minVersion:kb,validRange:xb,outside:Rb,gtr:Mb,ltr:Tb,intersects:Ab,simplifyRange:Nb,subset:Ob,SemVer:Z0,re:Di.re,src:Di.src,tokens:Di.t,SEMVER_SPEC_VERSION:ta.SEMVER_SPEC_VERSION,RELEASE_TYPES:ta.RELEASE_TYPES,compareIdentifiers:na.compareIdentifiers,rcompareIdentifiers:na.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=Lb,n=Bt,r=ye;t.VersionStruct=(0,n.refine)((0,n.string)(),"Version",u=>(0,e.valid)(u)===null?`Expected SemVer version, got "${u}"`:!0),t.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",u=>(0,e.validRange)(u)===null?`Expected SemVer range, got "${u}"`:!0);function i(u){return(0,n.is)(u,t.VersionStruct)}t.isValidSemVerVersion=i;function s(u){return(0,n.is)(u,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(u){(0,r.assertStruct)(u,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(u){(0,r.assertStruct)(u,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(u,d){return(0,e.gt)(u,d)}t.gtVersion=c;function l(u,d){return(0,e.gtr)(u,d)}t.gtRange=l;function h(u,d){return(0,e.satisfies)(u,d,{includePrerelease:!0})}t.satisfiesVersionRange=h})(Wc);(function(t){var e=O&&O.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=O&&O.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(ye,t),n(Zn,t),n(W,t),n(Ur,t),n(nt,t),n(on,t),n(Yn,t),n(Bc,t),n(an,t),n(Rs,t),n(rt,t),n(Vc,t),n(Hc,t),n(Wc,t)})(_c);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=_c;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(wc);var Kc=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.PollingBlockTracker=void 0;const jb=Kc(Ja),$b=Kc(xl),Db=Jn,ra=wc,ia=(0,ra.createModuleLogger)(ra.projectLogger,"polling-block-tracker"),Pb=(0,jb.default)(),Fb=1e3;class Bb extends Db.BaseBlockTracker{constructor(e={}){var n;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(n=e.blockResetDuration)!==null&&n!==void 0?n:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*Fb,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const n=sa(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await n}catch(n){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
2
2
  ${(e=n.stack)!==null&&e!==void 0?e:n}`);try{this.emit("error",r)}catch{console.error(r)}const i=sa(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:Pb(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),ia("Making request",e);const n=await(0,$b.default)(r=>this._provider.sendAsync(e,r))();if(ia("Got response",n),n.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
3
3
  ${n.error.message}`);return n.result}}Hr.PollingBlockTracker=Bb;function sa(t,e){return new Promise(n=>{const r=setTimeout(n,t);r.unref&&e&&r.unref()})}var Yr={},Vb=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.SubscribeBlockTracker=void 0;const Hb=Vb(Ja),Wb=Jn,Ub=(0,Hb.default)();class zb extends Wb.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...n){return new Promise((r,i)=>{this._provider.sendAsync({id:Ub(),method:e,params:n,jsonrpc:"2.0"},(s,o)=>{s?i(s):r(o.result)})})}_handleSubData(e,n){var r;n.method==="eth_subscription"&&((r=n.params)===null||r===void 0?void 0:r.subscription)===this._subscriptionId&&this._newPotentialLatest(n.params.result.number)}}Yr.SubscribeBlockTracker=zb;var Xc={};Object.defineProperty(Xc,"__esModule",{value:!0});(function(t){var e=O&&O.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=O&&O.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(Hr,t),n(Yr,t),n(Xc,t)})(yc);const oa=(t,e,n,r)=>function(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...l)=>{e.errorFirst?l[0]?a(l):(l.shift(),o(l)):o(l)}):e.errorFirst?i.push((l,h)=>{l?a(l):o(h)}):i.push(o),Reflect.apply(t,this===n?r:this,i)})},aa=new WeakMap;var qb=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const n=typeof t;if(!(t!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":n}\``);const r=(o,a)=>{let c=aa.get(o);if(c||(c={},aa.set(o,c)),a in c)return c[a];const l=p=>typeof p=="string"||typeof a=="symbol"?a===p:p.test(a),h=Reflect.getOwnPropertyDescriptor(o,a),u=h===void 0||h.writable||h.configurable,f=(e.include?e.include.some(l):!e.exclude.some(l))&&u;return c[a]=f,f},i=new WeakMap,s=new Proxy(t,{apply(o,a,c){const l=i.get(o);if(l)return Reflect.apply(l,a,c);const h=e.excludeMain?o:oa(o,e,s,o);return i.set(o,h),Reflect.apply(h,a,c)},get(o,a){const c=o[a];if(!r(o,a)||c===Function.prototype[a])return c;const l=i.get(c);if(l)return l;if(typeof c=="function"){const h=oa(c,e,s,o);return i.set(c,h),h}return c}});return s};const Gb=Lr.default;let Jb=class extends Gb{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(n=>this.emit("update",n))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var Ds=Jb;const Qb=Ds;let Zb=class extends Qb{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var Yb=Zb,Xn={minBlockRef:Kb,maxBlockRef:Xb,sortBlockRefs:Ps,bnToHex:eg,blockRefIsNumber:tg,hexToInt:Ir,incrementHexInt:ng,intToHex:eu,unsafeRandomBytes:rg};function Kb(...t){return Ps(t)[0]}function Xb(...t){const e=Ps(t);return e[e.length-1]}function Ps(t){return t.sort((e,n)=>e==="latest"||n==="earliest"?1:n==="latest"||e==="earliest"?-1:Ir(e)-Ir(n))}function eg(t){return"0x"+t.toString(16)}function tg(t){return t&&!["earliest","latest","pending"].includes(t)}function Ir(t){return t==null?t:Number.parseInt(t,16)}function ng(t){if(t==null)return t;const e=Ir(t);return eu(e+1)}function eu(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function rg(t){let e="0x";for(let n=0;n<t;n++)e+=ca(),e+=ca();return e}function ca(){return Math.floor(Math.random()*16).toString(16)}const ig=Rl,sg=qb,og=Yb,{bnToHex:F2,hexToInt:pr,incrementHexInt:ag,minBlockRef:cg,blockRefIsNumber:ug}=Xn;let lg=class extends og{constructor({provider:e,params:n}){super(),this.type="log",this.ethQuery=new ig(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},n),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(r=>r.toLowerCase()))}async initialize({currentBlock:e}){let n=this.params.fromBlock;["latest","pending"].includes(n)&&(n=e),n==="earliest"&&(n="0x0"),this.params.fromBlock=n;const r=cg(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:r}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:n}){const r=n;let i;e?i=ag(e):i=n;const s=Object.assign({},this.params,{fromBlock:i,toBlock:r}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await sg(r=>this.ethQuery.getLogs(e,r))()}matchLog(e){if(pr(this.params.fromBlock)>=pr(e.blockNumber)||ug(this.params.toBlock)&&pr(this.params.toBlock)<=pr(e.blockNumber))return!1;const n=e.address&&e.address.toLowerCase();return this.params.address&&n&&!this.params.address.includes(n)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(h=>h.toLowerCase()),a.includes(o))})}};var hg=lg,Fs=fg;async function fg({provider:t,fromBlock:e,toBlock:n}){e||(e=n);const r=ua(e),s=ua(n)-r+1,o=Array(s).fill().map((c,l)=>r+l).map(dg);return await Promise.all(o.map(c=>bg(t,"eth_getBlockByNumber",[c,!1])))}function ua(t){return t==null?t:Number.parseInt(t,16)}function dg(t){return t==null?t:"0x"+t.toString(16)}function pg(t,e){return new Promise((n,r)=>{t.sendAsync(e,(i,s)=>{i?r(i):s.error?r(s.error):s.result?n(s.result):r(new Error("Result was empty"))})})}async function bg(t,e,n){for(let r=0;r<3;r++)try{return await pg(t,{id:1,jsonrpc:"2.0",method:e,params:n})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(n)}`)}const gg=Ds,mg=Fs,{incrementHexInt:vg}=Xn;let yg=class extends gg{constructor({provider:e,params:n}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:n}){const r=n,i=vg(e),o=(await mg({provider:this.provider,fromBlock:i,toBlock:r})).map(a=>a.hash);this.addResults(o)}};var wg=yg;const _g=Ds,Sg=Fs,{incrementHexInt:Eg}=Xn;let Cg=class extends _g{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const n=e,r=Eg(e),i=await Sg({provider:this.provider,fromBlock:r,toBlock:n}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var Ig=Cg;const kg=Ml.Mutex,{createAsyncMiddleware:xg,createScaffoldMiddleware:Rg}=Qa,Mg=hg,Tg=wg,Ag=Ig,{intToHex:tu,hexToInt:Pi}=Xn;var Ng=Og;function Og({blockTracker:t,provider:e}){let n=0,r={};const i=new kg,s=Lg({mutex:i}),o=Rg({eth_newFilter:s(Fi(c)),eth_newBlockFilter:s(Fi(l)),eth_newPendingTransactionFilter:s(Fi(h)),eth_uninstallFilter:s(wr(f)),eth_getFilterChanges:s(wr(u)),eth_getFilterLogs:s(wr(d))}),a=async({oldBlock:m,newBlock:E})=>{if(r.length===0)return;const C=await i.acquire();try{await Promise.all(zt(r).map(async y=>{try{await y.update({oldBlock:m,newBlock:E})}catch(T){console.error(T)}}))}catch(y){console.error(y)}C()};return o.newLogFilter=c,o.newBlockFilter=l,o.newPendingTransactionFilter=h,o.uninstallFilter=f,o.getFilterChanges=u,o.getFilterLogs=d,o.destroy=()=>{S()},o;async function c(m){const E=new Mg({provider:e,params:m});return await p(E),E}async function l(){const m=new Tg({provider:e});return await p(m),m}async function h(){const m=new Ag({provider:e});return await p(m),m}async function u(m){const E=Pi(m),C=r[E];if(!C)throw new Error(`No filter for index "${E}"`);return C.getChangesAndClear()}async function d(m){const E=Pi(m),C=r[E];if(!C)throw new Error(`No filter for index "${E}"`);let y=[];return C.type==="log"&&(y=C.getAllResults()),y}async function f(m){const E=Pi(m),y=!!r[E];return y&&await g(E),y}async function p(m){const E=zt(r).length,C=await t.getLatestBlock();await m.initialize({currentBlock:C}),n++,r[n]=m,m.id=n,m.idHex=tu(n);const y=zt(r).length;return v({prevFilterCount:E,newFilterCount:y}),n}async function g(m){const E=zt(r).length;delete r[m];const C=zt(r).length;v({prevFilterCount:E,newFilterCount:C})}async function S(){const m=zt(r).length;r={},v({prevFilterCount:m,newFilterCount:0})}function v({prevFilterCount:m,newFilterCount:E}){if(m===0&&E>0){t.on("sync",a);return}if(m>0&&E===0){t.removeListener("sync",a);return}}}function Fi(t){return wr(async(...e)=>{const n=await t(...e);return tu(n.id)})}function wr(t){return xg(async(e,n)=>{const r=await t.apply(null,e.params);n.result=r})}function Lg({mutex:t}){return e=>async(n,r,i,s)=>{(await t.acquire())(),e(n,r,i,s)}}function zt(t,e){const n=[];for(let r in t)n.push(t[r]);return n}const jg=Lr.default,{createAsyncMiddleware:la,createScaffoldMiddleware:$g}=Qa,Dg=Ng,{unsafeRandomBytes:Pg,incrementHexInt:Fg}=Xn,Bg=Fs;var Vg=Hg;function Hg({blockTracker:t,provider:e}){const n={},r=Dg({blockTracker:t,provider:e});let i=!1;const s=new jg,o=$g({eth_subscribe:la(a),eth_unsubscribe:la(c)});return o.destroy=h,{events:s,middleware:o};async function a(u,d){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const f=u.params[0],p=Pg(16);let g;switch(f){case"newHeads":g=S({subId:p});break;case"logs":const m=u.params[1],E=await r.newLogFilter(m);g=v({subId:p,filter:E});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${f}"`)}n[p]=g,d.result=p;return;function S({subId:m}){const E={type:f,destroy:async()=>{t.removeListener("sync",E.update)},update:async({oldBlock:C,newBlock:y})=>{const T=y,F=Fg(C);(await Bg({provider:e,fromBlock:F,toBlock:T})).map(Wg).filter(V=>V!==null).forEach(V=>{l(m,V)})}};return t.on("sync",E.update),E}function v({subId:m,filter:E}){return E.on("update",y=>l(m,y)),{type:f,destroy:async()=>await r.uninstallFilter(E.idHex)}}}async function c(u,d){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const f=u.params[0],p=n[f];if(!p){d.result=!1;return}delete n[f],await p.destroy(),d.result=!0}function l(u,d){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:u,result:d}})}function h(){s.removeAllListeners();for(const u in n)n[u].destroy(),delete n[u];i=!0}}function Wg(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(Vr,"__esModule",{value:!0});Vr.SubscriptionManager=void 0;const Ug=yc,zg=Vg,ha=()=>{};class qg{constructor(e){const n=new Ug.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:r,middleware:i}=zg({blockTracker:n,provider:e});this.events=r,this.subscriptionMiddleware=i}async handleRequest(e){const n={};return await this.subscriptionMiddleware(e,n,ha,ha),n}destroy(){this.subscriptionMiddleware.destroy()}}Vr.SubscriptionManager=qg;var Bs=O&&O.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nn,"__esModule",{value:!0});nn.CoinbaseWalletProvider=void 0;const Gg=Bs(Lr),Jg=Bs(Or),Bi=bn,Q=Wn,fa=gn,da=qe,Vi=Pr,Qg=Y,D=I,Hi=Bs(Xh),Zg=sn,J=vc,Yg=Vr,pa="DefaultChainId",ba="DefaultJsonRpcUrl";class Kg extends Gg.default{constructor(e){var n,r;super(),this._filterPolyfill=new Zg.FilterPolyfill(this),this._subscriptionManager=new Yg.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(n=e.overrideIsCoinbaseWallet)!==null&&n!==void 0?n:!0,this.isCoinbaseBrowser=(r=e.overrideIsCoinbaseBrowser)!==null&&r!==void 0?r:!1,this.qrUrl=e.qrUrl,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;const i=this.getChainId(),s=(0,D.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(da.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,D.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="defaultChainChanged"||a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,h=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(h,Number(l))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,D.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(ba))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(ba,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,n){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=n,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,n){this.jsonRpcUrl=e;const r=this.getChainId();this._storage.setItem(pa,n.toString(10)),((0,D.ensureIntNumber)(n)!==r||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,n,r,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,n,r,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,n,r,i,s,o){var a,c;if((0,D.ensureIntNumber)(e)===this.getChainId())return!1;const l=await this.initializeRelay(),h=l.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!h&&await l.requestEthereumAccounts().promise;const u=await l.addEthereumChain(e.toString(),n,s,r,i,o).promise;return((a=u.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(n[0],e),((c=u.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){const r=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,Qg.isErrorResponse)(r)&&r.errorCode)throw r.errorCode===Q.standardErrorCodes.provider.unsupportedChain?Q.standardErrors.provider.unsupportedChain(e):Q.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode});const i=r.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,n){this.initializeRelay().then(r=>r.setAppInfo(e,n))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(Bi.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?fa.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this.send(J.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,n){try{const r=this._send(e,n);if(r instanceof Promise)return r.catch(i=>{throw(0,Q.serializeError)(i,e)})}catch(r){throw(0,Q.serializeError)(r,e)}}_send(e,n){if(typeof e=="string"){const i=e,s=Array.isArray(n)?n:n!==void 0?[n]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof n=="function"){const i=e,s=n;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const r=e;return this._sendRequest(r)}async sendAsync(e,n){try{return this._sendAsync(e,n).catch(r=>{throw(0,Q.serializeError)(r,e)})}catch(r){return Promise.reject((0,Q.serializeError)(r,e))}}async _sendAsync(e,n){if(typeof n!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=n;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const r=n;return this._sendRequestAsync(e).then(i=>r(null,i)).catch(i=>r(i,null))}async request(e){try{return this._request(e).catch(n=>{throw(0,Q.serializeError)(n,e.method)})}catch(n){return Promise.reject((0,Q.serializeError)(n,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Q.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:n,params:r}=e;if(typeof n!="string"||n.length===0)throw Q.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))throw Q.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=r===void 0?[]:r,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:n,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){var n;const i=await(await this.initializeRelay()).scanQRCode((0,D.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,Q.serializeError)((n=i.errorMessage)!==null&&n!==void 0?n:"result was not a string",Vi.Web3Method.scanQRCode);return i.result}async genericRequest(e,n){var r;const s=await(await this.initializeRelay()).genericRequest(e,n).promise;if(typeof s.result!="string")throw(0,Q.serializeError)((r=s.errorMessage)!==null&&r!==void 0?r:"result was not a string",Vi.Web3Method.generic);return s.result}async selectProvider(e){var n;const i=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof i.result!="string")throw(0,Q.serializeError)((n=i.errorMessage)!==null&&n!==void 0?n:"result was not a string",Vi.Web3Method.selectProvider);return i.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const n={jsonrpc:"2.0",id:e.id},{method:r}=e;if(n.result=this._handleSynchronousMethods(e),n.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${r} synchronously without a callback. Please provide a callback parameter to call ${r} asynchronously.`);return n}_setAddresses(e,n){if(!Array.isArray(e))throw new Error("addresses is not an array");const r=e.map(i=>(0,D.ensureAddressString)(i));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!n||(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(da.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" "))))}_sendRequestAsync(e){return new Promise((n,r)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return n({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>n(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>r(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>n({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>r(a));return}}catch(i){return r(i)}this._handleAsynchronousMethods(e).then(i=>i&&n(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>r(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(n=>this._sendRequestAsync(n)))}_handleSynchronousMethods(e){const{method:n}=e,r=e.params||[];switch(n){case J.JSONRPCMethod.eth_accounts:return this._eth_accounts();case J.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case J.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(r);case J.JSONRPCMethod.net_version:return this._net_version();case J.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:n}=e,r=e.params||[];switch(n){case J.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case J.JSONRPCMethod.eth_sign:return this._eth_sign(r);case J.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(r);case J.JSONRPCMethod.personal_sign:return this._personal_sign(r);case J.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(r);case J.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(r);case J.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(r);case J.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(r);case J.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(r);case J.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case J.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(r);case J.JSONRPCMethod.eth_signTypedData_v4:case J.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(r);case J.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(r);case J.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(r);case J.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(r);case J.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(r)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:n}=e,r=e.params||[];switch(n){case J.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(r);case J.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case J.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case J.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(r);case J.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(r)}}_handleSubscriptionMethods(e){switch(e.method){case J.JSONRPCMethod.eth_subscribe:case J.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const n=(0,D.ensureAddressString)(e);return this._addresses.map(i=>(0,D.ensureAddressString)(i)).includes(n)}catch{}return!1}_ensureKnownAddress(e){var n;if(!this._isKnownAddress(e))throw(n=this.diagnostic)===null||n===void 0||n.log(Bi.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const n=e.from?(0,D.ensureAddressString)(e.from):this.selectedAddress;if(!n)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(n);const r=e.to?(0,D.ensureAddressString)(e.to):null,i=e.value!=null?(0,D.ensureBN)(e.value):new Jg.default(0),s=e.data?(0,D.ensureBuffer)(e.data):U.alloc(0),o=e.nonce!=null?(0,D.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,D.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,D.ensureBN)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,D.ensureBN)(e.maxPriorityFeePerGas):null,h=e.gas!=null?(0,D.ensureBN)(e.gas):null,u=this.getChainId();return{fromAddress:n,toAddress:r,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:h,chainId:u}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Q.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Q.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,n,r,i){this._ensureKnownAddress(n);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,n,r,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,n,r){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,n,r).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,D.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(pa);if(!e)return(0,D.ensureIntNumber)(this._chainIdFromOpts);const n=parseInt(e,10);return(0,D.ensureIntNumber)(n)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(Bi.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?fa.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let n;try{n=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied account authorization"):r}if(!n.result)throw new Error("accounts received is empty");return this._setAddresses(n.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const n=(0,D.ensureAddressString)(e[0]),r=(0,D.ensureBuffer)(e[1]);return this._signEthereumMessage(r,n,!1)}_eth_ecRecover(e){const n=(0,D.ensureBuffer)(e[0]),r=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(n,r,!1)}_personal_sign(e){this._requireAuthorization();const n=(0,D.ensureBuffer)(e[0]),r=(0,D.ensureAddressString)(e[1]);return this._signEthereumMessage(n,r,!0)}_personal_ecRecover(e){const n=(0,D.ensureBuffer)(e[0]),r=(0,D.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(n,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();const n=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(n).promise).result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_sendRawTransaction(e){const n=(0,D.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(n,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const n=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(n).promise).result}}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Q.standardErrors.provider.userRejectedRequest("User denied transaction signature"):r}}async _eth_signTypedData_v1(e){this._requireAuthorization();const n=(0,D.ensureParsedJSONObject)(e[0]),r=(0,D.ensureAddressString)(e[1]);this._ensureKnownAddress(r);const i=Hi.default.hashForSignTypedDataLegacy({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const n=(0,D.ensureAddressString)(e[0]),r=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(n);const i=Hi.default.hashForSignTypedData_v3({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const n=(0,D.ensureAddressString)(e[0]),r=(0,D.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(n);const i=Hi.default.hashForSignTypedData_v4({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _cbwallet_arbitrary(e){const n=e[0],r=e[1];if(typeof r!="string")throw new Error("parameter must be a string");if(typeof n!="object"||n===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(n,r)}}async _wallet_addEthereumChain(e){var n,r,i,s;const o=e[0];if(((n=o.rpcUrls)===null||n===void 0?void 0:n.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 Q.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw Q.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(r=o.rpcUrls)!==null&&r!==void 0?r:[],(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 n=e[0];return await this.switchEthereumChain(parseInt(n.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const n=Array.isArray(e)?e[0]:e;if(!n.type)throw Q.standardErrors.rpc.invalidParams("Type is required");if((n==null?void 0:n.type)!=="ERC20")throw Q.standardErrors.rpc.invalidParams(`Asset of type '${n.type}' is not supported`);if(!(n!=null&&n.options))throw Q.standardErrors.rpc.invalidParams("Options are required");if(!(n!=null&&n.options.address))throw Q.standardErrors.rpc.invalidParams("Address is required");const r=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=n.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(n.type,i,s,a,o,r)}}_eth_uninstallFilter(e){const n=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(n)}async _eth_newFilter(e){const n=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(n)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const n=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(n)}_eth_getFilterLogs(e){const n=(0,D.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(n)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((n,r)=>this._setAddresses(n,r)),e.setChainCallback((n,r)=>{this.updateProviderInfo(r,parseInt(n,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}nn.CoinbaseWalletProvider=Kg;var Kr={},Xr={},er,j,nu,ru,At,ga,iu,rs,su,en={},ou=[],Xg=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ei=Array.isArray;function lt(t,e){for(var n in e)t[n]=e[n];return t}function au(t){var e=t.parentNode;e&&e.removeChild(t)}function is(t,e,n){var r,i,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?er.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return On(t,o,r,i,null)}function On(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++nu};return i==null&&j.vnode!=null&&j.vnode(s),s}function em(){return{current:null}}function tr(t){return t.children}function Ln(t,e){this.props=t,this.context=e}function Pn(t,e){if(e==null)return t.__?Pn(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Pn(t):null}function cu(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return cu(t)}}function ss(t){(!t.__d&&(t.__d=!0)&&At.push(t)&&!kr.__r++||ga!==j.debounceRendering)&&((ga=j.debounceRendering)||iu)(kr)}function kr(){var t,e,n,r,i,s,o,a,c;for(At.sort(rs);t=At.shift();)t.__d&&(e=At.length,r=void 0,i=void 0,s=void 0,a=(o=(n=t).__v).__e,(c=n.__P)&&(r=[],i=[],(s=lt({},o)).__v=o.__v+1,Vs(c,o,s,n.__n,c.ownerSVGElement!==void 0,o.__h!=null?[a]:null,r,a??Pn(o),o.__h,i),du(r,o,i),o.__e!=a&&cu(o)),At.length>e&&At.sort(rs));kr.__r=0}function uu(t,e,n,r,i,s,o,a,c,l,h){var u,d,f,p,g,S,v,m,E,C=0,y=r&&r.__k||ou,T=y.length,F=T,K=e.length;for(n.__k=[],u=0;u<K;u++)(p=n.__k[u]=(p=e[u])==null||typeof p=="boolean"||typeof p=="function"?null:typeof p=="string"||typeof p=="number"||typeof p=="bigint"?On(null,p,null,null,p):ei(p)?On(tr,{children:p},null,null,null):p.__b>0?On(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)!=null?(p.__=n,p.__b=n.__b+1,(m=tm(p,y,v=u+C,F))===-1?f=en:(f=y[m]||en,y[m]=void 0,F--),Vs(t,p,f,i,s,o,a,c,l,h),g=p.__e,(d=p.ref)&&f.ref!=d&&(f.ref&&Hs(f.ref,null,p),h.push(d,p.__c||g,p)),g!=null&&(S==null&&(S=g),(E=f===en||f.__v===null)?m==-1&&C--:m!==v&&(m===v+1?C++:m>v?F>K-v?C+=m-v:C--:C=m<v&&m==v-1?m-v:0),v=u+C,typeof p.type!="function"||m===v&&f.__k!==p.__k?typeof p.type=="function"||m===v&&!E?p.__d!==void 0?(c=p.__d,p.__d=void 0):c=g.nextSibling:c=fu(t,g,c):c=lu(p,c,t),typeof n.type=="function"&&(n.__d=c))):(f=y[u])&&f.key==null&&f.__e&&(f.__e==c&&(c=Pn(f)),os(f,f,!1));for(n.__e=S,u=T;u--;)y[u]!=null&&(typeof n.type=="function"&&y[u].__e!=null&&y[u].__e==n.__d&&(n.__d=y[u].__e.nextSibling),os(y[u],y[u]))}function lu(t,e,n){for(var r,i=t.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=t,e=typeof r.type=="function"?lu(r,e,n):fu(n,r.__e,e));return e}function hu(t,e){return e=e||[],t==null||typeof t=="boolean"||(ei(t)?t.some(function(n){hu(n,e)}):e.push(t)),e}function fu(t,e,n){return n==null||n.parentNode!==t?t.insertBefore(e,null):e==n&&e.parentNode!=null||t.insertBefore(e,n),e.nextSibling}function tm(t,e,n,r){var i=t.key,s=t.type,o=n-1,a=n+1,c=e[n];if(c===null||c&&i==c.key&&s===c.type)return n;if(r>(c!=null?1:0))for(;o>=0||a<e.length;){if(o>=0){if((c=e[o])&&i==c.key&&s===c.type)return o;o--}if(a<e.length){if((c=e[a])&&i==c.key&&s===c.type)return a;a++}}return-1}function nm(t,e,n,r,i){var s;for(s in n)s==="children"||s==="key"||s in e||xr(t,s,null,n[s],r);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||n[s]===e[s]||xr(t,s,e[s],n[s],r)}function ma(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Xg.test(e)?n:n+"px"}function xr(t,e,n,r,i){var s;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ma(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||ma(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r||t.addEventListener(e,s?ya:va,s):t.removeEventListener(e,s?ya:va,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,n))}}function va(t){return this.l[t.type+!1](j.event?j.event(t):t)}function ya(t){return this.l[t.type+!0](j.event?j.event(t):t)}function Vs(t,e,n,r,i,s,o,a,c,l){var h,u,d,f,p,g,S,v,m,E,C,y,T,F,K,L=e.type;if(e.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,a=e.__e=n.__e,e.__h=null,s=[a]),(h=j.__b)&&h(e);e:if(typeof L=="function")try{if(v=e.props,m=(h=L.contextType)&&r[h.__c],E=h?m?m.props.value:h.__:r,n.__c?S=(u=e.__c=n.__c).__=u.__E:("prototype"in L&&L.prototype.render?e.__c=u=new L(v,E):(e.__c=u=new Ln(v,E),u.constructor=L,u.render=im),m&&m.sub(u),u.props=v,u.state||(u.state={}),u.context=E,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),L.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=lt({},u.__s)),lt(u.__s,L.getDerivedStateFromProps(v,u.__s))),f=u.props,p=u.state,u.__v=e,d)L.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(L.getDerivedStateFromProps==null&&v!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(v,E),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(v,u.__s,E)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(u.props=v,u.state=u.__s,u.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(V){V&&(V.__=e)}),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(v,u.__s,E),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,p,g)})}if(u.context=E,u.props=v,u.__P=t,u.__e=!1,y=j.__r,T=0,"prototype"in L&&L.prototype.render){for(u.state=u.__s,u.__d=!1,y&&y(e),h=u.render(u.props,u.state,u.context),F=0;F<u._sb.length;F++)u.__h.push(u._sb[F]);u._sb=[]}else do u.__d=!1,y&&y(e),h=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++T<25);u.state=u.__s,u.getChildContext!=null&&(r=lt(lt({},r),u.getChildContext())),d||u.getSnapshotBeforeUpdate==null||(g=u.getSnapshotBeforeUpdate(f,p)),uu(t,ei(K=h!=null&&h.type===tr&&h.key==null?h.props.children:h)?K:[K],e,n,r,i,s,o,a,c,l),u.base=e.__e,e.__h=null,u.__h.length&&o.push(u),S&&(u.__E=u.__=null)}catch(V){e.__v=null,(c||s!=null)&&(e.__e=a,e.__h=!!c,s[s.indexOf(a)]=null),j.__e(V,e,n)}else s==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=rm(n.__e,e,n,r,i,s,o,c,l);(h=j.diffed)&&h(e)}function du(t,e,n){for(var r=0;r<n.length;r++)Hs(n[r],n[++r],n[++r]);j.__c&&j.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){j.__e(s,i.__v)}})}function rm(t,e,n,r,i,s,o,a,c){var l,h,u,d=n.props,f=e.props,p=e.type,g=0;if(p==="svg"&&(i=!0),s!=null){for(;g<s.length;g++)if((l=s[g])&&"setAttribute"in l==!!p&&(p?l.localName===p:l.nodeType===3)){t=l,s[g]=null;break}}if(t==null){if(p===null)return document.createTextNode(f);t=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,f.is&&f),s=null,a=!1}if(p===null)d===f||a&&t.data===f||(t.data=f);else{if(s=s&&er.call(t.childNodes),h=(d=n.props||en).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!a){if(s!=null)for(d={},g=0;g<t.attributes.length;g++)d[t.attributes[g].name]=t.attributes[g].value;(u||h)&&(u&&(h&&u.__html==h.__html||u.__html===t.innerHTML)||(t.innerHTML=u&&u.__html||""))}if(nm(t,f,d,i,a),u)e.__k=[];else if(uu(t,ei(g=e.props.children)?g:[g],e,n,r,i&&p!=="foreignObject",s,o,s?s[0]:n.__k&&Pn(n,0),a,c),s!=null)for(g=s.length;g--;)s[g]!=null&&au(s[g]);a||("value"in f&&(g=f.value)!==void 0&&(g!==t.value||p==="progress"&&!g||p==="option"&&g!==d.value)&&xr(t,"value",g,d.value,!1),"checked"in f&&(g=f.checked)!==void 0&&g!==t.checked&&xr(t,"checked",g,d.checked,!1))}return t}function Hs(t,e,n){try{typeof t=="function"?t(e):t.current=e}catch(r){j.__e(r,n)}}function os(t,e,n){var r,i;if(j.unmount&&j.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Hs(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){j.__e(s,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&os(r[i],e,n||typeof t.type!="function");n||t.__e==null||au(t.__e),t.__=t.__e=t.__d=void 0}function im(t,e,n){return this.constructor(t,n)}function pu(t,e,n){var r,i,s,o;j.__&&j.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,s=[],o=[],Vs(e,t=(!r&&n||e).__k=is(tr,null,[t]),i||en,en,e.ownerSVGElement!==void 0,!r&&n?[n]:i?null:e.firstChild?er.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r,o),du(s,t,o)}function bu(t,e){pu(t,e,bu)}function sm(t,e,n){var r,i,s,o,a=lt({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)s=="key"?r=e[s]:s=="ref"?i=e[s]:a[s]=e[s]===void 0&&o!==void 0?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?er.call(arguments,2):n),On(t.type,a,r||t.key,i||t.ref,null)}function om(t,e){var n={__c:e="__cC"+su++,__:t,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,ss(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}er=ou.slice,j={__e:function(t,e,n,r){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,r||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},nu=0,ru=function(t){return t!=null&&t.constructor===void 0},Ln.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=lt({},this.state),typeof t=="function"&&(t=t(lt({},n),this.props)),t&&lt(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ss(this))},Ln.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ss(this))},Ln.prototype.render=tr,At=[],iu=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rs=function(t,e){return t.__v.__b-e.__v.__b},kr.__r=0,su=0;const am=Object.freeze(Object.defineProperty({__proto__:null,Component:Ln,Fragment:tr,cloneElement:sm,createContext:om,createElement:is,createRef:em,h:is,hydrate:bu,get isValidElement(){return ru},get options(){return j},render:pu,toChildArray:hu},Symbol.toStringTag,{value:"Module"})),Oe=Hn(am);function cn(t){return typeof t=="function"}var wa=!1,je={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}wa=t},get useDeprecatedSynchronousErrorHandling(){return wa}};function Qt(t){setTimeout(function(){throw t},0)}var Rr={closed:!0,next:function(t){},error:function(t){if(je.useDeprecatedSynchronousErrorHandling)throw t;Qt(t)},complete:function(){}},Ce=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function Ws(t){return t!==null&&typeof t=="object"}var cm=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription:
4
4
  `+e.map(function(n,r){return r+1+") "+n.toString()}).join(`