From 05cacf7aa64f9defe20b4a38ea9c92ba5e316371 Mon Sep 17 00:00:00 2001 From: Eric Juta Date: Mon, 15 Apr 2024 23:20:14 +0100 Subject: [PATCH] Updates --- asset-manifest.json | 4 ++-- index.html | 2 +- static/js/main.32b0fa15.js | 2 -- static/js/main.50539af4.js | 2 ++ ...n.32b0fa15.js.LICENSE.txt => main.50539af4.js.LICENSE.txt} | 0 5 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 static/js/main.32b0fa15.js create mode 100644 static/js/main.50539af4.js rename static/js/{main.32b0fa15.js.LICENSE.txt => main.50539af4.js.LICENSE.txt} (100%) diff --git a/asset-manifest.json b/asset-manifest.json index 590a77bef..8f4ca7232 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "./static/css/main.f9ea61fb.css", - "main.js": "./static/js/main.32b0fa15.js", + "main.js": "./static/js/main.50539af4.js", "static/js/514.71647b34.chunk.js": "./static/js/514.71647b34.chunk.js", "static/js/726.a6fa00bf.chunk.js": "./static/js/726.a6fa00bf.chunk.js", "static/js/199.7a2f7ff7.chunk.js": "./static/js/199.7a2f7ff7.chunk.js", @@ -91,6 +91,6 @@ }, "entrypoints": [ "static/css/main.f9ea61fb.css", - "static/js/main.32b0fa15.js" + "static/js/main.50539af4.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index c3985eb47..463e38246 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Trisolaris
\ No newline at end of file +Trisolaris
\ No newline at end of file diff --git a/static/js/main.32b0fa15.js b/static/js/main.32b0fa15.js deleted file mode 100644 index e67c558b5..000000000 --- a/static/js/main.32b0fa15.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.32b0fa15.js.LICENSE.txt */ -!function(){var e={11395:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;var o=n(10080),a=n(55550),s=n(81689),u=n(34405),c=n(47993),l=n(16642),f=n(81107),d={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.LINK_API_URL||"https://www.walletlink.org",p={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.SDK_VERSION||n(40626).i8||"unknown",h=function(){function e(t){var n,i,o;r(this,e),this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;var s,f=t.linkAPIUrl||d;if(s=t.uiConstructor?t.uiConstructor:function(e){return new u.WalletSDKUI(e)},"undefined"===typeof t.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(n=t.overrideIsCoinbaseWallet)||void 0===n||n,this._overrideIsCoinbaseBrowser=null!==(i=t.overrideIsCoinbaseBrowser)&&void 0!==i&&i,t.diagnosticLogger&&t.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");t.eventListener?this._diagnosticLogger={log:t.eventListener.onEvent}:this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=null===(o=t.reloadOnDisconnect)||void 0===o||o;var h=new URL(f),v="".concat(h.protocol,"//").concat(h.host);this._storage=new a.ScopedLocalStorage("-walletlink:".concat(v)),this._storage.setItem("version",e.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new l.WalletSDKRelayEventManager,this._relay=new c.WalletSDKRelay({linkAPIUrl:f,version:p,darkMode:!!t.darkMode,uiConstructor:s,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(t.appName,t.appLogoUrl),t.headlessMode||this._relay.attachUI())}return i(e,[{key:"makeWeb3Provider",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,t),!1===this._reloadOnDisconnect&&"function"===typeof n.disableReloadOnDisconnect&&n.disableReloadOnDisconnect(),n;var r=this.coinbaseBrowser;if(r)return r;var i=this._relay;if(!i||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||i.setConnectDisabled(!0),new s.CoinbaseWalletProvider({relayProvider:function(){return Promise.resolve(i)},relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:t,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}},{key:"setAppInfo",value:function(e,t){var n;this._appName=e||"DApp",this._appLogoUrl=t||(0,f.getFavicon)();var r=this.walletExtension;r?this.isCipherProvider(r)||r.setAppInfo(this._appName,this._appLogoUrl):null===(n=this._relay)||void 0===n||n.setAppInfo(this._appName,this._appLogoUrl)}},{key:"disconnect",value:function(){var e,t=this.walletExtension;t?t.close():null===(e=this._relay)||void 0===e||e.resetAndReload()}},{key:"getQrUrl",value:function(){var e,t;return null!==(t=null===(e=this._relay)||void 0===e?void 0:e.getQRCodeUrl())&&void 0!==t?t:null}},{key:"getCoinbaseWalletLogo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:240;return(0,o.walletLogo)(e,t)}},{key:"walletExtension",get:function(){var e;return null!==(e=window.coinbaseWalletExtension)&&void 0!==e?e:window.walletLinkExtension}},{key:"coinbaseBrowser",get:function(){var e,t;try{var n=null!==(e=window.ethereum)&&void 0!==e?e:null===(t=window.top)||void 0===t?void 0:t.ethereum;if(!n)return;return"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch(r){return}}},{key:"isCipherProvider",value:function(e){return"boolean"===typeof e.isCipher&&e.isCipher}}]),e}();t.CoinbaseWalletSDK=h,h.VERSION=p},10080:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.walletLogo=void 0;t.walletLogo=function(e,t){var n;switch(e){case"standard":default:return n=t,"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(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=t,"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='".concat(t,"' height='").concat(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*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(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*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(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*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(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*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(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")}}},98470:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}"},44296:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseAppSteps=t.CoinbaseWalletSteps=t.ConnectItem=t.ConnectContent=void 0;var o=i(n(83061)),a=n(73856),s=n(98944),u=n(81107),c=n(27865),l=n(24662),f=i(n(24479)),d=i(n(20658)),p=n(96038),h=i(n(11541)),v=i(n(14206)),m=n(17993),g=n(52179),y=n(91807),b=i(n(98470)),w={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:d.default,steps:_},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:f.default,steps:E}},x=function(e){return"light"===e?"#FFFFFF":"#0A0B0D"};function k(e){var t=e.title,n=e.description,r=e.icon,i=e.selected,s=e.theme,u=e.onClick;return(0,a.h)("div",{onClick:u,class:(0,o.default)("-cbwsdk-connect-item",s,{selected:i})},(0,a.h)("div",null,(0,a.h)("img",{src:r,alt:t})),(0,a.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,a.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,a.h)("p",{class:"-cbwsdk-connect-item-description"},n)))}function _(e){var t=e.theme;return(0,a.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,a.h)("li",{class:(0,o.default)("-cbwsdk-wallet-steps-item",t)},(0,a.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,a.h)("li",{class:(0,o.default)("-cbwsdk-wallet-steps-item",t)},(0,a.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,a.h)("span",null,"Tap ",(0,a.h)("strong",null,"Scan")," "),(0,a.h)("span",{class:(0,o.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,a.h)(p.QRCodeIcon,{fill:x(t)})))))}function E(e){var t=e.theme;return(0,a.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,a.h)("li",{class:(0,o.default)("-cbwsdk-wallet-steps-item",t)},(0,a.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,a.h)("li",{class:(0,o.default)("-cbwsdk-wallet-steps-item",t)},(0,a.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,a.h)("span",null,"Tap ",(0,a.h)("strong",null,"More")),(0,a.h)("span",{class:(0,o.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,a.h)(m.StatusDotIcon,{fill:x(t)})),(0,a.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,a.h)("strong",null,"Scan")),(0,a.h)("span",{class:(0,o.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,a.h)(p.QRCodeIcon,{fill:x(t)})))))}t.ConnectContent=function(e){var t=e.theme,n=(0,s.useState)("coinbase-wallet-app"),i=r(n,2),f=i[0],d=i[1],p=(0,s.useCallback)((function(e){d(e)}),[]),m=(0,u.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId);if(!f)return null;var x,_=w[f].steps,E="coinbase-app"===f;return(0,a.h)("div",{"data-testid":"connect-content",class:(0,o.default)("-cbwsdk-connect-content",t)},(0,a.h)("style",null,b.default),(0,a.h)("div",{class:"-cbwsdk-connect-content-header"},(0,a.h)("h2",{class:(0,o.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with one of our mobile apps"),e.onCancel&&(0,a.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,a.h)(l.CloseIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,a.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,a.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,a.h)("div",null,Object.entries(w).map((function(e){var n=r(e,2),i=n[0],o=n[1];return(0,a.h)(k,{key:i,title:o.title,description:o.description,icon:o.icon,selected:f===i,onClick:function(){return p(i)},theme:t})}))),E&&(0,a.h)("div",{class:(0,o.default)("-cbwsdk-connect-content-update-app",t)},"Don\u2019t see a ",(0,a.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,a.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,a.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,a.h)(g.QRCode,{content:m,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:(x=f,"coinbase-app"===x?h.default:v.default),width:25,height:25}}),(0,a.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:c.LIB_VERSION}),(0,a.h)("input",{type:"hidden",value:m})),(0,a.h)(_,{theme:t}),!e.isConnected&&(0,a.h)("div",{"data-testid":"connecting-spinner",class:(0,o.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,a.h)(y.Spinner,{size:36,color:"dark"===t?"#FFF":"#000"}),(0,a.h)("p",null,"Connecting...")))))},t.ConnectItem=k,t.CoinbaseWalletSteps=_,t.CoinbaseAppSteps=E},99763:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}"},19236:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectDialog=void 0;var o=i(n(83061)),a=n(73856),s=n(98944),u=n(44296),c=n(69691),l=i(n(99763));t.ConnectDialog=function(e){var t=e.isOpen,n=e.darkMode,i=(0,s.useState)(!t),f=r(i,2),d=f[0],p=f[1],h=(0,s.useState)(!t),v=r(h,2),m=v[0],g=v[1];(0,s.useEffect)((function(){var e=[window.setTimeout((function(){g(!t)}),10)];return t?p(!1):e.push(window.setTimeout((function(){p(!0)}),360)),function(){e.forEach(window.clearTimeout)}}),[e.isOpen]);var y=n?"dark":"light";return(0,a.h)("div",{class:(0,o.default)("-cbwsdk-connect-dialog-container",d&&"-cbwsdk-connect-dialog-container-hidden")},(0,a.h)("style",null,l.default),(0,a.h)("div",{class:(0,o.default)("-cbwsdk-connect-dialog-backdrop",y,m&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,a.h)("div",{class:"-cbwsdk-connect-dialog"},(0,a.h)("div",{class:(0,o.default)("-cbwsdk-connect-dialog-box",m&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,a.h)(u.ConnectContent,{theme:y,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,a.h)(c.TryExtensionContent,{theme:y}))))}},247:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.LinkFlow=void 0;var o=n(73856),a=n(40623),s=n(19236),u=function(){function e(t){r(this,e),this.extensionUI$=new a.BehaviorSubject({}),this.subscriptions=new a.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection,this.connected$=t.connected$,this.chainId$=t.chainId$}return i(e,[{key:"attach",value:function(e){var t=this;this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe((function(e){t.isConnected!==e&&(t.isConnected=e,t.render())}))),this.subscriptions.add(this.chainId$.subscribe((function(e){t.chainId!==e&&(t.chainId=e,t.render())})))}},{key:"detach",value:function(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,o.render)(null,this.root),null===(e=this.root.parentElement)||void 0===e||e.removeChild(this.root))}},{key:"setConnectDisabled",value:function(e){this.connectDisabled=e}},{key:"open",value:function(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}},{key:"close",value:function(){this.isOpen=!1,this.onCancel=null,this.render()}},{key:"render",value:function(){var e=this;if(this.root){var t=this.extensionUI$.subscribe((function(){e.root&&(0,o.render)((0,o.h)(s.ConnectDialog,{darkMode:e.darkMode,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isOpen:e.isOpen,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel,connectDisabled:e.connectDisabled}),e.root)}));this.subscriptions.add(t)}}}]),e}();t.LinkFlow=u},52179:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.QRCode=void 0;var o=n(73856),a=n(98944),s=i(n(16134));t.QRCode=function(e){var t=(0,a.useState)(""),n=r(t,2),i=n[0],u=n[1];return(0,a.useEffect)((function(){var t,n,r=new s.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:null!==(t=e.width)&&void 0!==t?t:256,height:null!==(n=e.height)&&void 0!==n?n:256,padding:0,image:e.image}),i=Buffer.from(r.svg(),"utf8").toString("base64");u("data:image/svg+xml;base64,".concat(i))})),i?(0,o.h)("img",{src:i,alt:"QR Code"}):null}},16627:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"},64620:function(e,t,n){"use strict";var r=n(27424).default,i=n(56690).default,o=n(89728).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;var s=a(n(83061)),u=n(73856),c=n(98944),l=a(n(16627));function f(e){return"coinbase-app"===e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}var d=function(){function e(t){i(this,e),this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}return o(e,[{key:"attach",value:function(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}},{key:"presentItem",value:function(e){var t=this,n=this.nextItemKey++;return this.items.set(n,e),this.render(),function(){t.items.delete(n),t.render()}}},{key:"clear",value:function(){this.items.clear(),this.render()}},{key:"render",value:function(){this.root&&(0,u.render)((0,u.h)("div",null,(0,u.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((function(e){var n=r(e,2),i=n[0],o=n[1];return(0,u.h)(t.SnackbarInstance,Object.assign({},o,{key:i}))})))),this.root)}}]),e}();t.Snackbar=d;t.SnackbarContainer=function(e){return(0,u.h)("div",{class:(0,s.default)("-cbwsdk-snackbar-container")},(0,u.h)("style",null,l.default),(0,u.h)("div",{class:"-cbwsdk-snackbar"},e.children))};t.SnackbarInstance=function(e){var t=e.autoExpand,n=e.message,i=e.menuItems,o=e.appSrc,a=(0,c.useState)(!0),l=r(a,2),d=l[0],p=l[1],h=(0,c.useState)(null!==t&&void 0!==t&&t),v=r(h,2),m=v[0],g=v[1];(0,c.useEffect)((function(){var e=[window.setTimeout((function(){p(!1)}),1),window.setTimeout((function(){g(!0)}),1e4)];return function(){e.forEach(window.clearTimeout)}}));return(0,u.h)("div",{class:(0,s.default)("-cbwsdk-snackbar-instance",d&&"-cbwsdk-snackbar-instance-hidden",m&&"-cbwsdk-snackbar-instance-expanded")},(0,u.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:function(){g(!m)}},(0,u.h)("img",{src:f(o),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,u.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},n),(0,u.h)("div",{class:"-gear-container"},!m&&(0,u.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,u.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,u.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),i&&i.length>0&&(0,u.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},i.map((function(e,t){return(0,u.h)("div",{class:(0,s.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,u.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,u.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,u.h)("span",{class:(0,s.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info))}))))}},57470:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}"},91807:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Spinner=void 0;var i=n(73856),o=r(n(57470));t.Spinner=function(e){var t,n=null!==(t=e.size)&&void 0!==t?t:64,r=e.color||"#000";return(0,i.h)("div",{class:"-cbwsdk-spinner"},(0,i.h)("style",null,o.default),(0,i.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:n,height:n}},(0,i.h)("circle",{style:{cx:50,cy:50,r:45,stroke:r}})))}},64980:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}"},69691:function(e,t,n){"use strict";var r=n(27424).default,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TryExtensionContent=void 0;var o=i(n(83061)),a=n(73856),s=n(98944),u=n(31834),c=n(76642),l=n(83404),f=i(n(64980));t.TryExtensionContent=function(e){var t=e.theme,n=(0,s.useState)(!1),i=r(n,2),d=i[0],p=i[1],h=(0,s.useCallback)((function(){window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}),[]),v=(0,s.useCallback)((function(){d?window.location.reload():(h(),p(!0))}),[h,d]);return(0,a.h)("div",{class:(0,o.default)("-cbwsdk-try-extension",t)},(0,a.h)("style",null,f.default),(0,a.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,a.h)("h3",{class:(0,o.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,a.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,a.h)("button",{class:(0,o.default)("-cbwsdk-try-extension-cta",t),onClick:v},d?"Refresh":"Install"),(0,a.h)("div",null,!d&&(0,a.h)(u.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:"light"===t?"#0052FF":"#588AF5"})))),(0,a.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,a.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,a.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,a.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,a.h)("span",{class:(0,o.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,a.h)(c.LaptopIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,a.h)("div",{class:(0,o.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,a.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,a.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,a.h)("span",{class:(0,o.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,a.h)(l.SafeIcon,{fill:"light"===t?"#0A0B0D":"#FFFFFF"}))),(0,a.h)("div",{class:(0,o.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}},31834:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrowLeftIcon=void 0;var r=n(73856);t.ArrowLeftIcon=function(e){return(0,r.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}},24662:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CloseIcon=void 0;var r=n(73856);t.CloseIcon=function(e){return(0,r.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}},76642:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaptopIcon=void 0;var r=n(73856);t.LaptopIcon=function(e){return(0,r.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,r.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}},96038:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QRCodeIcon=void 0;var r=n(73856);t.QRCodeIcon=function(e){return(0,r.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,r.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,r.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,r.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,r.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,r.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,r.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,r.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,r.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}},11541:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default='\n \n \n \n \n \n'},14206:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='\n \n \n \n \n \n \n'},83404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeIcon=void 0;var r=n(73856);t.SafeIcon=function(e){return(0,r.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}},17993:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusDotIcon=void 0;var r=n(73856);t.StatusDotIcon=function(e){return(0,r.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),(0,r.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}},24479:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4="},20658:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg=="},70732:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientMessagePublishEvent=t.ClientMessageSetSessionConfig=t.ClientMessageGetSessionConfig=t.ClientMessageIsLinked=t.ClientMessageHostSession=void 0,t.ClientMessageHostSession=function(e){return Object.assign({type:"HostSession"},e)},t.ClientMessageIsLinked=function(e){return Object.assign({type:"IsLinked"},e)},t.ClientMessageGetSessionConfig=function(e){return Object.assign({type:"GetSessionConfig"},e)},t.ClientMessageSetSessionConfig=function(e){return Object.assign({type:"SetSessionConfig"},e)},t.ClientMessagePublishEvent=function(e){return Object.assign({type:"PublishEvent"},e)}},56171:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EVENTS=void 0,t.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"}},10680:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;var o,a=n(40623),s=n(21807);!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(o=t.ConnectionState||(t.ConnectionState={}));var u=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:WebSocket;r(this,e),this.WebSocketClass=n,this.webSocket=null,this.connectionStateSubject=new a.BehaviorSubject(o.DISCONNECTED),this.incomingDataSubject=new a.Subject,this.url=t.replace(/^http/,"ws")}return i(e,[{key:"connect",value:function(){var e=this;return this.webSocket?(0,a.throwError)(new Error("webSocket object is not null")):new a.Observable((function(t){var n;try{e.webSocket=n=new e.WebSocketClass(e.url)}catch(r){return void t.error(r)}e.connectionStateSubject.next(o.CONNECTING),n.onclose=function(n){e.clearWebSocket(),t.error(new Error("websocket error ".concat(n.code,": ").concat(n.reason))),e.connectionStateSubject.next(o.DISCONNECTED)},n.onopen=function(n){t.next(),t.complete(),e.connectionStateSubject.next(o.CONNECTED)},n.onmessage=function(t){e.incomingDataSubject.next(t.data)}})).pipe((0,s.take)(1))}},{key:"disconnect",value:function(){var e=this.webSocket;if(e){this.clearWebSocket(),this.connectionStateSubject.next(o.DISCONNECTED);try{e.close()}catch(t){}}}},{key:"connectionState$",get:function(){return this.connectionStateSubject.asObservable()}},{key:"incomingData$",get:function(){return this.incomingDataSubject.asObservable()}},{key:"incomingJSONData$",get:function(){return this.incomingData$.pipe((0,s.flatMap)((function(e){var t;try{t=JSON.parse(e)}catch(n){return(0,a.empty)()}return(0,a.of)(t)})))}},{key:"sendData",value:function(e){var t=this.webSocket;if(!t)throw new Error("websocket is not connected");t.send(e)}},{key:"clearWebSocket",value:function(){var e=this.webSocket;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}]),e}();t.RxWebSocket=u},82747:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isServerMessageFail=void 0,t.isServerMessageFail=function(e){return e&&"Fail"===e.type&&"number"===typeof e.id&&"string"===typeof e.sessionId&&"string"===typeof e.error}},62569:function(e,t,n){"use strict";var r=n(38416).default,i=n(56690).default,o=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKConnection=void 0;var a=n(40623),s=n(21807),u=n(35836),c=n(99306),l=n(70732),f=n(56171),d=n(10680),p=n(82747),h=function(){function e(t,n,r,o){var l=this,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:WebSocket;i(this,e),this.sessionId=t,this.sessionKey=n,this.diagnostic=o,this.subscriptions=new a.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,c.IntNumber)(1),this.connectedSubject=new a.BehaviorSubject(!1),this.linkedSubject=new a.BehaviorSubject(!1),this.sessionConfigSubject=new a.ReplaySubject(1);var h=new d.RxWebSocket(r+"/rpc",p);this.ws=h,this.subscriptions.add(h.connectionState$.pipe((0,s.tap)((function(e){var n;return null===(n=l.diagnostic)||void 0===n?void 0:n.log(f.EVENTS.CONNECTED_STATE_CHANGE,{state:e,sessionIdHash:u.Session.hash(t)})})),(0,s.skip)(1),(0,s.filter)((function(e){return e===d.ConnectionState.DISCONNECTED&&!l.destroyed})),(0,s.delay)(5e3),(0,s.filter)((function(e){return!l.destroyed})),(0,s.flatMap)((function(e){return h.connect()})),(0,s.retry)()).subscribe()),this.subscriptions.add(h.connectionState$.pipe((0,s.skip)(2),(0,s.switchMap)((function(e){return(0,a.iif)((function(){return e===d.ConnectionState.CONNECTED}),l.authenticate().pipe((0,s.tap)((function(e){return l.sendIsLinked()})),(0,s.tap)((function(e){return l.sendGetSessionConfig()})),(0,s.map)((function(e){return!0}))),(0,a.of)(!1))})),(0,s.distinctUntilChanged)(),(0,s.catchError)((function(e){return(0,a.of)(!1)}))).subscribe((function(e){return l.connectedSubject.next(e)}))),this.subscriptions.add(h.connectionState$.pipe((0,s.skip)(1),(0,s.switchMap)((function(e){return(0,a.iif)((function(){return e===d.ConnectionState.CONNECTED}),(0,a.timer)(0,1e4))}))).subscribe((function(e){return 0===e?l.updateLastHeartbeat():l.heartbeat()}))),this.subscriptions.add(h.incomingData$.pipe((0,s.filter)((function(e){return"h"===e}))).subscribe((function(e){return l.updateLastHeartbeat()}))),this.subscriptions.add(h.incomingJSONData$.pipe((0,s.filter)((function(e){return["IsLinkedOK","Linked"].includes(e.type)}))).subscribe((function(e){var n,r=e;null===(n=l.diagnostic)||void 0===n||n.log(f.EVENTS.LINKED,{sessionIdHash:u.Session.hash(t),linked:r.linked,type:e.type,onlineGuests:r.onlineGuests}),l.linkedSubject.next(r.linked||r.onlineGuests>0)}))),this.subscriptions.add(h.incomingJSONData$.pipe((0,s.filter)((function(e){return["GetSessionConfigOK","SessionConfigUpdated"].includes(e.type)}))).subscribe((function(e){var n,r=e;null===(n=l.diagnostic)||void 0===n||n.log(f.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:u.Session.hash(t),metadata_keys:r&&r.metadata?Object.keys(r.metadata):void 0}),l.sessionConfigSubject.next({webhookId:r.webhookId,webhookUrl:r.webhookUrl,metadata:r.metadata})})))}return o(e,[{key:"connect",value:function(){var e;if(this.destroyed)throw new Error("instance is destroyed");null===(e=this.diagnostic)||void 0===e||e.log(f.EVENTS.STARTED_CONNECTING,{sessionIdHash:u.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}},{key:"destroy",value:function(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),null===(e=this.diagnostic)||void 0===e||e.log(f.EVENTS.DISCONNECTED,{sessionIdHash:u.Session.hash(this.sessionId)}),this.destroyed=!0}},{key:"isDestroyed",get:function(){return this.destroyed}},{key:"connected$",get:function(){return this.connectedSubject.asObservable()}},{key:"onceConnected$",get:function(){return this.connected$.pipe((0,s.filter)((function(e){return e})),(0,s.take)(1),(0,s.map)((function(){})))}},{key:"linked$",get:function(){return this.linkedSubject.asObservable()}},{key:"onceLinked$",get:function(){return this.linked$.pipe((0,s.filter)((function(e){return e})),(0,s.take)(1),(0,s.map)((function(){})))}},{key:"sessionConfig$",get:function(){return this.sessionConfigSubject.asObservable()}},{key:"incomingEvent$",get:function(){return this.ws.incomingJSONData$.pipe((0,s.filter)((function(e){if("Event"!==e.type)return!1;var t=e;return"string"===typeof t.sessionId&&"string"===typeof t.eventId&&"string"===typeof t.event&&"string"===typeof t.data})),(0,s.map)((function(e){return e})))}},{key:"setSessionMetadata",value:function(e,t){var n=this,i=(0,l.ClientMessageSetSessionConfig)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:r({},e,t)});return this.onceConnected$.pipe((0,s.flatMap)((function(e){return n.makeRequest(i)})),(0,s.map)((function(e){if((0,p.isServerMessageFail)(e))throw new Error(e.error||"failed to set session metadata")})))}},{key:"publishEvent",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=(0,l.ClientMessagePublishEvent)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:t,callWebhook:r});return this.onceLinked$.pipe((0,s.flatMap)((function(e){return n.makeRequest(i)})),(0,s.map)((function(e){if((0,p.isServerMessageFail)(e))throw new Error(e.error||"failed to publish event");return e.eventId})))}},{key:"sendData",value:function(e){this.ws.sendData(JSON.stringify(e))}},{key:"updateLastHeartbeat",value:function(){this.lastHeartbeatResponse=Date.now()}},{key:"heartbeat",value:function(){if(Date.now()-this.lastHeartbeatResponse>2e4)this.ws.disconnect();else try{this.ws.sendData("h")}catch(e){}}},{key:"makeRequest",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4,n=e.id;try{this.sendData(e)}catch(r){return(0,a.throwError)(r)}return this.ws.incomingJSONData$.pipe((0,s.timeoutWith)(t,(0,a.throwError)(new Error("request ".concat(n," timed out")))),(0,s.filter)((function(e){return e.id===n})),(0,s.take)(1))}},{key:"authenticate",value:function(){var e=(0,l.ClientMessageHostSession)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,s.map)((function(e){if((0,p.isServerMessageFail)(e))throw new Error(e.error||"failed to authentcate")})))}},{key:"sendIsLinked",value:function(){var e=(0,l.ClientMessageIsLinked)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}},{key:"sendGetSessionConfig",value:function(){var e=(0,l.ClientMessageGetSessionConfig)({id:(0,c.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}]),e}();t.WalletSDKConnection=h},27312:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;var r=n(98689),i=n(87734),o=n(27865);t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},r.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},r.errorCodes.provider),{unsupportedChain:4902}))})),t.standardErrorMessage=function(e){return void 0!==e?(0,r.getMessageFromCode)(e):"Unknown error"},t.standardErrors=Object.freeze(Object.assign(Object.assign({},r.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},r.ethErrors.provider),{unsupportedChain:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return r.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:"Unrecognized chain ID ".concat(e,". Try adding the chain using wallet_addEthereumChain first.")})}}))})),t.serializeError=function(e,n){var a=(0,r.serializeError)(function(e){return"string"===typeof e?{message:e,code:t.standardErrorCodes.rpc.internal}:(0,i.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method,result:e.result}}):e}(e),{shouldIncludeStack:!0}),s=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");s.searchParams.set("version",o.LIB_VERSION),s.searchParams.set("code",a.code.toString());var u=function(e,t){var n,r=null===(n=e)||void 0===n?void 0:n.method;if(r)return r;return void 0===t?void 0:"string"===typeof t?t:Array.isArray(t)?t.length>0?t[0].method:void 0:t.method}(a.data,n);return u&&s.searchParams.set("method",u),s.searchParams.set("message",a.message),Object.assign(Object.assign({},a),{docUrl:s.href})},t.getErrorCode=function(e){var t;return"number"===typeof e?e:function(e){return"object"===typeof e&&null!==e&&("number"===typeof e.code||"number"===typeof e.errorCode)}(e)?null!==(t=e.code)&&void 0!==t?t:e.errorCode:void 0}},52836:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;var r=n(11395),i=n(81689),o=n(11395);Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return o.CoinbaseWalletSDK}});var a=n(81689);Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return a.CoinbaseWalletProvider}}),t.default=r.CoinbaseWalletSDK,"undefined"!==typeof window&&(window.CoinbaseWalletSDK=r.CoinbaseWalletSDK,window.CoinbaseWalletProvider=i.CoinbaseWalletProvider,window.WalletLink=r.CoinbaseWalletSDK,window.WalletLinkProvider=i.CoinbaseWalletProvider)},55550:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ScopedLocalStorage=void 0;var o=function(){function e(t){r(this,e),this.scope=t}return i(e,[{key:"setItem",value:function(e,t){localStorage.setItem(this.scopedKey(e),t)}},{key:"getItem",value:function(e){return localStorage.getItem(this.scopedKey(e))}},{key:"removeItem",value:function(e){localStorage.removeItem(this.scopedKey(e))}},{key:"clear",value:function(){for(var e=this.scopedKey(""),t=[],n=0;n0&&r.initializeRelay(),window.addEventListener("message",(function(e){var t;if(e.origin===location.origin&&e.source===window&&"walletLinkMessage"===e.data.type){if("defaultChainChanged"===e.data.data.action||"dappChainSwitched"===e.data.data.action){var n=e.data.data.chainId,i=null!==(t=e.data.data.jsonRpcUrl)&&void 0!==t?t:r.jsonRpcUrl;r.updateProviderInfo(i,Number(n))}"addressChanged"===e.data.data.action&&r._setAddresses([e.data.data.address])}})),r}return s(n,[{key:"selectedAddress",get:function(){return this._addresses[0]||void 0}},{key:"networkVersion",get:function(){return this.getChainId().toString(10)}},{key:"chainId",get:function(){return(0,w.prepend0x)(this.getChainId().toString(16))}},{key:"isWalletLink",get:function(){return!0}},{key:"isMetaMask",get:function(){return this._overrideIsMetaMask}},{key:"host",get:function(){return this.jsonRpcUrl}},{key:"connected",get:function(){return!0}},{key:"isConnected",value:function(){return!0}},{key:"jsonRpcUrl",get:function(){var e;return null!==(e=this._storage.getItem(S))&&void 0!==e?e:this._jsonRpcUrlFromOpts},set:function(e){this._storage.setItem(S,e)}},{key:"disableReloadOnDisconnect",value:function(){this.reloadOnDisconnect=!1}},{key:"setProviderInfo",value:function(e,t){this.isLedger||this.isCoinbaseBrowser||(this._chainIdFromOpts=t,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}},{key:"updateProviderInfo",value:function(e,t){this.jsonRpcUrl=e;var n=this.getChainId();this._storage.setItem(A,t.toString(10)),!((0,w.ensureIntNumber)(t)!==n)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}},{key:"watchAsset",value:function(){var e=o(i().mark((function e(t,n,r,o,a,s){var u,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return u=e.sent,e.next=5,u.watchAsset(t,n,r,o,a,null===s||void 0===s?void 0:s.toString()).promise;case 5:return c=e.sent,e.abrupt("return",!!c.result);case 7:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}()},{key:"addEthereumChain",value:function(){var e=o(i().mark((function e(t,n,r,o,a,s){var u,c,l,f,d;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,w.ensureIntNumber)(t)!==this.getChainId()){e.next=2;break}return e.abrupt("return",!1);case 2:return e.next=4,this.initializeRelay();case 4:if(l=e.sent,f=l.inlineAddEthereumChain(t.toString()),this._isAuthorized()||f){e.next=9;break}return e.next=9,l.requestEthereumAccounts().promise;case 9:return e.next=11,l.addEthereumChain(t.toString(),n,a,r,o,s).promise;case 11:return d=e.sent,!0===(null===(u=d.result)||void 0===u?void 0:u.isApproved)&&this.updateProviderInfo(n[0],t),e.abrupt("return",!0===(null===(c=d.result)||void 0===c?void 0:c.isApproved));case 14:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}()},{key:"switchEthereumChain",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return n=e.sent,e.next=5,n.switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;case 5:if(r=e.sent,!(0,b.isErrorResponse)(r)||!r.errorCode){e.next=12;break}if(r.errorCode!==v.standardErrorCodes.provider.unsupportedChain){e.next=11;break}throw v.standardErrors.provider.unsupportedChain(t);case 11:throw v.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode});case 12:(o=r.result).isApproved&&o.rpcUrl.length>0&&this.updateProviderInfo(o.rpcUrl,t);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setAppInfo",value:function(e,t){this.initializeRelay().then((function(n){return n.setAppInfo(e,t)}))}},{key:"enable",value:function(){var e=o(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this.diagnostic)||void 0===t||t.log(h.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?m.Session.hash(this._relay.session.id):void 0}),!(this._addresses.length>0)){e.next=3;break}return e.abrupt("return",r(this._addresses));case 3:return e.next=5,this.send(_.JSONRPCMethod.eth_requestAccounts);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=o(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:e.sent.resetAndReload();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(e,t){try{var n=this._send(e,t);if(n instanceof Promise)return n.catch((function(t){throw(0,v.serializeError)(t,e)}))}catch(r){throw(0,v.serializeError)(r,e)}}},{key:"_send",value:function(e,t){var n=this;if("string"===typeof e){var r={jsonrpc:"2.0",id:0,method:e,params:Array.isArray(t)?t:void 0!==t?[t]:[]};return this._sendRequestAsync(r).then((function(e){return e.result}))}if("function"===typeof t){var i=e,o=t;return this._sendAsync(i,o)}if(Array.isArray(e))return e.map((function(e){return n._sendRequest(e)}));var a=e;return this._sendRequest(a)}},{key:"sendAsync",value:function(){var e=o(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",this._sendAsync(t,n).catch((function(e){throw(0,v.serializeError)(e,t)})));case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return",Promise.reject((0,v.serializeError)(e.t0,t)));case 7:case"end":return e.stop()}}),e,this,[[0,4]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_sendAsync",value:function(){var e=o(i().mark((function e(t,n){var r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"===typeof n){e.next=2;break}throw new Error("callback is required");case 2:if(!Array.isArray(t)){e.next=6;break}return r=n,this._sendMultipleRequestsAsync(t).then((function(e){return r(null,e)})).catch((function(e){return r(e,null)})),e.abrupt("return");case 6:return o=n,e.abrupt("return",this._sendRequestAsync(t).then((function(e){return o(null,e)})).catch((function(e){return o(e,null)})));case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"request",value:function(){var e=o(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.abrupt("return",this._request(t).catch((function(e){throw(0,v.serializeError)(e,t.method)})));case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return",Promise.reject((0,v.serializeError)(e.t0,t.method)));case 7:case"end":return e.stop()}}),e,this,[[0,4]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_request",value:function(){var e=o(i().mark((function e(t){var n,r,o,a,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"object"===typeof t&&!Array.isArray(t)){e.next=2;break}throw v.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});case 2:if(n=t.method,r=t.params,"string"===typeof n&&0!==n.length){e.next=5;break}throw v.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});case 5:if(void 0===r||Array.isArray(r)||"object"===typeof r&&null!==r){e.next=7;break}throw v.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});case 7:return o=void 0===r?[]:r,a=this._relayEventManager.makeRequestId(),e.next=11,this._sendRequestAsync({method:n,params:o,jsonrpc:"2.0",id:a});case 11:return s=e.sent,e.abrupt("return",s.result);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"scanQRCode",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return r=e.sent,e.next=5,r.scanQRCode((0,w.ensureRegExpString)(t)).promise;case 5:if("string"===typeof(o=e.sent).result){e.next=8;break}throw(0,v.serializeError)(null!==(n=o.errorMessage)&&void 0!==n?n:"result was not a string",y.Web3Method.scanQRCode);case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"genericRequest",value:function(){var e=o(i().mark((function e(t,n){var r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return o=e.sent,e.next=5,o.genericRequest(t,n).promise;case 5:if("string"===typeof(a=e.sent).result){e.next=8;break}throw(0,v.serializeError)(null!==(r=a.errorMessage)&&void 0!==r?r:"result was not a string",y.Web3Method.generic);case 8:return e.abrupt("return",a.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"selectProvider",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return r=e.sent,e.next=5,r.selectProvider(t).promise;case 5:if("string"===typeof(o=e.sent).result){e.next=8;break}throw(0,v.serializeError)(null!==(n=o.errorMessage)&&void 0!==n?n:"result was not a string",y.Web3Method.selectProvider);case 8:return e.abrupt("return",o.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"supportsSubscriptions",value:function(){return!1}},{key:"subscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"unsubscribe",value:function(){throw new Error("Subscriptions are not supported")}},{key:"disconnect",value:function(){return!0}},{key:"_sendRequest",value:function(e){var t={jsonrpc:"2.0",id:e.id},n=e.method;if(t.result=this._handleSynchronousMethods(e),void 0===t.result)throw new Error("Coinbase Wallet does not support calling ".concat(n," synchronously without ")+"a callback. Please provide a callback parameter to call ".concat(n," ")+"asynchronously.");return t}},{key:"_setAddresses",value:function(e,t){if(!Array.isArray(e))throw new Error("addresses is not an array");var n=e.map((function(e){return(0,w.ensureAddressString)(e)}));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!t||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(g.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" "))))}},{key:"_sendRequestAsync",value:function(e){var t=this;return new Promise((function(n,r){try{var i=t._handleSynchronousMethods(e);if(void 0!==i)return n({jsonrpc:"2.0",id:e.id,result:i});var o=t._handleAsynchronousFilterMethods(e);if(void 0!==o)return void o.then((function(t){return n(Object.assign(Object.assign({},t),{id:e.id}))})).catch((function(e){return r(e)}));var a=t._handleSubscriptionMethods(e);if(void 0!==a)return void a.then((function(t){return n({jsonrpc:"2.0",id:e.id,result:t.result})})).catch((function(e){return r(e)}))}catch(s){return r(s)}t._handleAsynchronousMethods(e).then((function(t){return t&&n(Object.assign(Object.assign({},t),{id:e.id}))})).catch((function(e){return r(e)}))}))}},{key:"_sendMultipleRequestsAsync",value:function(e){var t=this;return Promise.all(e.map((function(e){return t._sendRequestAsync(e)})))}},{key:"_handleSynchronousMethods",value:function(e){var t=e.method,n=e.params||[];switch(t){case _.JSONRPCMethod.eth_accounts:return this._eth_accounts();case _.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case _.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case _.JSONRPCMethod.net_version:return this._net_version();case _.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}},{key:"_handleAsynchronousMethods",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.method,r=t.params||[],e.t0=n,e.next=e.t0===_.JSONRPCMethod.eth_requestAccounts?5:e.t0===_.JSONRPCMethod.eth_sign?6:e.t0===_.JSONRPCMethod.eth_ecRecover?7:e.t0===_.JSONRPCMethod.personal_sign?8:e.t0===_.JSONRPCMethod.personal_ecRecover?9:e.t0===_.JSONRPCMethod.eth_signTransaction?10:e.t0===_.JSONRPCMethod.eth_sendRawTransaction?11:e.t0===_.JSONRPCMethod.eth_sendTransaction?12:e.t0===_.JSONRPCMethod.eth_signTypedData_v1?13:e.t0===_.JSONRPCMethod.eth_signTypedData_v2?14:e.t0===_.JSONRPCMethod.eth_signTypedData_v3?15:e.t0===_.JSONRPCMethod.eth_signTypedData_v4||e.t0===_.JSONRPCMethod.eth_signTypedData?16:e.t0===_.JSONRPCMethod.cbWallet_arbitrary?17:e.t0===_.JSONRPCMethod.wallet_addEthereumChain?18:e.t0===_.JSONRPCMethod.wallet_switchEthereumChain?19:e.t0===_.JSONRPCMethod.wallet_watchAsset?20:21;break;case 5:return e.abrupt("return",this._eth_requestAccounts());case 6:return e.abrupt("return",this._eth_sign(r));case 7:return e.abrupt("return",this._eth_ecRecover(r));case 8:return e.abrupt("return",this._personal_sign(r));case 9:return e.abrupt("return",this._personal_ecRecover(r));case 10:return e.abrupt("return",this._eth_signTransaction(r));case 11:return e.abrupt("return",this._eth_sendRawTransaction(r));case 12:return e.abrupt("return",this._eth_sendTransaction(r));case 13:return e.abrupt("return",this._eth_signTypedData_v1(r));case 14:return e.abrupt("return",this._throwUnsupportedMethodError());case 15:return e.abrupt("return",this._eth_signTypedData_v3(r));case 16:return e.abrupt("return",this._eth_signTypedData_v4(r));case 17:return e.abrupt("return",this._cbwallet_arbitrary(r));case 18:return e.abrupt("return",this._wallet_addEthereumChain(r));case 19:return e.abrupt("return",this._wallet_switchEthereumChain(r));case 20:return e.abrupt("return",this._wallet_watchAsset(r));case 21:return e.next=23,this.initializeRelay();case 23:return o=e.sent,e.abrupt("return",o.makeEthereumJSONRPCRequest(t,this.jsonRpcUrl));case 25:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_handleAsynchronousFilterMethods",value:function(e){var t=e.method,n=e.params||[];switch(t){case _.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case _.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case _.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case _.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case _.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}},{key:"_handleSubscriptionMethods",value:function(e){switch(e.method){case _.JSONRPCMethod.eth_subscribe:case _.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}},{key:"_isKnownAddress",value:function(e){try{var t=(0,w.ensureAddressString)(e);return this._addresses.map((function(e){return(0,w.ensureAddressString)(e)})).includes(t)}catch(n){}return!1}},{key:"_ensureKnownAddress",value:function(e){var t;if(!this._isKnownAddress(e))throw null===(t=this.diagnostic)||void 0===t||t.log(h.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}},{key:"_prepareTransactionParams",value:function(e){var t=e.from?(0,w.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");return this._ensureKnownAddress(t),{fromAddress:t,toAddress:e.to?(0,w.ensureAddressString)(e.to):null,weiValue:null!=e.value?(0,w.ensureBN)(e.value):new p.default(0),data:e.data?(0,w.ensureBuffer)(e.data):Buffer.alloc(0),nonce:null!=e.nonce?(0,w.ensureIntNumber)(e.nonce):null,gasPriceInWei:null!=e.gasPrice?(0,w.ensureBN)(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?(0,w.ensureBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,w.ensureBN)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,w.ensureBN)(e.gas):null,chainId:this.getChainId()}}},{key:"_isAuthorized",value:function(){return this._addresses.length>0}},{key:"_requireAuthorization",value:function(){if(!this._isAuthorized())throw v.standardErrors.provider.unauthorized({})}},{key:"_throwUnsupportedMethodError",value:function(){throw v.standardErrors.provider.unsupportedMethod({})}},{key:"_signEthereumMessage",value:function(){var e=o(i().mark((function e(t,n,r,o){var a,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._ensureKnownAddress(n),e.prev=1,e.next=4,this.initializeRelay();case 4:return a=e.sent,e.next=7,a.signEthereumMessage(t,n,r,o).promise;case 7:return s=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:s.result});case 11:if(e.prev=11,e.t0=e.catch(1),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=15;break}throw v.standardErrors.provider.userRejectedRequest("User denied message signature");case 15:throw e.t0;case 16:case"end":return e.stop()}}),e,this,[[1,11]])})));return function(t,n,r,i){return e.apply(this,arguments)}}()},{key:"_ethereumAddressFromSignedMessage",value:function(){var e=o(i().mark((function e(t,n,r){var o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return o=e.sent,e.next=5,o.ethereumAddressFromSignedMessage(t,n,r).promise;case 5:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a.result});case 7:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"_eth_accounts",value:function(){return r(this._addresses)}},{key:"_eth_coinbase",value:function(){return this.selectedAddress||null}},{key:"_net_version",value:function(){return this.getChainId().toString(10)}},{key:"_eth_chainId",value:function(){return(0,w.hexStringFromIntNumber)(this.getChainId())}},{key:"getChainId",value:function(){var e=this._storage.getItem(A);if(!e)return(0,w.ensureIntNumber)(this._chainIdFromOpts);var t=parseInt(e,10);return(0,w.ensureIntNumber)(t)}},{key:"_eth_requestAccounts",value:function(){var e=o(i().mark((function e(){var t,n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this.diagnostic)||void 0===t||t.log(h.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?m.Session.hash(this._relay.session.id):void 0}),!(this._addresses.length>0)){e.next=3;break}return e.abrupt("return",Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses}));case 3:return e.prev=3,e.next=6,this.initializeRelay();case 6:return r=e.sent,e.next=9,r.requestEthereumAccounts().promise;case 9:n=e.sent,e.next=17;break;case 12:if(e.prev=12,e.t0=e.catch(3),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=16;break}throw v.standardErrors.provider.userRejectedRequest("User denied account authorization");case 16:throw e.t0;case 17:if(n.result){e.next=19;break}throw new Error("accounts received is empty");case 19:if(this._setAddresses(n.result),this.isLedger||this.isCoinbaseBrowser){e.next=23;break}return e.next=23,this.switchEthereumChain(this.getChainId());case 23:return e.abrupt("return",{jsonrpc:"2.0",id:0,result:this._addresses});case 24:case"end":return e.stop()}}),e,this,[[3,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"_eth_sign",value:function(e){this._requireAuthorization();var t=(0,w.ensureAddressString)(e[0]),n=(0,w.ensureBuffer)(e[1]);return this._signEthereumMessage(n,t,!1)}},{key:"_eth_ecRecover",value:function(e){var t=(0,w.ensureBuffer)(e[0]),n=(0,w.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!1)}},{key:"_personal_sign",value:function(e){this._requireAuthorization();var t=(0,w.ensureBuffer)(e[0]),n=(0,w.ensureAddressString)(e[1]);return this._signEthereumMessage(t,n,!0)}},{key:"_personal_ecRecover",value:function(e){var t=(0,w.ensureBuffer)(e[0]),n=(0,w.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!0)}},{key:"_eth_signTransaction",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(t[0]||{}),e.prev=2,e.next=5,this.initializeRelay();case 5:return r=e.sent,e.next=8,r.signEthereumTransaction(n).promise;case 8:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o.result});case 12:if(e.prev=12,e.t0=e.catch(2),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=16;break}throw v.standardErrors.provider.userRejectedRequest("User denied transaction signature");case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,this,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_sendRawTransaction",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,w.ensureBuffer)(t[0]),e.next=3,this.initializeRelay();case 3:return r=e.sent,e.next=6,r.submitEthereumTransaction(n,this.getChainId()).promise;case 6:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o.result});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_sendTransaction",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=this._prepareTransactionParams(t[0]||{}),e.prev=2,e.next=5,this.initializeRelay();case 5:return r=e.sent,e.next=8,r.signAndSubmitEthereumTransaction(n).promise;case 8:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o.result});case 12:if(e.prev=12,e.t0=e.catch(2),"string"!==typeof e.t0.message||!e.t0.message.match(/(denied|rejected)/i)){e.next=16;break}throw v.standardErrors.provider.userRejectedRequest("User denied transaction signature");case 16:throw e.t0;case 17:case"end":return e.stop()}}),e,this,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_signTypedData_v1",value:function(){var e=o(i().mark((function e(t){var n,r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=(0,w.ensureParsedJSONObject)(t[0]),r=(0,w.ensureAddressString)(t[1]),this._ensureKnownAddress(r),o=x.default.hashForSignTypedDataLegacy({data:n}),a=JSON.stringify(n,null,2),e.abrupt("return",this._signEthereumMessage(o,r,!1,a));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_signTypedData_v3",value:function(){var e=o(i().mark((function e(t){var n,r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=(0,w.ensureAddressString)(t[0]),r=(0,w.ensureParsedJSONObject)(t[1]),this._ensureKnownAddress(n),o=x.default.hashForSignTypedData_v3({data:r}),a=JSON.stringify(r,null,2),e.abrupt("return",this._signEthereumMessage(o,n,!1,a));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_signTypedData_v4",value:function(){var e=o(i().mark((function e(t){var n,r,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),n=(0,w.ensureAddressString)(t[0]),r=(0,w.ensureParsedJSONObject)(t[1]),this._ensureKnownAddress(n),o=x.default.hashForSignTypedData_v4({data:r}),a=JSON.stringify(r,null,2),e.abrupt("return",this._signEthereumMessage(o,n,!1,a));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_cbwallet_arbitrary",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t[0],"string"===typeof(r=t[1])){e.next=4;break}throw new Error("parameter must be a string");case 4:if("object"===typeof n&&null!==n){e.next=6;break}throw new Error("parameter must be an object");case 6:return e.next=8,this.genericRequest(n,r);case 8:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o});case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wallet_addEthereumChain",value:function(){var e=o(i().mark((function e(t){var n,r,o,a,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=t[0],0!==(null===(n=s.rpcUrls)||void 0===n?void 0:n.length)){e.next=3;break}return e.abrupt("return",{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}});case 3:if(s.chainName&&""!==s.chainName.trim()){e.next=5;break}throw v.standardErrors.rpc.invalidParams("chainName is a required field");case 5:if(s.nativeCurrency){e.next=7;break}throw v.standardErrors.rpc.invalidParams("nativeCurrency is a required field");case 7:return u=parseInt(s.chainId,16),e.next=10,this.addEthereumChain(u,null!==(r=s.rpcUrls)&&void 0!==r?r:[],null!==(o=s.blockExplorerUrls)&&void 0!==o?o:[],s.chainName,null!==(a=s.iconUrls)&&void 0!==a?a:[],s.nativeCurrency);case 10:if(!e.sent){e.next=15;break}return e.abrupt("return",{jsonrpc:"2.0",id:0,result:null});case 15:return e.abrupt("return",{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}});case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wallet_switchEthereumChain",value:function(){var e=o(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t[0],e.next=3,this.switchEthereumChain(parseInt(n.chainId,16));case 3:return e.abrupt("return",{jsonrpc:"2.0",id:0,result:null});case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_wallet_watchAsset",value:function(){var e=o(i().mark((function e(t){var n,r,o,a,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=Array.isArray(t)?t[0]:t).type){e.next=3;break}throw v.standardErrors.rpc.invalidParams("Type is required");case 3:if("ERC20"===(null===n||void 0===n?void 0:n.type)){e.next=5;break}throw v.standardErrors.rpc.invalidParams("Asset of type '".concat(n.type,"' is not supported"));case 5:if(null===n||void 0===n?void 0:n.options){e.next=7;break}throw v.standardErrors.rpc.invalidParams("Options are required");case 7:if(null===n||void 0===n?void 0:n.options.address){e.next=9;break}throw v.standardErrors.rpc.invalidParams("Address is required");case 9:return r=this.getChainId(),o=n.options,a=o.address,s=o.symbol,u=o.image,c=o.decimals,e.next=13,this.watchAsset(n.type,a,s,c,u,r);case 13:return l=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:l});case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_uninstallFilter",value:function(e){var t=(0,w.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(t)}},{key:"_eth_newFilter",value:function(){var e=o(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t[0],e.next=3,this._filterPolyfill.newFilter(n);case 3:return r=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:r});case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_eth_newBlockFilter",value:function(){var e=o(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._filterPolyfill.newBlockFilter();case 2:return t=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:t});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_eth_newPendingTransactionFilter",value:function(){var e=o(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._filterPolyfill.newPendingTransactionFilter();case 2:return t=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:t});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_eth_getFilterChanges",value:function(e){var t=(0,w.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(t)}},{key:"_eth_getFilterLogs",value:function(e){var t=(0,w.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(t)}},{key:"initializeRelay",value:function(){var e=this;return this._relay?Promise.resolve(this._relay):this._relayProvider().then((function(t){return t.setAccountsCallback((function(t,n){return e._setAddresses(t,n)})),t.setChainCallback((function(t,n){e.updateProviderInfo(n,parseInt(t,10))})),t.setDappDefaultChainCallback(e._chainIdFromOpts),e._relay=t,t}))}}]),n}(d.default);t.CoinbaseWalletProvider=O},43122:function(e,t,n){"use strict";var r=n(861).default,i=n(17061).default,o=n(17156).default,a=n(56690).default,s=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.filterFromParam=t.FilterPolyfill=void 0;var u=n(99306),c=n(81107),l={jsonrpc:"2.0",id:0},f=function(){function e(t){a(this,e),this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,u.IntNumber)(1),this.provider=t}return s(e,[{key:"newFilter",value:function(){var e=o(i().mark((function e(t){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d(t),r=this.makeFilterId(),e.next=4,this.setInitialCursorPosition(r,n.fromBlock);case 4:return o=e.sent,console.log("Installing new log filter(".concat(r,"):"),n,"initial cursor position:",o),this.logFilters.set(r,n),this.setFilterTimeout(r),e.abrupt("return",(0,c.hexStringFromIntNumber)(r));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"newBlockFilter",value:function(){var e=o(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.makeFilterId(),e.next=3,this.setInitialCursorPosition(t,"latest");case 3:return n=e.sent,console.log("Installing new block filter (".concat(t,") with initial cursor position:"),n),this.blockFilters.add(t),this.setFilterTimeout(t),e.abrupt("return",(0,c.hexStringFromIntNumber)(t));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"newPendingTransactionFilter",value:function(){var e=o(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.makeFilterId(),e.next=3,this.setInitialCursorPosition(t,"latest");case 3:return n=e.sent,console.log("Installing new block filter (".concat(t,") with initial cursor position:"),n),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),e.abrupt("return",(0,c.hexStringFromIntNumber)(t));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"uninstallFilter",value:function(e){var t=(0,c.intNumberFromHexString)(e);return console.log("Uninstalling filter (".concat(t,")")),this.deleteFilter(t),!0}},{key:"getFilterChanges",value:function(e){var t=(0,c.intNumberFromHexString)(e);return this.timeouts.has(t)&&this.setFilterTimeout(t),this.logFilters.has(t)?this.getLogFilterChanges(t):this.blockFilters.has(t)?this.getBlockFilterChanges(t):this.pendingTransactionFilters.has(t)?this.getPendingTransactionFilterChanges(t):Promise.resolve(m())}},{key:"getFilterLogs",value:function(){var e=o(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(0,c.intNumberFromHexString)(t),r=this.logFilters.get(n)){e.next=4;break}return e.abrupt("return",m());case 4:return e.abrupt("return",this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_getLogs",params:[p(r)]})));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"makeFilterId",value:function(){return(0,u.IntNumber)(++this.nextFilterId)}},{key:"sendAsyncPromise",value:function(e){var t=this;return new Promise((function(n,r){t.provider.sendAsync(e,(function(e,t){return e?r(e):Array.isArray(t)||null==t?r(new Error("unexpected response received: ".concat(JSON.stringify(t)))):void n(t)}))}))}},{key:"deleteFilter",value:function(e){console.log("Deleting filter (".concat(e,")")),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}},{key:"getLogFilterChanges",value:function(){var e=o(i().mark((function e(t){var n,o,a,s,f,d,h,v;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.logFilters.get(t),(o=this.cursors.get(t))&&n){e.next=4;break}return e.abrupt("return",m());case 4:return e.next=6,this.getCurrentBlockHeight();case 6:if(a=e.sent,s="latest"===n.toBlock?a:n.toBlock,!(o>a)){e.next=10;break}return e.abrupt("return",g());case 10:if(!(o>n.toBlock)){e.next=12;break}return e.abrupt("return",g());case 12:return console.log("Fetching logs from ".concat(o," to ").concat(s," for filter ").concat(t)),e.next=15,this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_getLogs",params:[p(Object.assign(Object.assign({},n),{fromBlock:o,toBlock:s}))]}));case 15:return f=e.sent,Array.isArray(f.result)&&(d=f.result.map((function(e){return(0,c.intNumberFromHexString)(e.blockNumber||"0x0")})),(h=Math.max.apply(Math,r(d)))&&h>o&&(v=(0,u.IntNumber)(h+1),console.log("Moving cursor position for filter (".concat(t,") from ").concat(o," to ").concat(v)),this.cursors.set(t,v))),e.abrupt("return",f);case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getBlockFilterChanges",value:function(){var e=o(i().mark((function e(t){var n,r,o,a,s=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.cursors.get(t)){e.next=3;break}return e.abrupt("return",m());case 3:return e.next=5,this.getCurrentBlockHeight();case 5:if(r=e.sent,!(n>r)){e.next=8;break}return e.abrupt("return",g());case 8:return console.log("Fetching blocks from ".concat(n," to ").concat(r," for filter (").concat(t,")")),e.next=11,Promise.all((0,c.range)(n,r+1).map((function(e){return s.getBlockHashByNumber((0,u.IntNumber)(e))})));case 11:return o=e.sent.filter((function(e){return!!e})),a=(0,u.IntNumber)(n+o.length),console.log("Moving cursor position for filter (".concat(t,") from ").concat(n," to ").concat(a)),this.cursors.set(t,a),e.abrupt("return",Object.assign(Object.assign({},l),{result:o}));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPendingTransactionFilterChanges",value:function(){var e=o(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve(g()));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"setInitialCursorPosition",value:function(){var e=o(i().mark((function e(t,n){var r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCurrentBlockHeight();case 2:return r=e.sent,o="number"===typeof n&&n>r?n:r,this.cursors.set(t,o),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setFilterTimeout",value:function(e){var t=this,n=this.timeouts.get(e);n&&window.clearTimeout(n);var r=window.setTimeout((function(){console.log("Filter (".concat(e,") timed out")),t.deleteFilter(e)}),3e5);this.timeouts.set(e,r)}},{key:"getCurrentBlockHeight",value:function(){var e=o(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_blockNumber",params:[]}));case 2:return t=e.sent,n=t.result,e.abrupt("return",(0,c.intNumberFromHexString)((0,c.ensureHexString)(n)));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getBlockHashByNumber",value:function(){var e=o(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},l),{method:"eth_getBlockByNumber",params:[(0,c.hexStringFromIntNumber)(t),!1]}));case 2:if(!(n=e.sent).result||"string"!==typeof n.result.hash){e.next=5;break}return e.abrupt("return",(0,c.ensureHexString)(n.result.hash));case 5:return e.abrupt("return",null);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function d(e){return{fromBlock:h(e.fromBlock),toBlock:h(e.toBlock),addresses:void 0===e.address?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}function p(e){var t={fromBlock:v(e.fromBlock),toBlock:v(e.toBlock),topics:e.topics};return null!==e.addresses&&(t.address=e.addresses),t}function h(e){if(void 0===e||"latest"===e||"pending"===e)return"latest";if("earliest"===e)return(0,u.IntNumber)(0);if((0,c.isHexString)(e))return(0,c.intNumberFromHexString)(e);throw new Error("Invalid block option: ".concat(String(e)))}function v(e){return"latest"===e?e:(0,c.hexStringFromIntNumber)(e)}function m(){return Object.assign(Object.assign({},l),{error:{code:-32e3,message:"filter not found"}})}function g(){return Object.assign(Object.assign({},l),{result:[]})}t.FilterPolyfill=f,t.filterFromParam=d},27566:function(e,t){"use strict";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={}))},49023:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionManager=void 0;var s=n(28371),u=n(68286),c=function(){},l=function(){function e(t){o(this,e);var n=new s.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),r=u({blockTracker:n,provider:t}),i=r.events,a=r.middleware;this.events=i,this.subscriptionMiddleware=a}return a(e,[{key:"handleRequest",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},e.next=3,this.subscriptionMiddleware(t,n,c,c);case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"destroy",value:function(){this.subscriptionMiddleware.destroy()}}]),e}();t.SubscriptionManager=l},34405:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKUI=void 0;var o=n(247),a=n(64620),s=n(31665),u=function(){function e(t){r(this,e),this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new a.Snackbar({darkMode:t.darkMode}),this.linkFlow=new o.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,connected$:t.connected$,chainId$:t.chainId$,isParentConnection:!1})}return i(e,[{key:"attach",value:function(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");var e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.linkFlow.attach(t),this.snackbar.attach(t),this.attached=!0,(0,s.injectCssReset)()}},{key:"setConnectDisabled",value:function(e){this.linkFlow.setConnectDisabled(e)}},{key:"addEthereumChain",value:function(e){}},{key:"watchAsset",value:function(e){}},{key:"switchEthereumChain",value:function(e){}},{key:"requestEthereumAccounts",value:function(e){this.linkFlow.open({onCancel:e.onCancel})}},{key:"hideRequestEthereumAccounts",value:function(){this.linkFlow.close()}},{key:"signEthereumMessage",value:function(e){}},{key:"signEthereumTransaction",value:function(e){}},{key:"submitEthereumTransaction",value:function(e){}},{key:"ethereumAddressFromSignedMessage",value:function(e){}},{key:"showConnecting",value:function(e){var t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:{message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}},{key:"setAppSrc",value:function(e){this.appSrc=e}},{key:"reloadUI",value:function(){document.location.reload()}},{key:"inlineAccountsResponse",value:function(){return!1}},{key:"inlineAddEthereumChain",value:function(e){return!1}},{key:"inlineWatchAsset",value:function(){return!1}},{key:"inlineSwitchEthereumChain",value:function(){return!1}},{key:"setStandalone",value:function(e){this.standalone=e}},{key:"isStandalone",value:function(){var e;return null!==(e=this.standalone)&&void 0!==e&&e}}]),e}();t.WalletSDKUI=u},94100:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))},35836:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;var o=n(90590),a=n(81107),s="session:id",u="session:secret",c="session:linked",l=function(){function e(t,n,i,s){r(this,e),this._storage=t,this._id=n||(0,a.randomBytesHex)(16),this._secret=i||(0,a.randomBytesHex)(32),this._key=(new o.sha256).update("".concat(this._id,", ").concat(this._secret," WalletLink")).digest("hex"),this._linked=!!s}return i(e,[{key:"id",get:function(){return this._id}},{key:"secret",get:function(){return this._secret}},{key:"key",get:function(){return this._key}},{key:"linked",get:function(){return this._linked},set:function(e){this._linked=e,this.persistLinked()}},{key:"save",value:function(){return this._storage.setItem(s,this._id),this._storage.setItem(u,this._secret),this.persistLinked(),this}},{key:"persistLinked",value:function(){this._storage.setItem(c,this._linked?"1":"0")}}],[{key:"load",value:function(t){var n=t.getItem(s),r=t.getItem(c),i=t.getItem(u);return n&&i?new e(t,n,i,"1"===r):null}},{key:"hash",value:function(e){return(new o.sha256).update(e).digest("hex")}}]),e}();t.Session=l},47993:function(e,t,n){"use strict";var r=n(27424).default,i=n(56690).default,o=n(89728).default,a=n(61655).default,s=n(26389).default,u=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},f=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&u(t,e,n);return c(t,e),t},d=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelay=void 0;var p=d(n(45590)),h=n(40623),v=n(21807),m=n(56171),g=n(62569),y=n(27312),b=n(99306),w=n(81107),x=f(n(71572)),k=n(35836),_=n(731),E=n(50194),A=n(90429),S=n(14107),O=n(87734),T=n(12202),P=function(e){a(n,e);var t=s(n);function n(e){var r,o;i(this,n),(r=t.call(this)).accountsCallback=null,r.chainCallback=null,r.dappDefaultChainSubject=new h.BehaviorSubject(1),r.dappDefaultChain=1,r.appName="",r.appLogoUrl=null,r.subscriptions=new h.Subscription,r.linkAPIUrl=e.linkAPIUrl,r.storage=e.storage,r.options=e;var a=r.subscribe(),s=a.session,u=a.ui,c=a.connection;if(r._session=s,r.connection=c,r.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");return e.eventListener?r.diagnostic={log:e.eventListener.onEvent}:r.diagnostic=e.diagnosticLogger,r._reloadOnDisconnect=null===(o=e.reloadOnDisconnect)||void 0===o||o,r.ui=u,r}return o(n,[{key:"subscribe",value:function(){var e=this;this.subscriptions.add(this.dappDefaultChainSubject.subscribe((function(t){e.dappDefaultChain!==t&&(e.dappDefaultChain=t)})));var t=k.Session.load(this.storage)||new k.Session(this.storage).save(),i=new g.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(i.sessionConfig$.subscribe({next:function(t){e.onSessionConfigChanged(t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(i.incomingEvent$.pipe((0,v.filter)((function(e){return"Web3Response"===e.event}))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(i.linked$.pipe((0,v.skip)(1),(0,v.tap)((function(t){var n;e.isLinked=t;var r=e.storage.getItem(_.LOCAL_STORAGE_ADDRESSES_KEY);if(t&&(e.session.linked=t),e.isUnlinkedErrorState=!1,r){var i=r.split(" "),o="true"===e.storage.getItem("IsStandaloneSigning");if(""!==i[0]&&!t&&e.session.linked&&!o){e.isUnlinkedErrorState=!0;var a=e.getSessionIdHash();null===(n=e.diagnostic)||void 0===n||n.log(m.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:a})}}}))).subscribe()),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return!!e.metadata&&"1"===e.metadata.__destroyed}))).subscribe((function(){var t,n=i.isDestroyed;return null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:n,sessionIdHash:e.getSessionIdHash()}),e.resetAndReload()}))),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.WalletUsername}))).pipe((0,v.mergeMap)((function(e){return x.decrypt(e.metadata.WalletUsername,t.secret)}))).subscribe({next:function(t){e.storage.setItem(_.WALLET_USER_NAME_KEY,t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.AppVersion}))).pipe((0,v.mergeMap)((function(e){return x.decrypt(e.metadata.AppVersion,t.secret)}))).subscribe({next:function(t){e.storage.setItem(_.APP_VERSION_KEY,t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.ChainId&&void 0!==e.metadata.JsonRpcUrl}))).pipe((0,v.mergeMap)((function(e){return(0,h.zip)(x.decrypt(e.metadata.ChainId,t.secret),x.decrypt(e.metadata.JsonRpcUrl,t.secret))}))).pipe((0,v.distinctUntilChanged)()).subscribe({next:function(t){var n=r(t,2),i=n[0],o=n[1];e.chainCallback&&e.chainCallback(i,o)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.EthereumAddress}))).pipe((0,v.mergeMap)((function(e){return x.decrypt(e.metadata.EthereumAddress,t.secret)}))).subscribe({next:function(t){e.accountsCallback&&e.accountsCallback([t]),n.accountRequestCallbackIds.size>0&&(Array.from(n.accountRequestCallbackIds.values()).forEach((function(n){var r=(0,T.Web3ResponseMessage)({id:n,response:(0,O.RequestEthereumAccountsResponse)([t])});e.invokeCallback(Object.assign(Object.assign({},r),{id:n}))})),n.accountRequestCallbackIds.clear())},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(i.sessionConfig$.pipe((0,v.filter)((function(e){return e.metadata&&void 0!==e.metadata.AppSrc}))).pipe((0,v.mergeMap)((function(e){return x.decrypt(e.metadata.AppSrc,t.secret)}))).subscribe({next:function(t){e.ui.setAppSrc(t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));var o=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:t,connected$:i.connected$,chainId$:this.dappDefaultChainSubject});return i.connect(),{session:t,ui:o,connection:i}}},{key:"attachUI",value:function(){this.ui.attach()}},{key:"resetAndReload",value:function(){var e=this;this.connection.setSessionMetadata("__destroyed","1").pipe((0,v.timeout)(1e3),(0,v.catchError)((function(e){return(0,h.of)(null)}))).subscribe((function(t){var n,r,i,o=e.ui.isStandalone();try{e.subscriptions.unsubscribe()}catch(f){null===(n=e.diagnostic)||void 0===n||n.log(m.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(r=e.diagnostic)||void 0===r||r.log(m.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:e.getSessionIdHash()}),e.connection.destroy();var a=k.Session.load(e.storage);if((null===a||void 0===a?void 0:a.id)===e._session.id?e.storage.clear():a&&(null===(i=e.diagnostic)||void 0===i||i.log(m.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:e.getSessionIdHash(),storedSessionIdHash:k.Session.hash(a.id)})),e._reloadOnDisconnect)e.ui.reloadUI();else{e.accountsCallback&&e.accountsCallback([],!0),e.subscriptions=new h.Subscription;var s=e.subscribe(),u=s.session,c=s.ui,l=s.connection;e._session=u,e.connection=l,e.ui=c,o&&e.ui.setStandalone&&e.ui.setStandalone(!0),e.attachUI()}}),(function(t){var n;null===(n=e.diagnostic)||void 0===n||n.log(m.EVENTS.FAILURE,{method:"relay::resetAndReload",message:"failed to reset and reload with ".concat(t),sessionIdHash:e.getSessionIdHash()})}))}},{key:"setAppInfo",value:function(e,t){this.appName=e,this.appLogoUrl=t}},{key:"getStorageItem",value:function(e){return this.storage.getItem(e)}},{key:"session",get:function(){return this._session}},{key:"setStorageItem",value:function(e,t){this.storage.setItem(e,t)}},{key:"signEthereumMessage",value:function(e,t,n,r){return this.sendRequest({method:E.Web3Method.signEthereumMessage,params:{message:(0,w.hexStringFromBuffer)(e,!0),address:t,addPrefix:n,typedDataJson:r||null}})}},{key:"ethereumAddressFromSignedMessage",value:function(e,t,n){return this.sendRequest({method:E.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,w.hexStringFromBuffer)(e,!0),signature:(0,w.hexStringFromBuffer)(t,!0),addPrefix:n}})}},{key:"signEthereumTransaction",value:function(e){return this.sendRequest({method:E.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,w.bigIntStringFromBN)(e.weiValue),data:(0,w.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,w.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}},{key:"signAndSubmitEthereumTransaction",value:function(e){return this.sendRequest({method:E.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,w.bigIntStringFromBN)(e.weiValue),data:(0,w.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,w.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,w.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,w.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,w.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}},{key:"submitEthereumTransaction",value:function(e,t){return this.sendRequest({method:E.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,w.hexStringFromBuffer)(e,!0),chainId:t}})}},{key:"scanQRCode",value:function(e){return this.sendRequest({method:E.Web3Method.scanQRCode,params:{regExp:e}})}},{key:"getQRCodeUrl",value:function(){return(0,w.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}},{key:"genericRequest",value:function(e,t){return this.sendRequest({method:E.Web3Method.generic,params:{action:t,data:e}})}},{key:"sendGenericMessage",value:function(e){return this.sendRequest(e)}},{key:"sendRequest",value:function(e){var t=this,n=null,r=(0,w.randomBytesHex)(8),i=function(i){t.publishWeb3RequestCanceledEvent(r),t.handleErrorResponse(r,e.method,i),null===n||void 0===n||n()};return{promise:new Promise((function(o,a){t.ui.isStandalone()||(n=t.ui.showConnecting({isUnlinkedErrorState:t.isUnlinkedErrorState,onCancel:i,onResetConnection:t.resetAndReload})),t.relayEventManager.callbacks.set(r,(function(e){if(null===n||void 0===n||n(),e.errorMessage)return a(new Error(e.errorMessage));o(e)})),t.ui.isStandalone()?t.sendRequestStandalone(r,e):t.publishWeb3RequestEvent(r,e)})),cancel:i}}},{key:"setConnectDisabled",value:function(e){this.ui.setConnectDisabled(e)}},{key:"setAccountsCallback",value:function(e){this.accountsCallback=e}},{key:"setChainCallback",value:function(e){this.chainCallback=e}},{key:"setDappDefaultChainCallback",value:function(e){this.dappDefaultChainSubject.next(e)}},{key:"publishWeb3RequestEvent",value:function(e,t){var n,r=this,i=(0,S.Web3RequestMessage)({id:e,request:t}),o=k.Session.load(this.storage);null===(n=this.diagnostic)||void 0===n||n.log(m.EVENTS.WEB3_REQUEST,{eventId:i.id,method:"relay::".concat(i.request.method),sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?k.Session.hash(o.id):"",isSessionMismatched:((null===o||void 0===o?void 0:o.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:function(e){var t;null===(t=r.diagnostic)||void 0===t||t.log(m.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:"relay::".concat(i.request.method),sessionIdHash:r.getSessionIdHash(),storedSessionIdHash:o?k.Session.hash(o.id):"",isSessionMismatched:((null===o||void 0===o?void 0:o.id)!==r._session.id).toString()})},error:function(e){r.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:e.message}}))}}))}},{key:"publishWeb3RequestCanceledEvent",value:function(e){var t=(0,A.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",t,!1).subscribe())}},{key:"publishEvent",value:function(e,t,n){var r=this,i=this.session.secret;return new h.Observable((function(e){x.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin})),i).then((function(t){e.next(t),e.complete()}))})).pipe((0,v.mergeMap)((function(t){return r.connection.publishEvent(e,t,n)})))}},{key:"handleIncomingEvent",value:function(e){var t=this;try{this.subscriptions.add((0,h.from)(x.decrypt(e.data,this.session.secret)).pipe((0,v.map)((function(e){return JSON.parse(e)}))).subscribe({next:function(e){var n=(0,T.isWeb3ResponseMessage)(e)?e:null;n&&t.handleWeb3ResponseMessage(n)},error:function(){var e;null===(e=t.diagnostic)||void 0===e||e.log(m.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(n){return}}},{key:"handleWeb3ResponseMessage",value:function(e){var t,r=this,i=e.response;if(null===(t=this.diagnostic)||void 0===t||t.log(m.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:"relay::".concat(i.method),sessionIdHash:this.getSessionIdHash()}),(0,O.isRequestEthereumAccountsResponse)(i))return n.accountRequestCallbackIds.forEach((function(t){return r.invokeCallback(Object.assign(Object.assign({},e),{id:t}))})),void n.accountRequestCallbackIds.clear();this.invokeCallback(e)}},{key:"handleErrorResponse",value:function(e,t,n,r){var i,o=null!==(i=null===n||void 0===n?void 0:n.message)&&void 0!==i?i:(0,y.standardErrorMessage)(r);this.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:e,response:{method:t,errorMessage:o,errorCode:r}}))}},{key:"invokeCallback",value:function(e){var t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}},{key:"requestEthereumAccounts",value:function(){var e=this,t={method:E.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,w.randomBytesHex)(8),i=function(n){e.publishWeb3RequestCanceledEvent(r),e.handleErrorResponse(r,t.method,n)};return{promise:new Promise((function(o,a){var s;e.relayEventManager.callbacks.set(r,(function(t){if(e.ui.hideRequestEthereumAccounts(),t.errorMessage)return a(new Error(t.errorMessage));o(t)}));var u=(null===(s=null===window||void 0===window?void 0:window.navigator)||void 0===s?void 0:s.userAgent)||null;if(u&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u)){var c;try{c=(0,w.isInIFrame)()&&window.top?window.top.location:window.location}catch(f){c=window.location}c.href="https://www.coinbase.com/connect-dapp?uri=".concat(encodeURIComponent(c.href))}else{if(e.ui.inlineAccountsResponse()){e.ui.requestEthereumAccounts({onCancel:i,onAccounts:function(t){e.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:r,response:(0,O.RequestEthereumAccountsResponse)(t)}))}})}else{var l=y.standardErrors.provider.userRejectedRequest("User denied account authorization");e.ui.requestEthereumAccounts({onCancel:function(){return i(l)}})}n.accountRequestCallbackIds.add(r),e.ui.inlineAccountsResponse()||e.ui.isStandalone()||e.publishWeb3RequestEvent(r,t)}})),cancel:i}}},{key:"selectProvider",value:function(e){var t=this,n={method:E.Web3Method.selectProvider,params:{providerOptions:e}},r=(0,w.randomBytesHex)(8);return{cancel:function(e){t.publishWeb3RequestCanceledEvent(r),t.handleErrorResponse(r,n.method,e)},promise:new Promise((function(n,i){t.relayEventManager.callbacks.set(r,(function(e){if(e.errorMessage)return i(new Error(e.errorMessage));n(e)}));t.ui.selectProvider&&t.ui.selectProvider({onApprove:function(e){t.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:r,response:(0,O.SelectProviderResponse)(e)}))},onCancel:function(e){t.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:r,response:(0,O.SelectProviderResponse)(b.ProviderType.Unselected)}))},providerOptions:e})}))}}},{key:"watchAsset",value:function(e,t,n,r,i,o){var a=this,s={method:E.Web3Method.watchAsset,params:{type:e,options:{address:t,symbol:n,decimals:r,image:i},chainId:o}},u=null,c=(0,w.randomBytesHex)(8),l=function(e){a.publishWeb3RequestCanceledEvent(c),a.handleErrorResponse(c,s.method,e),null===u||void 0===u||u()};return this.ui.inlineWatchAsset()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{cancel:l,promise:new Promise((function(l,f){a.relayEventManager.callbacks.set(c,(function(e){if(null===u||void 0===u||u(),e.errorMessage)return f(new Error(e.errorMessage));l(e)}));a.ui.inlineWatchAsset()&&a.ui.watchAsset({onApprove:function(){a.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:c,response:(0,O.WatchAssetReponse)(!0)}))},onCancel:function(e){a.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:c,response:(0,O.WatchAssetReponse)(!1)}))},type:e,address:t,symbol:n,decimals:r,image:i,chainId:o}),a.ui.inlineWatchAsset()||a.ui.isStandalone()||a.publishWeb3RequestEvent(c,s)}))}}},{key:"addEthereumChain",value:function(e,t,n,r,i,o){var a=this,s={method:E.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:t,blockExplorerUrls:r,chainName:i,iconUrls:n,nativeCurrency:o}},u=null,c=(0,w.randomBytesHex)(8),l=function(e){a.publishWeb3RequestCanceledEvent(c),a.handleErrorResponse(c,s.method,e),null===u||void 0===u||u()};return this.ui.inlineAddEthereumChain(e)||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{promise:new Promise((function(t,n){a.relayEventManager.callbacks.set(c,(function(e){if(null===u||void 0===u||u(),e.errorMessage)return n(new Error(e.errorMessage));t(e)}));a.ui.inlineAddEthereumChain(e)&&a.ui.addEthereumChain({onCancel:function(e){a.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:c,response:(0,O.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:function(e){a.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:c,response:(0,O.AddEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:s.params.chainId,rpcUrls:s.params.rpcUrls,blockExplorerUrls:s.params.blockExplorerUrls,chainName:s.params.chainName,iconUrls:s.params.iconUrls,nativeCurrency:s.params.nativeCurrency}),a.ui.inlineAddEthereumChain(e)||a.ui.isStandalone()||a.publishWeb3RequestEvent(c,s)})),cancel:l}}},{key:"switchEthereumChain",value:function(e,t){var n=this,r={method:E.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:t})},i=(0,w.randomBytesHex)(8);return{promise:new Promise((function(t,o){n.relayEventManager.callbacks.set(i,(function(e){return(0,O.isErrorResponse)(e)&&e.errorCode?o(y.standardErrors.provider.custom({code:e.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):e.errorMessage?o(new Error(e.errorMessage)):void t(e)}));n.ui.switchEthereumChain({onCancel:function(t){var r;if(t){var o=null!==(r=(0,y.getErrorCode)(t))&&void 0!==r?r:y.standardErrorCodes.provider.unsupportedChain;n.handleErrorResponse(i,E.Web3Method.switchEthereumChain,t instanceof Error?t:y.standardErrors.provider.unsupportedChain(e),o)}else n.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:i,response:(0,O.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:function(e){n.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:i,response:(0,O.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:r.params.chainId,address:r.params.address}),n.ui.inlineSwitchEthereumChain()||n.ui.isStandalone()||n.publishWeb3RequestEvent(i,r)})),cancel:function(e){n.publishWeb3RequestCanceledEvent(i),n.handleErrorResponse(i,r.method,e)}}}},{key:"inlineAddEthereumChain",value:function(e){return this.ui.inlineAddEthereumChain(e)}},{key:"getSessionIdHash",value:function(){return k.Session.hash(this._session.id)}},{key:"sendRequestStandalone",value:function(e,t){var n=this,r=function(r){n.handleErrorResponse(e,t.method,r)},i=function(t){n.handleWeb3ResponseMessage((0,T.Web3ResponseMessage)({id:e,response:t}))};switch(t.method){case E.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:t,onSuccess:i,onCancel:r});break;case E.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:t,onSuccess:i,onCancel:r});break;case E.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:t,onSuccess:i,onCancel:r});break;case E.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:t,onSuccess:i});break;default:r()}}},{key:"onSessionConfigChanged",value:function(e){}}]),n}(_.WalletSDKRelayAbstract);P.accountRequestCallbackIds=new Set,l([p.default],P.prototype,"resetAndReload",null),l([p.default],P.prototype,"handleIncomingEvent",null),t.WalletSDKRelay=P},731:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelayAbstract=t.APP_VERSION_KEY=t.LOCAL_STORAGE_ADDRESSES_KEY=t.WALLET_USER_NAME_KEY=void 0;var s=n(27312);t.WALLET_USER_NAME_KEY="walletUsername",t.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",t.APP_VERSION_KEY="AppVersion";var u=function(){function e(){o(this,e)}return a(e,[{key:"makeEthereumJSONRPCRequest",value:function(){var e=i(r().mark((function e(t,n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Error: No jsonRpcUrl provided");case 2:return e.abrupt("return",window.fetch(n,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then((function(e){return e.json()})).then((function(e){if(!e)throw s.standardErrors.rpc.parse({});var n=e,r=n.error;if(r)throw(0,s.serializeError)(r,t.method);return n})));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}();t.WalletSDKRelayAbstract=u},16642:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelayEventManager=void 0;var o=n(81107),a=function(){function e(){r(this,e),this._nextRequestId=0,this.callbacks=new Map}return i(e,[{key:"makeRequestId",value:function(){this._nextRequestId=(this._nextRequestId+1)%2147483647;var e=this._nextRequestId,t=(0,o.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}]),e}();t.WalletSDKRelayEventManager=a},50194:function(e,t){"use strict";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={}))},90429:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3RequestCanceledMessage=void 0;var r=n(94100);t.Web3RequestCanceledMessage=function(e){return{type:r.RelayMessageType.WEB3_REQUEST_CANCELED,id:e}}},14107:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3RequestMessage=void 0;var r=n(94100);t.Web3RequestMessage=function(e){return Object.assign({type:r.RelayMessageType.WEB3_REQUEST},e)}},87734:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumAddressFromSignedMessageResponse=t.SubmitEthereumTransactionResponse=t.SignEthereumTransactionResponse=t.SignEthereumMessageResponse=t.isRequestEthereumAccountsResponse=t.SelectProviderResponse=t.WatchAssetReponse=t.RequestEthereumAccountsResponse=t.SwitchEthereumChainResponse=t.AddEthereumChainResponse=t.isErrorResponse=void 0;var r=n(50194);t.isErrorResponse=function(e){var t,n;return void 0!==(null===(t=e)||void 0===t?void 0:t.method)&&void 0!==(null===(n=e)||void 0===n?void 0:n.errorMessage)},t.AddEthereumChainResponse=function(e){return{method:r.Web3Method.addEthereumChain,result:e}},t.SwitchEthereumChainResponse=function(e){return{method:r.Web3Method.switchEthereumChain,result:e}},t.RequestEthereumAccountsResponse=function(e){return{method:r.Web3Method.requestEthereumAccounts,result:e}},t.WatchAssetReponse=function(e){return{method:r.Web3Method.watchAsset,result:e}},t.SelectProviderResponse=function(e){return{method:r.Web3Method.selectProvider,result:e}},t.isRequestEthereumAccountsResponse=function(e){return e&&e.method===r.Web3Method.requestEthereumAccounts},t.SignEthereumMessageResponse=function(e){return{method:r.Web3Method.signEthereumMessage,result:e}},t.SignEthereumTransactionResponse=function(e){return{method:r.Web3Method.signEthereumTransaction,result:e}},t.SubmitEthereumTransactionResponse=function(e){return{method:r.Web3Method.submitEthereumTransaction,result:e}},t.EthereumAddressFromSignedMessageResponse=function(e){return{method:r.Web3Method.ethereumAddressFromSignedMessage,result:e}}},12202:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWeb3ResponseMessage=t.Web3ResponseMessage=void 0;var r=n(94100);t.Web3ResponseMessage=function(e){return Object.assign({type:r.RelayMessageType.WEB3_RESPONSE},e)},t.isWeb3ResponseMessage=function(e){return e&&e.type===r.RelayMessageType.WEB3_RESPONSE}},71572:function(e,t,n){"use strict";var r=n(17061).default,i=n(861).default,o=n(17156).default;Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;var a=n(81107);function s(){return(s=o(r().mark((function e(t,n){var o,s,u,c,l,f,d,p,h;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(64===n.length){e.next=2;break}throw Error("secret must be 256 bits");case 2:return o=crypto.getRandomValues(new Uint8Array(12)),e.next=5,crypto.subtle.importKey("raw",(0,a.hexStringToUint8Array)(n),{name:"aes-gcm"},!1,["encrypt","decrypt"]);case 5:return s=e.sent,u=new TextEncoder,e.next=9,window.crypto.subtle.encrypt({name:"AES-GCM",iv:o},s,u.encode(t));case 9:return c=e.sent,16,l=c.slice(c.byteLength-16),f=c.slice(0,c.byteLength-16),d=new Uint8Array(l),p=new Uint8Array(f),h=new Uint8Array([].concat(i(o),i(d),i(p))),e.abrupt("return",(0,a.uint8ArrayToHex)(h));case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.encrypt=function(e,t){return s.apply(this,arguments)},t.decrypt=function(e,t){if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((function(n,s){o(r().mark((function o(){var u,c,l,f,d,p,h,v,m;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,crypto.subtle.importKey("raw",(0,a.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]);case 2:return u=r.sent,c=(0,a.hexStringToUint8Array)(e),l=c.slice(0,12),f=c.slice(12,28),d=c.slice(28),p=new Uint8Array([].concat(i(d),i(f))),h={name:"AES-GCM",iv:new Uint8Array(l)},r.prev=9,r.next=12,window.crypto.subtle.decrypt(h,u,p);case 12:v=r.sent,m=new TextDecoder,n(m.decode(v)),r.next=20;break;case 17:r.prev=17,r.t0=r.catch(9),s(r.t0);case 20:case"end":return r.stop()}}),o,null,[[9,17]])})))()}))}},99306:function(e,t){"use strict";function n(){return function(e){return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0,t.OpaqueType=n,t.HexString=function(e){return e},t.AddressString=function(e){return e},t.BigIntString=function(e){return e},t.IntNumber=function(e){return Math.floor(e)},t.RegExpString=function(e){return e},function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""}(t.ProviderType||(t.ProviderType={}))},81107:function(e,t,n){"use strict";var r=n(38416).default,i=n(861).default,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isInIFrame=t.createQrUrl=t.getFavicon=t.range=t.isBigNumber=t.ensureParsedJSONObject=t.ensureBN=t.ensureRegExpString=t.ensureIntNumber=t.ensureBuffer=t.ensureAddressString=t.ensureEvenLengthHexString=t.ensureHexString=t.isHexString=t.prepend0x=t.strip0x=t.has0xPrefix=t.hexStringFromIntNumber=t.intNumberFromHexString=t.bigIntStringFromBN=t.hexStringFromBuffer=t.hexStringToUint8Array=t.uint8ArrayToHex=t.randomBytesHex=void 0;var a=o(n(7465)),s=n(74776),u=n(27312),c=n(99306),l=/^[0-9]*$/,f=/^[a-f0-9]*$/;function d(e){return i(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}function p(e){return e.startsWith("0x")||e.startsWith("0X")}function h(e){return p(e)?e.slice(2):e}function v(e){return p(e)?"0x"+e.slice(2):"0x"+e}function m(e){if("string"!==typeof e)return!1;var t=h(e).toLowerCase();return f.test(t)}function g(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"===typeof e){var n=h(e).toLowerCase();if(f.test(n))return(0,c.HexString)(t?"0x"+n:n)}throw u.standardErrors.rpc.invalidParams('"'.concat(String(e),'" is not a hexadecimal string'))}function y(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=g(e,!1);return n.length%2===1&&(n=(0,c.HexString)("0"+n)),t?(0,c.HexString)("0x"+n):n}function b(e){if("number"===typeof e&&Number.isInteger(e))return(0,c.IntNumber)(e);if("string"===typeof e){if(l.test(e))return(0,c.IntNumber)(Number(e));if(m(e))return(0,c.IntNumber)(new a.default(y(e,!1),16).toNumber())}throw u.standardErrors.rpc.invalidParams("Not an integer: ".concat(String(e)))}function w(e){if(null==e||"function"!==typeof e.constructor)return!1;var t=e.constructor;return"function"===typeof t.config&&"number"===typeof t.EUCLID}t.randomBytesHex=function(e){return d(crypto.getRandomValues(new Uint8Array(e)))},t.uint8ArrayToHex=d,t.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map((function(e){return parseInt(e,16)})))},t.hexStringFromBuffer=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.toString("hex");return(0,c.HexString)(t?"0x"+n:n)},t.bigIntStringFromBN=function(e){return(0,c.BigIntString)(e.toString(10))},t.intNumberFromHexString=function(e){return(0,c.IntNumber)(new a.default(y(e,!1),16).toNumber())},t.hexStringFromIntNumber=function(e){return(0,c.HexString)("0x"+new a.default(e).toString(16))},t.has0xPrefix=p,t.strip0x=h,t.prepend0x=v,t.isHexString=m,t.ensureHexString=g,t.ensureEvenLengthHexString=y,t.ensureAddressString=function(e){if("string"===typeof e){var t=h(e).toLowerCase();if(m(t)&&40===t.length)return(0,c.AddressString)(v(t))}throw u.standardErrors.rpc.invalidParams("Invalid Ethereum address: ".concat(String(e)))},t.ensureBuffer=function(e){if(Buffer.isBuffer(e))return e;if("string"===typeof e){if(m(e)){var t=y(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw u.standardErrors.rpc.invalidParams("Not binary data: ".concat(String(e)))},t.ensureIntNumber=b,t.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,c.RegExpString)(e.toString());throw u.standardErrors.rpc.invalidParams("Not a RegExp: ".concat(String(e)))},t.ensureBN=function(e){if(null!==e&&(a.default.isBN(e)||w(e)))return new a.default(e.toString(10),10);if("number"===typeof e)return new a.default(b(e));if("string"===typeof e){if(l.test(e))return new a.default(e,10);if(m(e))return new a.default(y(e,!1),16)}throw u.standardErrors.rpc.invalidParams("Not an integer: ".concat(String(e)))},t.ensureParsedJSONObject=function(e){if("string"===typeof e)return JSON.parse(e);if("object"===typeof e)return e;throw u.standardErrors.rpc.invalidParams("Not a JSON string or an object: ".concat(String(e)))},t.isBigNumber=w,t.range=function(e,t){return Array.from({length:t-e},(function(t,n){return e+n}))},t.getFavicon=function(){var e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),t=document.location,n=t.protocol,r=t.host,i=e?e.getAttribute("href"):null;return!i||i.startsWith("javascript:")?null:i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")?i:i.startsWith("//")?n+i:"".concat(n,"//").concat(r).concat(i)},t.createQrUrl=function(e,t,n,i,o,a){var u,c=i?"parent-id":"id",l=(0,s.stringify)((r(u={},c,e),r(u,"secret",t),r(u,"server",n),r(u,"v",o),r(u,"chainId",a),u));return"".concat(n,"/#/link?").concat(l)},t.isInIFrame=function(){try{return null!==window.frameElement}catch(e){return!1}}},65396:function(e,t,n){var r=n(55313),i=n(7465);function o(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function a(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function s(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function u(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function c(e){var t=typeof e;if("string"===t)return r.isHexString(e)?new i(r.stripHexPrefix(e),16):new i(e,10);if("number"===t)return new i(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function l(e,t){var n,o,f,d;if("address"===e)return l("uint160",c(t));if("bool"===e)return l("uint8",t?1:0);if("string"===e)return l("bytes",new Buffer(t,"utf8"));if(function(e){return e.lastIndexOf("]")===e.length-1}(e)){if("undefined"===typeof t.length)throw new Error("Not an array?");if("dynamic"!==(n=u(e))&&0!==n&&t.length>n)throw new Error("Elements exceed array size: "+n);for(d in f=[],e=e.slice(0,e.lastIndexOf("[")),"string"===typeof t&&(t=JSON.parse(t)),t)f.push(l(e,t[d]));if("dynamic"===n){var p=l("uint256",t.length);f.unshift(p)}return Buffer.concat(f)}if("bytes"===e)return t=new Buffer(t),f=Buffer.concat([l("uint256",t.length),t]),t.length%32!==0&&(f=Buffer.concat([f,r.zeros(32-t.length%32)])),f;if(e.startsWith("bytes")){if((n=a(e))<1||n>32)throw new Error("Invalid bytes width: "+n);return r.setLengthRight(t,32)}if(e.startsWith("uint")){if((n=a(e))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);if((o=c(t)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+o.bitLength());if(o<0)throw new Error("Supplied uint is negative");return o.toArrayLike(Buffer,"be",32)}if(e.startsWith("int")){if((n=a(e))%8||n<8||n>256)throw new Error("Invalid int width: "+n);if((o=c(t)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+o.bitLength());return o.toTwos(256).toArrayLike(Buffer,"be",32)}if(e.startsWith("ufixed")){if(n=s(e),(o=c(t))<0)throw new Error("Supplied ufixed is negative");return l("uint256",o.mul(new i(2).pow(new i(n[1]))))}if(e.startsWith("fixed"))return n=s(e),l("int256",c(t).mul(new i(2).pow(new i(n[1]))));throw new Error("Unsupported or invalid type: "+e)}function f(e){return"string"===e||"bytes"===e||"dynamic"===u(e)}function d(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var n,i,s=[],u=0;u32)throw new Error("Invalid bytes width: "+n);s.push(r.setLengthRight(f,n))}else if(l.startsWith("uint")){if((n=a(l))%8||n<8||n>256)throw new Error("Invalid uint width: "+n);if((i=c(f)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());s.push(i.toArrayLike(Buffer,"be",n/8))}else{if(!l.startsWith("int"))throw new Error("Unsupported or invalid type: "+l);if((n=a(l))%8||n<8||n>256)throw new Error("Invalid int width: "+n);if((i=c(f)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());s.push(i.toTwos(n).toArrayLike(Buffer,"be",n/8))}}return Buffer.concat(s)}e.exports={rawEncode:function(e,t){var n=[],r=[],i=32*e.length;for(var a in e){var s=o(e[a]),u=l(s,t[a]);f(s)?(n.push(l("uint256",i)),r.push(u),i+=u.length):n.push(u)}return Buffer.concat(n.concat(r))},solidityPack:d,soliditySHA3:function(e,t){return r.keccak(d(e,t))}}},36810:function(e,t,n){var r=n(74704).default,i=n(27424).default,o=n(55313),a=n(65396),s={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"]},u={encodeData:function(e,t,n){var s=this,u=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],c=["bytes32"],l=[this.hashType(e,n)];if(u){var f,d=function e(t,r,c){if(void 0!==n[r])return["bytes32",null==c?"0x0000000000000000000000000000000000000000000000000000000000000000":o.keccak(s.encodeData(r,c,n,u))];if(void 0===c)throw new Error("missing value for field ".concat(t," of type ").concat(r));if("bytes"===r)return["bytes32",o.keccak(c)];if("string"===r)return"string"===typeof c&&(c=Buffer.from(c,"utf8")),["bytes32",o.keccak(c)];if(r.lastIndexOf("]")===r.length-1){var l=r.slice(0,r.lastIndexOf("[")),f=c.map((function(n){return e(t,l,n)}));return["bytes32",o.keccak(a.rawEncode(f.map((function(e){return i(e,1)[0]})),f.map((function(e){return i(e,2)[1]}))))]}return[r,c]},p=r(n[e]);try{for(p.s();!(f=p.n()).done;){var h=f.value,v=d(h.name,h.type,t[h.name]),m=i(v,2),g=m[0],y=m[1];c.push(g),l.push(y)}}catch(_){p.e(_)}finally{p.f()}}else{var b,w=r(n[e]);try{for(w.s();!(b=w.n()).done;){var x=b.value,k=t[x.name];if(void 0!==k)if("bytes"===x.type)c.push("bytes32"),k=o.keccak(k),l.push(k);else if("string"===x.type)c.push("bytes32"),"string"===typeof k&&(k=Buffer.from(k,"utf8")),k=o.keccak(k),l.push(k);else if(void 0!==n[x.type])c.push("bytes32"),k=o.keccak(this.encodeData(x.type,k,n,u)),l.push(k);else{if(x.type.lastIndexOf("]")===x.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");c.push(x.type),l.push(k)}}}catch(_){w.e(_)}finally{w.f()}}return a.rawEncode(c,l)},encodeType:function(e,t){var n="",i=this.findTypeDependencies(e,t).filter((function(t){return t!==e}));i=[e].concat(i.sort());var o,a=r(i);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!t[s])throw new Error("No type definition specified: "+s);n+=s+"("+t[s].map((function(e){var t=e.name;return e.type+" "+t})).join(",")+")"}}catch(u){a.e(u)}finally{a.f()}return n},findTypeDependencies:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e=e.match(/^\w*/)[0],n.includes(e)||void 0===t[e])return n;n.push(e);var i,o=r(t[e]);try{for(o.s();!(i=o.n()).done;){var a,s=i.value,u=r(this.findTypeDependencies(s.type,t,n));try{for(u.s();!(a=u.n()).done;){var c=a.value;!n.includes(c)&&n.push(c)}}catch(l){u.e(l)}finally{u.f()}}}catch(l){o.e(l)}finally{o.f()}return n},hashStruct:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return o.keccak(this.encodeData(e,t,n,r))},hashType:function(e,t){return o.keccak(this.encodeType(e,t))},sanitizeData:function(e){var t={};for(var n in s.properties)e[n]&&(t[n]=e[n]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.sanitizeData(e),r=[Buffer.from("1901","hex")];return r.push(this.hashStruct("EIP712Domain",n.domain,n.types,t)),"EIP712Domain"!==n.primaryType&&r.push(this.hashStruct(n.primaryType,n.message,n.types,t)),o.keccak(Buffer.concat(r))}};e.exports={TYPED_MESSAGE_SCHEMA:s,TypedDataUtils:u,hashForSignTypedDataLegacy:function(e){return function(e){var t=new Error("Expect argument to be non-empty array");if("object"!==typeof e||!e.length)throw t;var n=e.map((function(e){return"bytes"===e.type?o.toBuffer(e.value):e.value})),r=e.map((function(e){return e.type})),i=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return a.soliditySHA3(["bytes32","bytes32"],[a.soliditySHA3(new Array(e.length).fill("string"),i),a.soliditySHA3(r,n)])}(e.data)},hashForSignTypedData_v3:function(e){return u.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return u.hash(e.data)}}},55313:function(e,t,n){var r=n(98094),i=n(7465);function o(e){return Buffer.allocUnsafe(e).fill(0)}function a(e,t,n){var r=o(t);return e=s(e),n?e.length65536?(i[0]=240|(1835008&o)>>>18,i[1]=128|(258048&o)>>>12,i[2]=128|(4032&o)>>>6,i[3]=128|63&o):o>2048?(i[0]=224|(61440&o)>>>12,i[1]=128|(4032&o)>>>6,i[2]=128|63&o):o>128?(i[0]=192|(1984&o)>>>6,i[1]=128|63&o):i[0]=o,this.parsedData.push(i)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function n(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}t.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,n=this.parsedData.length;t=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(this.modules[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=m.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},createMovieClip:function(e,t,n){var r=e.createEmptyMovieClip(t,n);this.make();for(var i=0;i>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=m.getBCHTypeInfo(n),i=0;i<15;i++){var o=!e&&1==(r>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(i=0;i<15;i++){o=!e&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[r][a-s]){var u=!1;o>>i&1)),m.getMask(t,r,a-s)&&(u=!u),this.modules[r][a-s]=u,-1==--i&&(o++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(e,t,r){for(var i=w.getRSBlocks(e,t),o=new x,a=0;a8*u)throw new Error("code length overflow. ("+o.getLengthInBits()+">"+8*u+")");for(o.getLengthInBits()+4<=8*u&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*u)&&(o.put(n.PAD0,8),!(o.getLengthInBits()>=8*u));)o.put(n.PAD1,8);return n.createBytes(o,i)},n.createBytes=function(e,t){for(var n=0,r=0,i=0,o=new Array(t.length),a=new Array(t.length),s=0;s=0?d.get(p):0}}var h=0;for(l=0;l=0;)t^=m.G15<=0;)t^=m.G18<>>=1;return t},getPatternPosition:function(e){return m.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case u:return(t+n)%2==0;case c:return t%2==0;case l:return n%3==0;case f:return(t+n)%3==0;case d:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case p:return t*n%2+t*n%3==0;case h:return(t*n%2+t*n%3)%2==0;case v:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new b([1],0),n=0;n5&&(n+=3+o-5)}for(r=0;r=256;)e-=255;return g.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},y=0;y<8;y++)g.EXP_TABLE[y]=1<>>7-e%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var k=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function _(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},"string"===typeof e&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if("string"!==typeof this.options.content)throw new Error("Expected 'content' as string!");if(0===this.options.content.length)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");var r=this.options.content,u=function(e,t){for(var n=function(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}(e),r=1,i=0,o=0,a=k.length;o<=a;o++){var s=k[o];if(!s)throw new Error("Content too long: expected "+i+" but got "+n);switch(t){case"L":i=s[0];break;case"M":i=s[1];break;case"Q":i=s[2];break;case"H":i=s[3];break;default:throw new Error("Unknwon error correction level: "+t)}if(n<=i)break;r++}if(r>k.length)throw new Error("Content too long");return r}(r,this.options.ecl),c=function(e){switch(e){case"L":return i;case"M":return o;case"Q":return a;case"H":return s;default:throw new Error("Unknwon error correction level: "+e)}}(this.options.ecl);this.qrcode=new n(u,c),this.qrcode.addData(r),this.qrcode.make()}_.prototype.svg=function(e){var t=this.options||{},n=this.qrcode.modules;"undefined"==typeof e&&(e={container:t.container||"svg"});for(var r="undefined"==typeof t.pretty||!!t.pretty,i=r?" ":"",o=r?"\r\n":"",a=t.width,s=t.height,u=n.length,c=a/(u+2*t.padding),l=s/(u+2*t.padding),f="undefined"!=typeof t.join&&!!t.join,d="undefined"!=typeof t.swap&&!!t.swap,p="undefined"==typeof t.xmlDeclaration||!!t.xmlDeclaration,h="undefined"!=typeof t.predefined&&!!t.predefined,v=h?i+''+o:"",m=i+''+o,g="",y="",b=0;b'+o:i+''+o}}f&&(g=i+'');var S="";if(void 0!==this.options.image&&this.options.image.svg){var O=a*this.options.image.width/100,T=s*this.options.image.height/100,P=s/2-T/2;S+=''),S+=this.options.image.svg+o,S+=""}var C="";switch(e.container){case"svg":p&&(C+=''+o),C+=''+o,C+=v+m+g,C+=S,C+="";break;case"svg-viewbox":p&&(C+=''+o),C+=''+o,C+=v+m+g,C+=S,C+="";break;case"g":C+=''+o,C+=v+m+g,C+=S,C+="";break;default:C+=(v+m+g+S).replace(/^\s+/,"")}return C},e.exports=_},27865:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LIB_VERSION=void 0,t.LIB_VERSION="3.7.1"},7465:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(12769).Buffer}catch(T){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(T){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=h[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?v+n:d[c-v.length]+v+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(a=(i=0|e.words[h])*(o=0|t.words[p])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],h=8191&p,v=p>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],w=8191&b,x=b>>>13,k=0|a[4],_=8191&k,E=k>>>13,A=0|a[5],S=8191&A,O=A>>>13,T=0|a[6],P=8191&T,C=T>>>13,I=0|a[7],R=8191&I,j=I>>>13,N=0|a[8],M=8191&N,L=N>>>13,U=0|a[9],D=8191&U,B=U>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,ve=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(v,Z)|0,o=Math.imul(v,z);var ge=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,Z),i=(i=Math.imul(g,z))+Math.imul(y,Z)|0,o=Math.imul(y,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,o=Math.imul(x,z),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Y)|0;var be=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,Z),i=(i=Math.imul(_,z))+Math.imul(E,Z)|0,o=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,Z),i=(i=Math.imul(S,z))+Math.imul(O,Z)|0,o=Math.imul(O,z),r=r+Math.imul(_,q)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((o=o+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(P,Z),i=(i=Math.imul(P,z))+Math.imul(C,Z)|0,o=Math.imul(C,z),r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0;var ke=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(j,Z)|0,o=Math.imul(j,z),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var _e=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,z))+Math.imul(L,Z)|0,o=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,z))+Math.imul(B,Z)|0,o=Math.imul(B,z),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Y)|0,r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,Q)|0,r=r+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(_,ne)|0,i=(i=i+Math.imul(_,re)|0)+Math.imul(E,ne)|0,o=o+Math.imul(E,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Ae=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(d,he)|0))<<13)|0;c=((o=o+Math.imul(d,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(B,q)|0,o=Math.imul(B,V),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,r=r+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Se=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(v,he)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Y))+Math.imul(B,G)|0,o=Math.imul(B,Y),r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(C,ne)|0,o=o+Math.imul(C,re)|0,r=r+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var Oe=(c+(r=r+Math.imul(g,he)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(y,he)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(D,J),i=(i=Math.imul(D,Q))+Math.imul(B,J)|0,o=Math.imul(B,Q),r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(j,ne)|0,o=o+Math.imul(j,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,r=r+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Te=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(x,he)|0))<<13)|0;c=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,r=r+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Pe=(c+(r=r+Math.imul(_,he)|0)|0)+((8191&(i=(i=i+Math.imul(_,ve)|0)+Math.imul(E,he)|0))<<13)|0;c=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(D,ne),i=(i=Math.imul(D,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,de)|0;var Ce=(c+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,ve)|0)+Math.imul(O,he)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var Ie=(c+(r=r+Math.imul(P,he)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(C,he)|0))<<13)|0;c=((o=o+Math.imul(C,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(D,ue),i=(i=Math.imul(D,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,ve)|0)+Math.imul(j,he)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(B,fe)|0,o=Math.imul(B,de);var je=(c+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(L,he)|0))<<13)|0;c=((o=o+Math.imul(L,ve)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863;var Ne=(c+(r=Math.imul(D,he))|0)+((8191&(i=(i=Math.imul(D,ve))+Math.imul(B,he)|0))<<13)|0;return c=((o=Math.imul(B,ve))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ye,u[3]=be,u[4]=we,u[5]=xe,u[6]=ke,u[7]=_e,u[8]=Ee,u[9]=Ae,u[10]=Se,u[11]=Oe,u[12]=Te,u[13]=Pe,u[14]=Ce,u[15]=Ie,u[16]=Re,u[17]=je,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(e,t,n){return g(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=v),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?v(this,e,t):n<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},b.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var h=0,v=1;0===(n.words[0]&v)&&h<26;++h,v<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},S.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=a;0!==p.cmp(s);){for(var v=p,m=0;0!==v.cmp(s);m++)v=v.redSqr();r(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,S),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},9872:function(e,t,n){"use strict";var r=n(4230),i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=(0,r.Z)((function(e){return i.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.Z=o},4230:function(e,t){"use strict";t.Z=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}},43473:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Z}});var r=n(4942),i=n(47313),o=n(9872);var a=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)===0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var i=function(e){if(e.sheet)return e.sheet;for(var t=0;tp)&&(B=(z=z.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0u.charCodeAt(8))break;case 115:a=a.replace(u,"-webkit-"+u)+";"+a;break;case 207:case 102:a=a.replace(u,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],0=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},v=n(62017),m=n(4230),g=/[A-Z]|^ms/g,y=/_EMO_([^_]+?)_([^]*?)_EMO_/g,b=function(e){return 45===e.charCodeAt(1)},w=function(e){return null!=e&&"boolean"!==typeof e},x=(0,m.Z)((function(e){return b(e)?e:e.replace(g,"-$&").toLowerCase()})),k=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(y,(function(e,t,n){return E={name:t,styles:n,next:E},t}))}return 1===v.Z[e]||b(e)||"number"!==typeof t||0===t?t:t+"px"};function _(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return E={name:n.name,styles:n.styles,next:E},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)E={name:i.name,styles:i.styles,next:E},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i96?N:M};function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var D=function(){return null},B=function e(t,n){var o,a,s;void 0!==n&&(o=n.label,s=n.target,a=t.__emotion_forwardProp&&n.shouldForwardProp?function(e){return t.__emotion_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var u=t.__emotion_real===t,c=u&&t.__emotion_base||t;"function"!==typeof a&&u&&(a=t.__emotion_forwardProp);var l=a||L(c),f=!l("as");return function(){var d=arguments,p=u&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&p.push("label:"+o+";"),null==d[0]||void 0===d[0].raw)p.push.apply(p,d);else{0,p.push(d[0][0]);for(var h=d.length,v=1;v=0)throw e;return d.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",l.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:n})}))),null==n.chainId?n.chainId=this.getChainId():n.chainId=Promise.all([Promise.resolve(n.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&d.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,(0,c.mE)(n);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||d.throwError("missing provider",l.Yd.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),m=function(e){(0,i.Z)(n,e);var t=(0,o.Z)(n);function n(e,i){var o;return(0,s.Z)(this,n),o=t.call(this),(0,c.zG)((0,r.Z)(o),"address",e),(0,c.zG)((0,r.Z)(o),"provider",i||null),o}return(0,u.Z)(n,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){d.throwError(e,l.Yd.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new n(this.address,e)}}]),n}(v)},28552:function(e,t,n){"use strict";n.r(t),n.d(t,{getAddress:function(){return v},getContractAddress:function(){return y},getCreate2Address:function(){return b},getIcapAddress:function(){return g},isAddress:function(){return m}});var r=n(52009),i=n(19560),o=n(11291),a=n(80807),s=new(n(2735).Yd)("address/5.7.0");function u(e){(0,r.A7)(e,20)||s.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),n=new Uint8Array(40),i=0;i<40;i++)n[i]=t[i].charCodeAt(0);for(var a=(0,r.lE)((0,o.w)(n)),u=0;u<40;u+=2)a[u>>1]>>4>=8&&(t[u]=t[u].toUpperCase()),(15&a[u>>1])>=8&&(t[u+1]=t[u+1].toUpperCase());return"0x"+t.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(var f=0;f<26;f++)c[String.fromCharCode(65+f)]=String(10+f);var d,p=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/Math.LN10));function h(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return c[e]})).join("");t.length>=p;){var n=t.substring(0,p);t=parseInt(n,10)%97+t.substring(n.length)}for(var r=String(98-parseInt(t,10)%97);r.length<2;)r="0"+r;return r}function v(e){var t=null;if("string"!==typeof e&&s.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=u(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&s.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==h(e)&&s.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=u("0x"+t)}else s.throwArgumentError("invalid address","address",e);return t}function m(e){try{return v(e),!0}catch(t){}return!1}function g(e){for(var t=(0,i.t2)(v(e).substring(2)).toUpperCase();t.length<30;)t="0"+t;return"XE"+h("XE00"+t)+t}function y(e){var t=null;try{t=v(e.from)}catch(u){s.throwArgumentError("missing from address","transaction",e)}var n=(0,r.G1)((0,r.lE)(i.O$.from(e.nonce).toHexString()));return v((0,r.p3)((0,o.w)((0,a.c)([t,n])),12))}function b(e,t,n){return 32!==(0,r.E1)(t)&&s.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,r.E1)(n)&&s.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",n),v((0,r.p3)((0,o.w)((0,r.zo)(["0xff",v(e),t,n])),12))}},44227:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});var r="bignumber/5.7.0"},19560:function(e,t,n){"use strict";n.d(t,{O$:function(){return m},Zm:function(){return h},g$:function(){return x},t2:function(){return k}});var r=n(15671),i=n(43144),o=n(48725),a=n.n(o),s=n(52009),u=n(2735),c=n(44227),l=a().BN,f=new u.Yd(c.i),d={},p=9007199254740991;function h(e){return null!=e&&(m.isBigNumber(e)||"number"===typeof e&&e%1===0||"string"===typeof e&&!!e.match(/^-?[0-9]+$/)||(0,s.A7)(e)||"bigint"===typeof e||(0,s._t)(e))}var v=!1,m=function(){function e(t,n){(0,r.Z)(this,e),t!==d&&f.throwError("cannot call constructor directly; use BigNumber.from",u.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=n,this._isBigNumber=!0,Object.freeze(this)}return(0,i.Z)(e,[{key:"fromTwos",value:function(e){return y(b(this).fromTwos(e))}},{key:"toTwos",value:function(e){return y(b(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return y(b(this).add(b(e)))}},{key:"sub",value:function(e){return y(b(this).sub(b(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&w("division-by-zero","div"),y(b(this).div(b(t)))}},{key:"mul",value:function(e){return y(b(this).mul(b(e)))}},{key:"mod",value:function(e){var t=b(e);return t.isNeg()&&w("division-by-zero","mod"),y(b(this).umod(t))}},{key:"pow",value:function(e){var t=b(e);return t.isNeg()&&w("negative-power","pow"),y(b(this).pow(t))}},{key:"and",value:function(e){var t=b(e);return(this.isNegative()||t.isNeg())&&w("unbound-bitwise-result","and"),y(b(this).and(t))}},{key:"or",value:function(e){var t=b(e);return(this.isNegative()||t.isNeg())&&w("unbound-bitwise-result","or"),y(b(this).or(t))}},{key:"xor",value:function(e){var t=b(e);return(this.isNegative()||t.isNeg())&&w("unbound-bitwise-result","xor"),y(b(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&w("negative-width","mask"),y(b(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&w("negative-width","shl"),y(b(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&w("negative-width","shr"),y(b(this).shrn(e))}},{key:"eq",value:function(e){return b(this).eq(b(e))}},{key:"lt",value:function(e){return b(this).lt(b(e))}},{key:"lte",value:function(e){return b(this).lte(b(e))}},{key:"gt",value:function(e){return b(this).gt(b(e))}},{key:"gte",value:function(e){return b(this).gte(b(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return b(this).isZero()}},{key:"toNumber",value:function(){try{return b(this).toNumber()}catch(e){w("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return f.throwError("this platform does not support BigInt",u.Yd.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?v||(v=!0,f.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?f.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",u.Yd.errors.UNEXPECTED_ARGUMENT,{}):f.throwError("BigNumber.toString does not accept parameters",u.Yd.errors.UNEXPECTED_ARGUMENT,{})),b(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(t){if(t instanceof e)return t;if("string"===typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(d,g(t)):t.match(/^-?[0-9]+$/)?new e(d,g(new l(t))):f.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&w("underflow","BigNumber.from",t),(t>=p||t<=-p)&&w("overflow","BigNumber.from",t),e.from(String(t));var n=t;if("bigint"===typeof n)return e.from(n.toString());if((0,s._t)(n))return e.from((0,s.Dv)(n));if(n)if(n.toHexString){var r=n.toHexString();if("string"===typeof r)return e.from(r)}else{var i=n._hex;if(null==i&&"BigNumber"===n.type&&(i=n.hex),"string"===typeof i&&((0,s.A7)(i)||"-"===i[0]&&(0,s.A7)(i.substring(1))))return e.from(i)}return f.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function g(e){if("string"!==typeof e)return g(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&f.throwArgumentError("invalid hex","value",e),"0x00"===(e=g(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function y(e){return m.from(g(e))}function b(e){var t=m.from(e).toHexString();return"-"===t[0]?new l("-"+t.substring(3),16):new l(t.substring(2),16)}function w(e,t,n){var r={fault:e,operation:t};return null!=n&&(r.value=n),f.throwError(e,u.Yd.errors.NUMERIC_FAULT,r)}function x(e){return new l(e,36).toString(16)}function k(e){return new l(e,16).toString(36)}},48725:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(88677).Buffer}catch(T){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(T){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=h[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?v+n:d[c-v.length]+v+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(a=(i=0|e.words[h])*(o=0|t.words[p])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],h=8191&p,v=p>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],w=8191&b,x=b>>>13,k=0|a[4],_=8191&k,E=k>>>13,A=0|a[5],S=8191&A,O=A>>>13,T=0|a[6],P=8191&T,C=T>>>13,I=0|a[7],R=8191&I,j=I>>>13,N=0|a[8],M=8191&N,L=N>>>13,U=0|a[9],D=8191&U,B=U>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,ve=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(v,Z)|0,o=Math.imul(v,z);var ge=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,Z),i=(i=Math.imul(g,z))+Math.imul(y,Z)|0,o=Math.imul(y,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,o=Math.imul(x,z),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Y)|0;var be=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,Z),i=(i=Math.imul(_,z))+Math.imul(E,Z)|0,o=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,Z),i=(i=Math.imul(S,z))+Math.imul(O,Z)|0,o=Math.imul(O,z),r=r+Math.imul(_,q)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((o=o+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(P,Z),i=(i=Math.imul(P,z))+Math.imul(C,Z)|0,o=Math.imul(C,z),r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0;var ke=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(j,Z)|0,o=Math.imul(j,z),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var _e=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,z))+Math.imul(L,Z)|0,o=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,z))+Math.imul(B,Z)|0,o=Math.imul(B,z),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Y)|0,r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,Q)|0,r=r+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(_,ne)|0,i=(i=i+Math.imul(_,re)|0)+Math.imul(E,ne)|0,o=o+Math.imul(E,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Ae=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(d,he)|0))<<13)|0;c=((o=o+Math.imul(d,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(B,q)|0,o=Math.imul(B,V),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,r=r+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Se=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(v,he)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Y))+Math.imul(B,G)|0,o=Math.imul(B,Y),r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(C,ne)|0,o=o+Math.imul(C,re)|0,r=r+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var Oe=(c+(r=r+Math.imul(g,he)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(y,he)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(D,J),i=(i=Math.imul(D,Q))+Math.imul(B,J)|0,o=Math.imul(B,Q),r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(j,ne)|0,o=o+Math.imul(j,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,r=r+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Te=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(x,he)|0))<<13)|0;c=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,r=r+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Pe=(c+(r=r+Math.imul(_,he)|0)|0)+((8191&(i=(i=i+Math.imul(_,ve)|0)+Math.imul(E,he)|0))<<13)|0;c=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(D,ne),i=(i=Math.imul(D,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,de)|0;var Ce=(c+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,ve)|0)+Math.imul(O,he)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var Ie=(c+(r=r+Math.imul(P,he)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(C,he)|0))<<13)|0;c=((o=o+Math.imul(C,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(D,ue),i=(i=Math.imul(D,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,ve)|0)+Math.imul(j,he)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(B,fe)|0,o=Math.imul(B,de);var je=(c+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(L,he)|0))<<13)|0;c=((o=o+Math.imul(L,ve)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863;var Ne=(c+(r=Math.imul(D,he))|0)+((8191&(i=(i=Math.imul(D,ve))+Math.imul(B,he)|0))<<13)|0;return c=((o=Math.imul(B,ve))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ye,u[3]=be,u[4]=we,u[5]=xe,u[6]=ke,u[7]=_e,u[8]=Ee,u[9]=Ae,u[10]=Se,u[11]=Oe,u[12]=Te,u[13]=Pe,u[14]=Ce,u[15]=Ie,u[16]=Re,u[17]=je,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(e,t,n){return g(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=v),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?v(this,e,t):n<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},b.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var h=0,v=1;0===(n.words[0]&v)&&h<26;++h,v<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},S.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=a;0!==p.cmp(s);){for(var v=p,m=0;0!==v.cmp(s);m++)v=v.redSqr();r(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,S),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},52009:function(e,t,n){"use strict";n.d(t,{lE:function(){return c},zo:function(){return l},xs:function(){return y},E1:function(){return m},p3:function(){return g},$P:function(){return b},$m:function(){return w},Dv:function(){return v},_t:function(){return u},Zq:function(){return a},A7:function(){return p},N:function(){return x},G1:function(){return f},Bu:function(){return d}});var r=new(n(2735).Yd)("bytes/5.7.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return p(e)&&!(e.length%2)||u(e)}function s(e){return"number"===typeof e&&e==e&&e%1===0}function u(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!s(e.length)||e.length<0)return!1;for(var t=0;t=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid arrayify value");for(var n=[];e;)n.unshift(255&e),e=parseInt(String(e/256));return 0===n.length&&n.push(0),o(new Uint8Array(n))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),p(e)){var a=e.substring(2);a.length%2&&("left"===t.hexPad?a="0"+a:"right"===t.hexPad?a+="0":r.throwArgumentError("hex data is odd-length","value",e));for(var s=[],c=0;ct&&r.throwArgumentError("value out of range","value",arguments[0]);var n=new Uint8Array(t);return n.set(e,t-e.length),o(n)}function p(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var h="0123456789abcdef";function v(e,t){if(t||(t={}),"number"===typeof e){r.checkSafeUint53(e,"invalid hexlify value");for(var n="";e;)n=h[15&e]+n,e=Math.floor(e/16);return n.length?(n.length%2&&(n="0"+n),"0x"+n):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":r.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(u(e)){for(var o="0x",a=0;a>4]+h[15&s]}return o}return r.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!==typeof e)e=v(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,n){return"string"!==typeof e?e=v(e):(!p(e)||e.length%2)&&r.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function y(e){var t="0x";return e.forEach((function(e){t+=v(e).substring(2)})),t}function b(e){var t=function(e){"string"!==typeof e&&(e=v(e));p(e)||r.throwArgumentError("invalid hex string","value",e);e=e.substring(2);var t=0;for(;t2*t+2&&r.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function x(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){var n=c(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=v(n.slice(0,32)),t.s=v(n.slice(32,64))):65===n.length?(t.r=v(n.slice(0,32)),t.s=v(n.slice(32,64)),t.v=n[64]):r.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:r.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=v(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var i=d(c(t._vs),32);t._vs=v(i);var o=i[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&r.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127;var s=v(i);null==t.s?t.s=s:t.s!==s&&r.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?r.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var u=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==u&&r.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=w(t.r,32):r.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=w(t.s,32):r.throwArgumentError("signature missing or invalid s","signature",e);var l=c(t.s);l[0]>=128&&r.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(l[0]|=128);var f=v(l);t._vs&&(p(t._vs)||r.throwArgumentError("signature invalid _vs","signature",e),t._vs=w(t._vs,32)),null==t._vs?t._vs=f:t._vs!==f&&r.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}},81895:function(e,t,n){"use strict";n.d(t,{d:function(){return r}});var r="0x0000000000000000000000000000000000000000"},6321:function(e,t,n){"use strict";n.d(t,{Bz:function(){return s},_Y:function(){return o},fh:function(){return a},tL:function(){return i}});var r=n(19560),i=r.O$.from(-1),o=r.O$.from(0),a=r.O$.from(1),s=r.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},93358:function(e,t,n){"use strict";n.d(t,{id:function(){return o}});var r=n(11291),i=n(91953);function o(e){return(0,r.w)((0,i.Y0)(e))}},11291:function(e,t,n){"use strict";n.d(t,{w:function(){return a}});var r=n(37676),i=n.n(r),o=n(52009);function a(e){return"0x"+i().keccak_256((0,o.lE)(e))}},2735:function(e,t,n){"use strict";n.d(t,{Yd:function(){return h}});var r=n(15671),i=n(43144),o=!1,a=!1,s={debug:1,default:2,info:2,warning:3,error:4,off:5},u=s.default,c=null;var l,f,d=function(){try{var e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(l||(l={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(f||(f={}));var p="0123456789abcdef",h=function(){function e(t){(0,r.Z)(this,e),Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}return(0,i.Z)(e,[{key:"_log",value:function(e,t){var n=e.toLowerCase();null==s[n]&&this.throwArgumentError("invalid log level name","logLevel",e),u>s[n]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r>4],n+=p[15&t[o]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(c){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push("code=".concat(n)),i.push("version=".concat(this.version));var o=t,s="";switch(n){case f.NUMERIC_FAULT:s="NUMERIC_FAULT";var u=t;switch(u){case"overflow":case"underflow":case"division-by-zero":s+="-"+u;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break;case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:s=n}s&&(t+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(t+=" ("+i.join(", ")+")");var c=new Error(t);return c.reason=o,c.code=n,Object.keys(r).forEach((function(e){c[e]=r[e]})),c}},{key:"throwError",value:function(e,t,n){throw this.makeError(e,t,n)}},{key:"throwArgumentError",value:function(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}},{key:"assert",value:function(e,t,n,r){e||this.throwError(t,n,r)}},{key:"assertArgument",value:function(e,t,n,r){e||this.throwArgumentError(t,n,r)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),d&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:d})}},{key:"checkSafeUint53",value:function(t,n){"number"===typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,n,r){r=r?": "+r:"",tn&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}},{key:"checkNew",value:function(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}},{key:"checkAbstract",value:function(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}}],[{key:"globalLogger",value:function(){return c||(c=new e("logger/5.7.0")),c}},{key:"setCensorship",value:function(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!t,o=!!n}},{key:"setLogLevel",value:function(t){var n=s[t.toLowerCase()];null!=n?u=n:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();h.errors=f,h.levels=l},54812:function(e,t,n){"use strict";n.d(t,{dk:function(){return y},uj:function(){return d},p$:function(){return g},zG:function(){return c},tu:function(){return l},mE:function(){return f},DC:function(){return p}});var r=n(43144),i=n(15671),o=n(74165),a=n(2735),s=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},u=new a.Yd("properties/5.7.0");function c(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function l(e,t){for(var n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!==typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function f(e){return s(this,void 0,void 0,(0,o.Z)().mark((function t(){var n,r;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Object.keys(e).map((function(t){var n=e[t];return Promise.resolve(n).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(n);case 3:return r=t.sent,t.abrupt("return",r.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))}function d(e,t){e&&"object"===typeof e||u.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(n){t[n]||u.throwArgumentError("invalid object key - "+n,"transaction:"+n,e)}))}function p(e){var t={};for(var n in e)t[n]=e[n];return t}var h={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function v(e){if(void 0===e||null===e||h[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;for(var t=Object.keys(e),n=0;n0;)n.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===t[s]&&s=0;--u)a+=this.alphabet[n[u]];return a}},{key:"decode",value:function(e){if("string"!==typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var n=0;n>=8;for(;i>0;)t.push(255&i),i>>=8}for(var a=0;e[a]===this._leader&&a0&&Array.isArray(t)?e(t,i-1):n.push(t)}))}(e,t),n}function R(e){return function(e){var t=0;return function(){return e[t++]}}(function(e){var t=0;function n(){return e[t++]<<8|e[t++]}for(var r=n(),i=1,o=[0,1],a=1;a>--c&1}for(var d=Math.pow(2,31),p=d>>>1,h=p>>1,v=d-1,m=0,g=0;g<31;g++)m=m<<1|f();for(var y=[],b=0,w=d;;){for(var x=Math.floor(((m-b+1)*i-1)/w),k=0,_=r;_-k>1;){var E=k+_>>>1;x>>1|f(),A=A<<1^p,S=(S^p)<<1|p|1;b=A,w=1+S-A}var O=r-4;return y.map((function(t){switch(t-O){case 3:return O+65792+(e[u++]<<16|e[u++]<<8|e[u++]);case 2:return O+256+(e[u++]<<8|e[u++]);case 1:return O+e[u++];default:return t-1}}))}(e))}function j(e){return 1&e?~e>>1:e>>1}function N(e,t){for(var n=Array(e),r=0,i=-1;r>=1),check:2==o}}()}(F),V=45,W=95;function G(e){return(0,S.XL)(e)}function Y(e){return e.filter((function(e){return 65039!=e}))}function K(e){var t,n=(0,C.Z)(e.split("."));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=G(r);try{for(var o=i.lastIndexOf(W)-1;o>=0;o--)if(i[o]!==W)throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(e){return e<128}))&&i[2]===V&&i[3]===V)throw new Error("invalid label extension")}catch(a){throw new Error('Invalid label "'.concat(r,'": ').concat(a.message))}}}catch(a){n.e(a)}finally{n.f()}return e}function J(e){return K(function(e,t){var n=G(e).reverse(),r=[];for(;n.length;){var i=Q(n);if(i)r.push.apply(r,(0,P.Z)(t(i)));else{var o=n.pop();if(Z.has(o))r.push(o);else if(!z.has(o)){var a=H[o];if(!a)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));r.push.apply(r,(0,P.Z)(a))}}}return K((s=String.fromCodePoint.apply(String,r),s.normalize("NFC")));var s}(e,Y))}function Q(e,t){var n,r,i,o=q,a=[],s=e.length;t&&(t.length=0);for(var u=function(){var u=e[--s];if(!(o=null===(n=o.branches.find((function(e){return e.set.has(u)})))||void 0===n?void 0:n.node))return"break";if(o.save)i=u;else if(o.check&&u===i)return"break";a.push(u),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(r=a.slice(),2==o.valid&&r.splice(1,1),t&&t.push.apply(t,(0,P.Z)(e.slice(s).reverse())),e.length=s)};s;){if("break"===u())break}return r}var X=new i.Yd(T),$=new Uint8Array(32);function ee(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function te(e){var t=(0,S.Y0)(J(e)),n=[];if(0===e.length)return n;for(var r=0,i=0;i=t.length)throw new Error("invalid ENS name; empty component");return n.push(ee(t.slice(r))),n}function ne(e){"string"!==typeof e&&X.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=$,n=te(e);n.length;)t=(0,O.w)((0,b.zo)([t,(0,O.w)(n.pop())]));return(0,b.Dv)(t)}$.fill(0);var re=n(37553),ie=n.n(re);new i.Yd("sha2/5.7.0");function oe(e){return"0x"+ie().sha256().update((0,b.lE)(e)).digest("hex")}var ae=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};function se(e,t){return ae(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,i,o,a,s;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t={}),r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions&&((i=t.fetchOptions).mode&&(r.mode=i.mode),i.cache&&(r.cache=i.cache),i.credentials&&(r.credentials=i.credentials),i.redirect&&(r.redirect=i.redirect),i.referrer&&(r.referrer=i.referrer)),n.next=7,fetch(e,r);case 7:return o=n.sent,n.next=10,o.arrayBuffer();case 10:return a=n.sent,s={},o.headers.forEach?o.headers.forEach((function(e,t){s[t.toLowerCase()]=e})):o.headers.keys().forEach((function(e){s[e.toLowerCase()]=o.headers.get(e)})),n.abrupt("return",{headers:s,statusCode:o.status,statusMessage:o.statusText,body:(0,b.lE)(new Uint8Array(a))});case 14:case"end":return n.stop()}}),n)})))}var ue=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ce=new i.Yd("web/5.7.1");function le(e){return new Promise((function(t){setTimeout(t,e)}))}function fe(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,b.Zq)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,S.ZN)(e)}catch(n){}return(0,b.Dv)(e)}return e}function de(e,t,n){var r=null;if(null!=t){r=(0,S.Y0)(t);var o="string"===typeof e?{url:e}:(0,k.DC)(e);if(o.headers)0!==Object.keys(o.headers).filter((function(e){return"content-type"===e.toLowerCase()})).length||(o.headers=(0,k.DC)(o.headers),o.headers["content-type"]="application/json");else o.headers={"content-type":"application/json"};e=o}return function(e,t,n){var r="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;ce.assertArgument(r>0&&r%1===0,"invalid connection throttle limit","connection.throttleLimit",r);var o="object"===typeof e?e.throttleCallback:null,a="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;ce.assertArgument(a>0&&a%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",a);var s="object"===typeof e&&!!e.errorPassThrough,u={},c=null,l={method:"GET"},f=!1,d=12e4;if("string"===typeof e)c=e;else if("object"===typeof e){if(null!=e&&null!=e.url||ce.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"===typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(var p in e.headers)u[p.toLowerCase()]={key:p,value:String(e.headers[p])},["if-none-match","if-modified-since"].indexOf(p.toLowerCase())>=0&&(f=!0);if(l.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&ce.throwError("basic authentication requires a secure https url",i.Yd.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});var h=e.user+":"+e.password;u.authorization={key:"Authorization",value:"Basic "+x((0,S.Y0)(h))}}null!=e.skipFetchSetup&&(l.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(l.fetchOptions=(0,k.DC)(e.fetchOptions))}var v,g=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=c?c.match(g):null;if(y)try{var b={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?w(y[3]):(v=y[3],(0,S.Y0)(v.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},_=b.body;return n&&(_=n(b.body,b)),Promise.resolve(_)}catch(T){ce.throwError("processing response error",i.Yd.errors.SERVER_ERROR,{body:fe(y[1],y[2]),error:T,requestBody:null,requestMethod:"GET",url:c})}t&&(l.method="POST",l.body=t,null==u["content-type"]&&(u["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==u["content-length"]&&(u["content-length"]={key:"Content-Length",value:String(t.length)}));var E={};Object.keys(u).forEach((function(e){var t=u[e];E[t.key]=t.value})),l.headers=E;var A=function(){var e=null;return{promise:new Promise((function(t,n){d&&(e=setTimeout((function(){null!=e&&(e=null,n(ce.makeError("timeout",i.Yd.errors.TIMEOUT,{requestBody:fe(l.body,E["content-type"]),requestMethod:l.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),O=function(){return ue(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,u,d,p,h,v,g,y,b,w;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t=300)&&(A.cancel(),ce.throwError("bad response",i.Yd.errors.SERVER_ERROR,{status:u.statusCode,headers:u.headers,body:fe(g,u.headers?u.headers["content-type"]:null),requestBody:fe(l.body,E["content-type"]),requestMethod:l.method,url:c})),!n){e.next=60;break}return e.prev=37,e.next=40,n(g,u);case 40:return y=e.sent,A.cancel(),e.abrupt("return",y);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&ts)return void(a()&&r(new Error("retry limit reached")));var c=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));ct.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&r(e)}))}()}))}var he=n(65109),ve=n.n(he),me="providers/5.7.2",ge=n(28552),ye=n(81895),be=n(14046),we=new i.Yd(me),xe=function(){function e(){(0,g.Z)(this,e),this.formats=this.getDefaultFormats()}return(0,y.Z)(e,[{key:"getDefaultFormats",value:function(){var t=this,n={},r=this.address.bind(this),i=this.bigNumber.bind(this),o=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),u=this.hex.bind(this),c=this.number.bind(this),l=this.type.bind(this);return n.transaction={hash:s,type:l,accessList:e.allowNull(this.accessList.bind(this),null),blockHash:e.allowNull(s,null),blockNumber:e.allowNull(c,null),transactionIndex:e.allowNull(c,null),confirmations:e.allowNull(c,null),from:r,gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),gasLimit:i,to:e.allowNull(r,null),value:i,nonce:c,data:a,r:e.allowNull(this.uint256),s:e.allowNull(this.uint256),v:e.allowNull(c),creates:e.allowNull(r,null),raw:e.allowNull(a)},n.transactionRequest={from:e.allowNull(r),nonce:e.allowNull(c),gasLimit:e.allowNull(i),gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),to:e.allowNull(r),value:e.allowNull(i),data:e.allowNull((function(e){return t.data(e,!0)})),type:e.allowNull(c),accessList:e.allowNull(this.accessList.bind(this),null)},n.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:r,topics:e.arrayOf(s),data:a,logIndex:c,blockHash:s},n.receipt={to:e.allowNull(this.address,null),from:e.allowNull(this.address,null),contractAddress:e.allowNull(r,null),transactionIndex:c,root:e.allowNull(u),gasUsed:i,logsBloom:e.allowNull(a),blockHash:s,transactionHash:s,logs:e.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:e.allowNull(c,null),cumulativeGasUsed:i,effectiveGasPrice:e.allowNull(i),status:e.allowNull(c),type:l},n.block={hash:e.allowNull(s),parentHash:s,number:c,timestamp:c,nonce:e.allowNull(u),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:e.allowNull(r),extraData:a,transactions:e.allowNull(e.arrayOf(s)),baseFeePerGas:e.allowNull(i)},n.blockWithTransactions=(0,k.DC)(n.block),n.blockWithTransactions.transactions=e.allowNull(e.arrayOf(this.transactionResponse.bind(this))),n.filter={fromBlock:e.allowNull(o,void 0),toBlock:e.allowNull(o,void 0),blockHash:e.allowNull(s,void 0),address:e.allowNull(r,void 0),topics:e.allowNull(this.topics.bind(this),void 0)},n.filterLog={blockNumber:e.allowNull(c),blockHash:e.allowNull(s),transactionIndex:c,removed:e.allowNull(this.boolean.bind(this)),address:r,data:e.allowFalsish(a,"0x"),topics:e.arrayOf(s),transactionHash:s,logIndex:c},n}},{key:"accessList",value:function(e){return(0,be.z7)(e||[])}},{key:"number",value:function(e){return"0x"===e?0:A.O$.from(e).toNumber()}},{key:"type",value:function(e){return"0x"===e||null==e?0:A.O$.from(e).toNumber()}},{key:"bigNumber",value:function(e){return A.O$.from(e)}},{key:"boolean",value:function(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}},{key:"hex",value:function(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,b.A7)(e))?e.toLowerCase():we.throwArgumentError("invalid hash","value",e)}},{key:"data",value:function(e,t){var n=this.hex(e,t);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}},{key:"address",value:function(e){return(0,ge.getAddress)(e)}},{key:"callAddress",value:function(e){if(!(0,b.A7)(e,32))return null;var t=(0,ge.getAddress)((0,b.p3)(e,12));return t===ye.d?null:t}},{key:"contractAddress",value:function(e){return(0,ge.getContractAddress)(e)}},{key:"blockTag",value:function(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"===typeof e||(0,b.A7)(e))return(0,b.$P)(e);throw new Error("invalid blockTag")}},{key:"hash",value:function(e,t){var n=this.hex(e,t);return 32!==(0,b.E1)(n)?we.throwArgumentError("invalid hash","value",e):n}},{key:"difficulty",value:function(e){if(null==e)return null;var t=A.O$.from(e);try{return t.toNumber()}catch(n){}return null}},{key:"uint256",value:function(e){if(!(0,b.A7)(e))throw new Error("invalid uint256");return(0,b.$m)(e,32)}},{key:"_block",value:function(t,n){null!=t.author&&null==t.miner&&(t.miner=t.author);var r=null!=t._difficulty?t._difficulty:t.difficulty,i=e.check(n,t);return i._difficulty=null==r?null:A.O$.from(r),i}},{key:"block",value:function(e){return this._block(e,this.formats.block)}},{key:"blockWithTransactions",value:function(e){return this._block(e,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(t){return e.check(this.formats.transactionRequest,t)}},{key:"transactionResponse",value:function(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&A.O$.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);var n=e.check(this.formats.transaction,t);if(null!=t.chainId){var r=t.chainId;(0,b.A7)(r)&&(r=A.O$.from(r).toNumber()),n.chainId=r}else{var i=t.networkId;null==i&&null==n.v&&(i=t.chainId),(0,b.A7)(i)&&(i=A.O$.from(i).toNumber()),"number"!==typeof i&&null!=n.v&&((i=(n.v-35)/2)<0&&(i=0),i=parseInt(i)),"number"!==typeof i&&(i=0),n.chainId=i}return n.blockHash&&"x"===n.blockHash.replace(/0/g,"")&&(n.blockHash=null),n}},{key:"transaction",value:function(e){return(0,be.Qc)(e)}},{key:"receiptLog",value:function(t){return e.check(this.formats.receiptLog,t)}},{key:"receipt",value:function(t){var n=e.check(this.formats.receipt,t);if(null!=n.root)if(n.root.length<=4){var r=A.O$.from(n.root).toNumber();0===r||1===r?(null!=n.status&&n.status!==r&&we.throwArgumentError("alt-root-status/status mismatch","value",{root:n.root,status:n.status}),n.status=r,delete n.root):we.throwArgumentError("invalid alt-root-status","value.root",n.root)}else 66!==n.root.length&&we.throwArgumentError("invalid root hash","value.root",n.root);return null!=n.status&&(n.byzantium=!0),n}},{key:"topics",value:function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.topics(e)})):null!=e?this.hash(e,!0):null}},{key:"filter",value:function(t){return e.check(this.formats.filter,t)}},{key:"filterLog",value:function(t){return e.check(this.formats.filterLog,t)}}],[{key:"check",value:function(e,t){var n={};for(var r in e)try{var i=e[r](t[r]);void 0!==i&&(n[r]=i)}catch(o){throw o.checkKey=r,o.checkValue=t[r],o}return n}},{key:"allowNull",value:function(e,t){return function(n){return null==n?t:e(n)}}},{key:"allowFalsish",value:function(e,t){return function(n){return n?e(n):t}}},{key:"arrayOf",value:function(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var n=[];return t.forEach((function(t){n.push(e(t))})),n}}}]),e}();function ke(e){return e&&"function"===typeof e.isCommunityResource}function _e(e){return ke(e)&&e.isCommunityResource()}var Ee=!1;function Ae(){Ee||(Ee=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var Se=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Oe=new i.Yd(me);function Te(e){return null==e?"null":(32!==(0,b.E1)(e)&&Oe.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Pe(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[Te(e)]=!0}));var n=Object.keys(t);return n.sort(),n.join("|")}return Te(e)})).join("&")}function Ce(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,b.E1)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Pe(e);if(r.Sg.isForkEvent(e))throw Oe.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+Pe(e.topics||[])}throw new Error("invalid event - "+e)}function Ie(){return(new Date).getTime()}function Re(e){return new Promise((function(t){setTimeout(t,e)}))}var je=["block","network","pending","poll"],Ne=function(){function e(t,n,r){(0,g.Z)(this,e),(0,k.zG)(this,"tag",t),(0,k.zG)(this,"listener",n),(0,k.zG)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}return(0,y.Z)(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":");if("filter"!==e[0])return null;var t,n=e[1],r=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[];var t=e.split("|").map((function(e){return"null"===e?null:e}));return 1===t.length?t[0]:t})),i={};return r.length>0&&(i.topics=r),n&&"*"!==n&&(i.address=n),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||je.indexOf(this.tag)>=0}}]),e}(),Me={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Le(e){return(0,b.$m)(A.O$.from(e).toHexString(),32)}function Ue(e){return E.encode((0,b.zo)([e,(0,b.p3)(oe(oe(e)),0,4)]))}var De=new RegExp("^(ipfs)://(.*)$","i"),Be=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),De,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Fe(e,t){try{return(0,S.ZN)(Ze(e,t))}catch(n){}return null}function Ze(e,t){if("0x"===e)return null;var n=A.O$.from((0,b.p3)(e,t,t+32)).toNumber(),r=A.O$.from((0,b.p3)(e,n,n+32)).toNumber();return(0,b.p3)(e,n+32,n+32+r)}function ze(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Oe.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function He(e){var t=(0,b.lE)(e);if(t.length>32)throw new Error("internal; should not happen");var n=new Uint8Array(32);return n.set(t,32-t.length),n}function qe(e){if(e.length%32===0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ve(e){for(var t=[],n=0,r=0;r63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),r.data])]);case 7:return n.prev=7,n.next=10,this.provider.call(r);case 10:return a=n.sent,(0,b.lE)(a).length%32===4&&Oe.throwError("resolver threw error",i.Yd.errors.CALL_EXCEPTION,{transaction:r,data:a}),o&&(a=Ze(a,0)),n.abrupt("return",a);case 16:if(n.prev=16,n.t0=n.catch(7),n.t0.code!==i.Yd.errors.CALL_EXCEPTION){n.next=20;break}return n.abrupt("return",null);case 20:throw n.t0;case 21:case"end":return n.stop()}var s}),n,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(e,t){return Se(this,void 0,void 0,(0,m.Z)().mark((function n(){var r;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this._fetch(e,t);case 2:if(null==(r=n.sent)){n.next=5;break}return n.abrupt("return",Ze(r,0));case 5:return n.abrupt("return",null);case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_getAddress",value:function(e,t){var n=Me[String(e)];if(null==n&&Oe.throwError("unsupported coin type: ".concat(e),i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===n.ilk)return this.provider.formatter.address(t);var r=(0,b.lE)(t);if(null!=n.p2pkh){var o=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(o){var a=parseInt(o[1],16);if(o[2].length===2*a&&a>=1&&a<=75)return Ue((0,b.zo)([[n.p2pkh],"0x"+o[2]]))}}if(null!=n.p2sh){var s=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){var u=parseInt(s[1],16);if(s[2].length===2*u&&u>=1&&u<=75)return Ue((0,b.zo)([[n.p2sh],"0x"+s[2]]))}}if(null!=n.prefix){var c=r[1],l=r[0];if(0===l?20!==c&&32!==c&&(l=-1):l=-1,l>=0&&r.length===2+c&&c>=1&&c<=75){var f=ve().toWords(r.slice(2));return f.unshift(l),ve().encode(n.prefix,f)}}return null}},{key:"getAddress",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,o;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16;break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(n=t.sent)&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==n){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(n));case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==i.Yd.errors.CALL_EXCEPTION){t.next=15;break}return t.abrupt("return",null);case 15:throw t.t0;case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",Le(e));case 18:if(null!=(r=t.sent)&&"0x"!==r){t.next=21;break}return t.abrupt("return",null);case 21:return null==(o=this._getAddress(e,r))&&Oe.throwError("invalid or unsupported coin data",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:r}),t.abrupt("return",o);case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,n,r,i,o,a,s,u,c,l,f,d,p,h,v,g;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar");case 4:if(null!=(n=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:r=0;case 8:if(!(r=0?null:JSON.stringify({data:a,sender:o}),r.next=12,de({url:l,errorPassThrough:!0},f,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(d=r.sent).data){r.next=15;break}return r.abrupt("return",d.data);case 15:if(p=d.message||"unknown error",!(d.status>=400&&d.status<500)){r.next=18;break}return r.abrupt("return",Oe.throwError("response not found during CCIP fetch: ".concat(p),i.Yd.errors.SERVER_ERROR,{url:c,errorMessage:p}));case 18:s.push(p);case 19:u++,r.next=6;break;case 22:return r.abrupt("return",Oe.throwError("error encountered during CCIP fetch: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),i.Yd.errors.SERVER_ERROR,{urls:n,errorMessages:s}));case 23:case"end":return r.stop()}}),r,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,i,o,a=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:if(!(e>0)){t.next=20;break}case 3:if(!this._internalBlockNumber){t.next=20;break}return n=this._internalBlockNumber,t.prev=5,t.next=8,n;case 8:if(r=t.sent,!(Ie()-r.respTime<=e)){t.next=11;break}return t.abrupt("return",r.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==n){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return i=Ie(),o=(0,k.mE)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,n=e.networkError;if(n)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),n;var r=Ie();return(t=A.O$.from(t).toNumber())1e3)Oe.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(r,")")),this.emit("error",Oe.makeError("network block skew detected",i.Yd.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(o=this._emitted.block+1;o<=r;o++)this.emit("block",o);return this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=a._emitted[e];"pending"!==t&&r-t>12&&delete a._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=a.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(a._emitted["t:"+t]=e.blockNumber,a.emit(t,e),null):null})).catch((function(e){a.emit("error",e)}));n.push(i);break;case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);var o=e.filter;o.fromBlock=e._lastBlockNumber+1,o.toBlock=r;var s=o.toBlock-a._maxFilterBlockRange;s>o.fromBlock&&(o.fromBlock=s),o.fromBlock<0&&(o.fromBlock=0);var u=a.getLogs(o).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),a._emitted["b:"+t.blockHash]=t.blockNumber,a._emitted["t:"+t.transactionHash]=t.blockNumber,a.emit(o,t)}))})).catch((function(t){a.emit("error",t),e._inflight=!1}));n.push(u)}}})),this._lastBlockNumber=r,Promise.all(n).then((function(){a.emit("didPoll",t)})).catch((function(e){a.emit("error",e)})),e.abrupt("return");case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Oe.throwError("provider does not support network detection",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,n,r;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:return t=e.sent,e.next=5,this.detectNetwork();case 5:if(n=e.sent,t.chainId===n.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=n,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",n,t),e.next=19,Re(0);case 19:return e.abrupt("return",this._network);case 20:throw r=Oe.makeError("underlying network changed",i.Yd.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:n}),this.emit("error",r),r;case 23:return e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this;if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=Ie();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,n){return Se(this,void 0,void 0,(0,m.Z)().mark((function r(){return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this._waitForTransaction(e,null==t?1:t,n||0,null));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"_waitForTransaction",value:function(e,t,n,r){return Se(this,void 0,void 0,(0,m.Z)().mark((function o(){var a,s=this;return(0,m.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.getTransactionReceipt(e);case 2:if(!(((a=o.sent)?a.confirmations:0)>=t)){o.next=5;break}return o.abrupt("return",a);case 5:return o.abrupt("return",new Promise((function(o,a){var u=[],c=!1,l=function(){return!!c||(c=!0,u.forEach((function(e){e()})),!1)},f=function(e){e.confirmations0){var v=setTimeout((function(){l()||a(Oe.makeError("timeout exceeded",i.Yd.errors.TIMEOUT,{timeout:n}))}),n);v.unref&&v.unref(),u.push((function(){clearTimeout(v)}))}})));case 6:case"end":return o.stop()}}),o,this)})))}},{key:"getBlockNumber",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return Se(this,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,this.perform("getGasPrice",{});case 4:return t=e.sent,e.prev=5,e.abrupt("return",A.O$.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0}));case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return Se(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,k.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getBalance",r);case 7:return o=n.sent,n.prev=8,n.abrupt("return",A.O$.from(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getBalance",params:r,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return Se(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,k.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getTransactionCount",r);case 7:return o=n.sent,n.prev=8,n.abrupt("return",A.O$.from(o).toNumber());case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return Se(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,(0,k.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return r=n.sent,n.next=7,this.perform("getCode",r);case 7:return o=n.sent,n.prev=8,n.abrupt("return",(0,b.Dv)(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getCode",params:r,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,n){return Se(this,void 0,void 0,(0,m.Z)().mark((function r(){var o,a;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,(0,k.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(t).then((function(e){return(0,b.$P)(e)}))});case 4:return o=r.sent,r.next=7,this.perform("getStorageAt",o);case 7:return a=r.sent,r.prev=8,r.abrupt("return",(0,b.Dv)(a));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",Oe.throwError("bad result from backend",i.Yd.errors.SERVER_ERROR,{method:"getStorageAt",params:o,result:a,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,n){var r=this;if(null!=t&&32!==(0,b.E1)(t))throw new Error("invalid response - sendTransaction");var o=e;return null!=t&&e.hash!==t&&Oe.throwError("Transaction hash mismatch from Provider.sendTransaction.",i.Yd.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),o.wait=function(t,o){return Se(r,void 0,void 0,(0,m.Z)().mark((function r(){var a,s;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t=1),null==o&&(o=0),a=void 0,0!==t&&null!=n&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n}),r.next=6,this._waitForTransaction(e.hash,t,o,a);case 6:if(null!=(s=r.sent)||0!==t){r.next=9;break}return r.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=s.blockNumber,0===s.status&&Oe.throwError("transaction failed",i.Yd.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:s}),r.abrupt("return",s);case 12:case"end":return r.stop()}}),r,this)})))},o}},{key:"sendTransaction",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,i,o;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Promise.resolve(e).then((function(e){return(0,b.Dv)(e)}));case 4:return n=t.sent,null==(r=this.formatter.transaction(e)).confirmations&&(r.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return i=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:n});case 13:return o=t.sent,t.abrupt("return",this._wrapTransaction(r,o,i));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=r,t.t0.transactionHash=r.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,i=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return n=t.sent,r={},["from","to"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?A.O$.from(e):null})))})),["type"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return null!=e?e:null})))})),n.accessList&&(r.accessList=this.formatter.accessList(n.accessList)),["data"].forEach((function(e){null!=n[e]&&(r[e]=Promise.resolve(n[e]).then((function(e){return e?(0,b.Dv)(e):null})))})),t.t0=this.formatter,t.next=12,(0,k.mE)(r);case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return Se(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,n={},null!=e.address&&(n.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(n[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(n[t]=r._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,(0,k.mE)(n);case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,n){return Se(this,void 0,void 0,(0,m.Z)().mark((function r(){var o,a,s,u,c,l,f,d,p,h,v,g,y,w,x;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n>=10&&Oe.throwError("CCIP read exceeded maximum redirections",i.Yd.errors.SERVER_ERROR,{redirects:n,transaction:e}),o=e.to,r.next=4,this.perform("call",{transaction:e,blockTag:t});case 4:if(a=r.sent,!(n>=0&&"latest"===t&&null!=o&&"0x556f1830"===a.substring(0,10)&&(0,b.E1)(a)%32===4)){r.next=31;break}for(r.prev=6,s=(0,b.p3)(a,4),u=(0,b.p3)(s,0,32),A.O$.from(u).eq(o)||Oe.throwError("CCIP Read sender did not match",i.Yd.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:a}),c=[],l=A.O$.from((0,b.p3)(s,32,64)).toNumber(),f=A.O$.from((0,b.p3)(s,l,l+32)).toNumber(),d=(0,b.p3)(s,l+32),p=0;pthis._emitted.block)){e.next=10;break}return e.abrupt("return",null);case 10:return e.abrupt("return",void 0);case 11:if(!t){e.next=34;break}o=null,a=0;case 14:if(!(a0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,n){var r=new Ne(Ce(e),t,n);return this._events.push(r),this._startEvent(r),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i256||t[2]&&t[2]!==String(r))&&nt.throwArgumentError("invalid numeric width","type",e);var i=st.mask(n?r-1:r),o=n?i.add(at).mul(it):ot;return function(t){var n=A.O$.from(t);return(n.lt(o)||n.gt(i))&&nt.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),(0,b.$m)(n.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&nt.throwArgumentError("invalid bytes width","type",e),function(t){return(0,b.lE)(t).length!==s&&nt.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=(0,b.lE)(e),n=t.length%32;return n?(0,b.xs)([t,rt.slice(n)]):(0,b.Dv)(t)}(t)}}switch(e){case"address":return function(e){return(0,b.$m)((0,ge.getAddress)(e),32)};case"bool":return function(e){return e?ut:ct};case"bytes":return function(e){return(0,O.w)(e)};case"string":return function(e){return(0,et.id)(e)}}return null}function vt(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var mt=function(){function e(t){(0,g.Z)(this,e),(0,k.zG)(this,"types",Object.freeze((0,k.p$)(t))),(0,k.zG)(this,"_encoderCache",{}),(0,k.zG)(this,"_types",{});var n={},r={},i={};Object.keys(t).forEach((function(e){n[e]={},r[e]=[],i[e]={}}));var o=function(e){var i={};t[e].forEach((function(o){i[o.name]&&nt.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&nt.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),ht(a)||(r[a]||nt.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),r[a].push(e),n[e][a]=!0)}))};for(var a in t)o(a);var s=Object.keys(r).filter((function(e){return 0===r[e].length}));for(var u in 0===s.length?nt.throwArgumentError("missing primary type","types",t):s.length>1&&nt.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),(0,k.zG)(this,"primaryType",s[0]),function e(o,a){a[o]&&nt.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(n[o]).forEach((function(t){r[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var c=Object.keys(i[u]);c.sort(),this._types[u]=vt(u,t[u])+c.map((function(e){return vt(e,t[e])})).join("")}}return(0,y.Z)(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,n=ht(e);if(n)return n;var r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){var i=r[1],o=this.getEncoder(i),a=parseInt(r[3]);return function(e){a>=0&&e.length!==a&&nt.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var n=e.map(o);return t._types[i]&&(n=n.map(O.w)),(0,O.w)((0,b.xs)(n))}}var s=this.types[e];if(s){var u=(0,et.id)(this._types[e]);return function(e){var n=s.map((function(n){var r=n.name,i=n.type,o=t.getEncoder(i)(e[r]);return t._types[i]?(0,O.w)(o):o}));return n.unshift(u),(0,b.xs)(n)}}return nt.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||nt.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return(0,O.w)(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,n){var r=this;if(ht(e))return n(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&t.length!==a&&nt.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return r._visit(o,e,n)}))}var s=this.types[e];return s?s.reduce((function(e,i){var o=i.name,a=i.type;return e[o]=r._visit(a,t[o],n),e}),{}):nt.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,n,r){return e.from(n).hashStruct(t,r)}},{key:"hashDomain",value:function(t){var n=[];for(var r in t){var i=lt[r];i||nt.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(r)),"domain",t),n.push({name:r,type:i})}return n.sort((function(e,t){return ft.indexOf(e.name)-ft.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:n},t)}},{key:"encode",value:function(t,n,r){return(0,b.xs)(["0x1901",e.hashDomain(t),e.from(n).hash(r)])}},{key:"hash",value:function(t,n,r){return(0,O.w)(e.encode(t,n,r))}},{key:"resolveNames",value:function(t,n,r,i){return tt(this,void 0,void 0,(0,m.Z)().mark((function o(){var a,s,u;return(0,m.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=(0,k.DC)(t),a={},t.verifyingContract&&!(0,b.A7)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x"),(s=e.from(n)).visit(r,(function(e,t){return"address"!==e||(0,b.A7)(t,20)||(a[t]="0x"),t})),o.t0=(0,m.Z)().keys(a);case 6:if((o.t1=o.t0()).done){o.next=13;break}return u=o.t1.value,o.next=10,i(u);case 10:a[u]=o.sent,o.next=6;break;case 13:return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),r=s.visit(r,(function(e,t){return"address"===e&&a[t]?a[t]:t})),o.abrupt("return",{domain:t,value:r});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,n,r){e.hashDomain(t);var i={},o=[];ft.forEach((function(e){var n=t[e];null!=n&&(i[e]=pt[e](n),o.push({name:e,type:lt[e]}))}));var a=e.from(n),s=(0,k.DC)(n);return s.EIP712Domain?nt.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",n):s.EIP712Domain=o,a.encode(r),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(r,(function(e,t){if(e.match(/^bytes(\d*)/))return(0,b.Dv)((0,b.lE)(t));if(e.match(/^u?int/))return A.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&nt.throwArgumentError("invalid string","value",t),t}return nt.throwArgumentError("unsupported type","type",e)}))}}}]),e}(),gt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},yt=new i.Yd(me),bt=["call","estimateGas"];function wt(e,t){if(null==e)return null;if("string"===typeof e.message&&e.message.match("reverted")){var n=(0,b.A7)(e.data)?e.data:null;if(!t||n)return{message:e.message,data:n}}if("object"===typeof e){for(var r in e){var i=wt(e[r],t);if(i)return i}return null}if("string"===typeof e)try{return wt(JSON.parse(e),t)}catch(o){}return null}function xt(e,t,n){var r=n.transaction||n.signedTransaction;if("call"===e){var o=wt(t,!0);if(o)return o.data;yt.throwError("missing revert data in call exception; Transaction reverted without a reason string",i.Yd.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:t})}if("estimateGas"===e){var a=wt(t.body,!1);null==a&&(a=wt(t,!1)),a&&yt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{reason:a.message,method:e,transaction:r,error:t})}var s=t.message;throw t.code===i.Yd.errors.SERVER_ERROR&&t.error&&"string"===typeof t.error.message?s=t.error.message:"string"===typeof t.body?s=t.body:"string"===typeof t.responseText&&(s=t.responseText),(s=(s||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&yt.throwError("insufficient funds for intrinsic transaction cost",i.Yd.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),s.match(/nonce (is )?too low/i)&&yt.throwError("nonce has already been used",i.Yd.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),s.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&yt.throwError("replacement fee too low",i.Yd.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),s.match(/only replay-protected/i)&&yt.throwError("legacy pre-eip-155 transactions not supported",i.Yd.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:r}),bt.indexOf(e)>=0&&s.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&yt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}function kt(e){return new Promise((function(t){setTimeout(t,e)}))}function _t(e){if(e.error){var t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Et(e){return e?e.toLowerCase():e}var At={},St=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r,i){var o;if((0,g.Z)(this,n),o=t.call(this),e!==At)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return(0,k.zG)((0,p.Z)(o),"provider",r),null==i&&(i=0),"string"===typeof i?((0,k.zG)((0,p.Z)(o),"_address",o.provider.formatter.address(i)),(0,k.zG)((0,p.Z)(o),"_index",null)):"number"===typeof i?((0,k.zG)((0,p.Z)(o),"_index",i),(0,k.zG)((0,p.Z)(o),"_address",null)):yt.throwArgumentError("invalid address or index","addressOrIndex",i),o}return(0,y.Z)(n,[{key:"connect",value:function(e){return yt.throwError("cannot alter JSON-RPC Signer connection",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new Ot(At,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&yt.throwError("unknown account #"+e._index,i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=(0,k.DC)(e);var n=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var r=(0,k.DC)(e);r.from=n,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return gt(t,void 0,void 0,(0,m.Z)().mark((function t(){var n;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.provider.resolveName(e);case 4:return null==(n=t.sent)&&yt.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t,this)})))}))),(0,k.mE)({tx:(0,k.mE)(e),sender:n}).then((function(n){var r=n.tx,o=n.sender;null!=r.from?r.from.toLowerCase()!==o&&yt.throwArgumentError("from address mismatch","transaction",e):r.from=o;var a=t.provider.constructor.hexlifyTransaction(r,{from:!0});return t.provider.send("eth_sendTransaction",[a]).then((function(e){return e}),(function(e){return"string"===typeof e.message&&e.message.match(/user denied/i)&&yt.throwError("user rejected transaction",i.Yd.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),xt("sendTransaction",e,a)}))}))}},{key:"signTransaction",value:function(e){return yt.throwError("signing transactions is unsupported",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return gt(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r,i=this;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return n=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return r=t.sent,t.prev=6,t.next=9,pe((function(){return gt(i,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(r);case 2:if(null!==(t=e.sent)){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.abrupt("return",this.provider._wrapTransaction(t,r,n));case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider});case 9:return t.abrupt("return",t.sent);case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=r,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return gt(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="string"===typeof e?(0,S.Y0)(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[(0,b.Dv)(n),r.toLowerCase()]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&yt.throwError("user rejected signing",i.Yd.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(e){return gt(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="string"===typeof e?(0,S.Y0)(e):e,t.next=3,this.getAddress();case 3:return r=t.sent,t.prev=4,t.next=7,this.provider.send("eth_sign",[r.toLowerCase(),(0,b.Dv)(n)]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&yt.throwError("user rejected signing",i.Yd.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_signTypedData",value:function(e,t,n){return gt(this,void 0,void 0,(0,m.Z)().mark((function r(){var o,a,s=this;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,mt.resolveNames(e,t,n,(function(e){return s.provider.resolveName(e)}));case 2:return o=r.sent,r.next=5,this.getAddress();case 5:return a=r.sent,r.prev=6,r.next=9,this.provider.send("eth_signTypedData_v4",[a.toLowerCase(),JSON.stringify(mt.getPayload(o.domain,t,o.value))]);case 9:return r.abrupt("return",r.sent);case 12:throw r.prev=12,r.t0=r.catch(6),"string"===typeof r.t0.message&&r.t0.message.match(/user denied/i)&&yt.throwError("user rejected signing",i.Yd.errors.ACTION_REJECTED,{action:"_signTypedData",from:a,messageData:{domain:o.domain,types:t,value:o.value}}),r.t0;case 16:case"end":return r.stop()}}),r,this,[[6,12]])})))}},{key:"unlock",value:function(e){return gt(this,void 0,void 0,(0,m.Z)().mark((function t(){var n,r;return(0,m.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.provider,t.next=3,this.getAddress();case 3:return r=t.sent,t.abrupt("return",n.send("personal_unlockAccount",[r.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),n}($e.E),Ot=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"sendTransaction",value:function(e){var t=this;return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(n){return t.provider.waitForTransaction(e,n)}}}))}}]),n}(St),Tt={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},Pt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var i;(0,g.Z)(this,n);var o=r;return null==o&&(o=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,o),e||(e=(0,k.tu)(i.constructor,"defaultUrl")()),"string"===typeof e?(0,k.zG)((0,p.Z)(i),"connection",Object.freeze({url:e})):(0,k.zG)((0,p.Z)(i),"connection",Object.freeze((0,k.DC)(e))),i._nextId=42,i}return(0,y.Z)(n,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return gt(this,void 0,void 0,(0,m.Z)().mark((function e(){var t,n;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,kt(0);case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]);case 6:t=e.sent,e.next=19;break;case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]);case 14:t=e.sent,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(11);case 19:if(null==t){e.next=28;break}return n=(0,k.tu)(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",n(A.O$.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",yt.throwError("could not detect network",i.Yd.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",yt.throwError("could not detect network",i.Yd.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new St(At,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this;return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var n=this,r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,k.p$)(r),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];var o=de(this.connection,JSON.stringify(r),_t).then((function(e){return n.emit("debug",{action:"response",request:r,response:e,provider:n}),e}),(function(e){throw n.emit("debug",{action:"response",error:e,request:r,provider:n}),e}));return i&&(this._cache[e]=o,setTimeout((function(){n._cache[e]=null}),0)),o}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Et(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Et(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Et(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Et(t.address),(0,b.$m)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,k.tu)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,k.tu)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Et(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return gt(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o,a;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("call"!==e&&"estimateGas"!==e){n.next=8;break}if(!(r=t.transaction)||null==r.type||!A.O$.from(r.type).isZero()){n.next=8;break}if(null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas){n.next=8;break}return n.next=6,this.getFeeData();case 6:null==(o=n.sent).maxFeePerGas&&null==o.maxPriorityFeePerGas&&((t=(0,k.DC)(t)).transaction=(0,k.DC)(r),delete t.transaction.type);case 8:return null==(a=this.prepareRequest(e,t))&&yt.throwError(e+" not implemented",i.Yd.errors.NOT_IMPLEMENTED,{operation:e}),n.prev=10,n.next=13,this.send(a[0],a[1]);case 13:return n.abrupt("return",n.sent);case 16:return n.prev=16,n.t0=n.catch(10),n.abrupt("return",xt(e,n.t0,t));case 19:case"end":return n.stop()}}),n,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),(0,Qe.Z)((0,Xe.Z)(n.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(n){return function r(){e.send("eth_getFilterChanges",[n]).then((function(n){if(e._pendingFilter!=t)return null;var r=Promise.resolve();return n.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",r=r.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),r.then((function(){return kt(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){r()}),0),null;e.send("eth_uninstallFilter",[n])})).catch((function(e){}))}(),n})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),(0,Qe.Z)((0,Xe.Z)(n.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var n=(0,k.DC)(Tt);if(t)for(var r in t)t[r]&&(n[r]=!0);(0,k.uj)(e,n);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var n=(0,b.$P)(A.O$.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=n}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=(0,b.Dv)(e[t]))})),e.accessList&&(i.accessList=(0,be.z7)(e.accessList)),i}}]),n}(Ke),Ct=null;try{if(null==(Ct=WebSocket))throw new Error("inject please")}catch(Bn){var It=new i.Yd(me);Ct=function(){It.throwError("WebSockets not supported in this environment",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Rt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},jt=new i.Yd(me),Nt=1,Mt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var o,a;(0,g.Z)(this,n),"any"===r&&jt.throwError("WebSocketProvider does not support 'any' network yet",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(a="string"===typeof e?t.call(this,e,r):t.call(this,"_websocket",r))._pollingInterval=-1,a._wsReady=!1,"string"===typeof e?(0,k.zG)((0,p.Z)(a),"_websocket",new Ct(a.connection.url)):(0,k.zG)((0,p.Z)(a),"_websocket",e),(0,k.zG)((0,p.Z)(a),"_requests",{}),(0,k.zG)((0,p.Z)(a),"_subs",{}),(0,k.zG)((0,p.Z)(a),"_subIds",{}),(0,k.zG)((0,p.Z)(a),"_detectNetwork",(0,Qe.Z)((o=(0,p.Z)(a),(0,Xe.Z)(n.prototype)),"detectNetwork",o).call(o)),a.websocket.onopen=function(){a._wsReady=!0,Object.keys(a._requests).forEach((function(e){a.websocket.send(a._requests[e].payload)}))},a.websocket.onmessage=function(e){var t=e.data,n=JSON.parse(t);if(null!=n.id){var r=String(n.id),i=a._requests[r];if(delete a._requests[r],void 0!==n.result)i.callback(null,n.result),a.emit("debug",{action:"response",request:JSON.parse(i.payload),response:n.result,provider:(0,p.Z)(a)});else{var o=null;n.error?(o=new Error(n.error.message||"unknown error"),(0,k.zG)(o,"code",n.error.code||null),(0,k.zG)(o,"response",t)):o=new Error("unknown error"),i.callback(o,void 0),a.emit("debug",{action:"response",error:o,request:JSON.parse(i.payload),provider:(0,p.Z)(a)})}}else if("eth_subscription"===n.method){var s=a._subs[n.params.subscription];s&&s.processFunc(n.params.result)}else console.warn("this should not happen")};var s=setInterval((function(){a.emit("poll")}),1e3);return s.unref&&s.unref(),(0,Je.Z)(a)}return(0,y.Z)(n,[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){jt.throwError("cannot set polling interval on WebSocketProvider",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){jt.throwError("cannot reset events block on WebSocketProvider",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return Rt(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})))}},{key:"polling",set:function(e){e&&jt.throwError("cannot set polling on WebSocketProvider",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var n=this,r=Nt++;return new Promise((function(i,o){var a=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});n.emit("debug",{action:"request",request:JSON.parse(a),provider:n}),n._requests[String(r)]={callback:function(e,t){return e?o(e):i(t)},payload:a},n._wsReady&&n.websocket.send(a)}))}},{key:"_subscribe",value:function(e,t,n){return Rt(this,void 0,void 0,(0,m.Z)().mark((function r(){var i,o,a=this;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==(i=this._subIds[e])&&(i=Promise.all(t).then((function(e){return a.send("eth_subscribe",e)})),this._subIds[e]=i),r.next=4,i;case 4:o=r.sent,this._subs[o]={tag:e,processFunc:n};case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_startEvent",value:function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],(function(e){var n=A.O$.from(e.number).toNumber();t._emitted.block=n,t.emit("block",n)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(e){t.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(function(n){null==n.removed&&(n.removed=!1),t.emit(e.filter,t.formatter.filterLog(n))}));break;case"tx":var n=function(e){var n=e.hash;t.getTransactionReceipt(n).then((function(e){e&&t.emit(n,e)}))};n(e),this._subscribe("tx",["newHeads"],(function(e){t._events.filter((function(e){return"tx"===e.type})).forEach(n)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}},{key:"_stopEvent",value:function(e){var t=this,n=e.tag;if("tx"===e.type){if(this._events.filter((function(e){return"tx"===e.type})).length)return;n="tx"}else if(this.listenerCount(e.event))return;var r=this._subIds[n];r&&(delete this._subIds[n],r.then((function(e){t._subs[e]&&(delete t._subs[e],t.send("eth_unsubscribe",[e]))})))}},{key:"destroy",value:function(){return Rt(this,void 0,void 0,(0,m.Z)().mark((function e(){var t=this;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.websocket.readyState!==Ct.CONNECTING){e.next=3;break}return e.next=3,new Promise((function(e){t.websocket.onopen=function(){e(!0)},t.websocket.onerror=function(){e(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return e.stop()}}),e,this)})))}}],[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}]),n}(Pt),Lt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Ut=new i.Yd(me),Dt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return(0,Qe.Z)((0,Xe.Z)(n.prototype),"detectNetwork",e)}}});return Lt(this,void 0,void 0,(0,m.Z)().mark((function e(){var n;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=this.network)){e.next=7;break}return e.next=4,t.detectNetwork.call(this);case 4:(n=e.sent)||Ut.throwError("no network detected",i.Yd.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,k.zG)(this,"_network",n),this.emit("network",n,null));case 7:return e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)})))}}]),n}(Pt),Bt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var i;(0,g.Z)(this,n),Ut.checkAbstract(this instanceof n?this.constructor:void 0,n),e=(0,k.tu)(this instanceof n?this.constructor:void 0,"getNetwork")(e),r=(0,k.tu)(this instanceof n?this.constructor:void 0,"getApiKey")(r);var o=(0,k.tu)(this instanceof n?this.constructor:void 0,"getUrl")(e,r);return i=t.call(this,o,e),"string"===typeof r?(0,k.zG)((0,p.Z)(i),"apiKey",r):null!=r&&Object.keys(r).forEach((function(e){(0,k.zG)((0,p.Z)(i),e,r[e])})),i}return(0,y.Z)(n,[{key:"_startPending",value:function(){Ut.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return Ut.throwError("API provider does not support signing",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(e){return e}},{key:"getUrl",value:function(e,t){return Ut.throwError("not implemented; sub-classes must override getUrl",i.Yd.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),n}(Dt),Ft=new i.Yd(me),Zt="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",zt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var i;(0,g.Z)(this,n);var o=new Ht(e,r),a=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return i=t.call(this,a,o.network),(0,k.zG)((0,p.Z)(i),"apiKey",o.apiKey),i}return(0,y.Z)(n,[{key:"isCommunityResource",value:function(){return this.apiKey===Zt}}]),n}(Mt),Ht=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"isCommunityResource",value:function(){return this.apiKey===Zt}}],[{key:"getWebSocketProvider",value:function(e,t){return new zt(e,t)}},{key:"getApiKey",value:function(e){return null==e?Zt:(e&&"string"!==typeof e&&Ft.throwArgumentError("invalid apiKey","apiKey",e),e)}},{key:"getUrl",value:function(e,t){var n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:Ft.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+t,throttleCallback:function(e,n){return t===Zt&&Ae(),Promise.resolve(!0)}}}}]),n}(Bt),qt=new i.Yd(me),Vt="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Wt(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return qt.throwArgumentError("unsupported network","name",e)}var Gt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"isCommunityResource",value:function(){return this.apiKey===Vt}}],[{key:"getApiKey",value:function(e){return null==e?Vt:e}},{key:"getUrl",value:function(e,t){null==t&&(t=Vt);var n={allowGzip:!0,url:"https://"+Wt(e.name)+t,throttleCallback:function(e,n){return t.apiKey===Vt&&Ae(),Promise.resolve(!0)}};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}}]),n}(Bt),Yt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Kt=new i.Yd(me),Jt=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(){return(0,g.Z)(this,n),t.apply(this,arguments)}return(0,y.Z)(n,[{key:"perform",value:function(e,t){var r=this,i=Object.create(null,{perform:{get:function(){return(0,Qe.Z)((0,Xe.Z)(n.prototype),"perform",r)}}});return Yt(this,void 0,void 0,(0,m.Z)().mark((function n(){var r;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("getBlockNumber"!==e){n.next=5;break}return n.next=3,i.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return r=n.sent,n.abrupt("return",r.number);case 5:return n.abrupt("return",i.perform.call(this,e,t));case 6:case"end":return n.stop()}}),n,this)})))}}],[{key:"getApiKey",value:function(e){return null!=e&&Kt.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var n=null;if("homestead"===e.name)n="https://cloudflare-eth.com/";else Kt.throwArgumentError("unsupported network","network",arguments[0]);return n}}]),n}(Bt),Qt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Xt=new i.Yd(me);function $t(e){var t={};for(var n in e)if(null!=e[n]){var r=e[n];"type"===n&&0===r||(r={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n]?(0,b.$P)((0,b.Dv)(r)):"accessList"===n?"["+(0,be.z7)(r).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":(0,b.Dv)(r),t[n]=r)}return t}function en(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!==typeof e.message||!e.message.match(/^OK/)){var t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function tn(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var n=new Error("invalid response");throw n.result=JSON.stringify(e),n}if(e.error){var r=new Error(e.error.message||"unknown error");throw e.error.code&&(r.code=e.error.code),e.error.data&&(r.data=e.error.data),r}return e.result}function nn(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function rn(e,t,n){if("call"===e&&t.code===i.Yd.errors.SERVER_ERROR){var r=t.error;if(r&&(r.message.match(/reverted/i)||r.message.match(/VM execution error/i))){var o=r.data;if(o&&(o="0x"+o.replace(/^.*0x/i,"")),(0,b.A7)(o))return o;Xt.throwError("missing revert data in call exception",i.Yd.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var a=t.message;throw t.code===i.Yd.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?a=t.error.message:"string"===typeof t.body?a=t.body:"string"===typeof t.responseText&&(a=t.responseText)),(a=(a||"").toLowerCase()).match(/insufficient funds/)&&Xt.throwError("insufficient funds for intrinsic transaction cost",i.Yd.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),a.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Xt.throwError("nonce has already been used",i.Yd.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),a.match(/another transaction with same nonce/)&&Xt.throwError("replacement fee too low",i.Yd.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),a.match(/execution failed due to an exception|execution reverted/)&&Xt.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}var on=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,r){var i;return(0,g.Z)(this,n),i=t.call(this,e),(0,k.zG)((0,p.Z)(i),"baseUrl",i.getBaseUrl()),(0,k.zG)((0,p.Z)(i),"apiKey",r||null),i}return(0,y.Z)(n,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return Xt.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(e,t){var n=Object.keys(t).reduce((function(e,n){var r=t[n];return null!=r&&(e+="&".concat(n,"=").concat(r)),e}),""),r=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(n).concat(r)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,n){return Qt(this,void 0,void 0,(0,m.Z)().mark((function r(){var i,o,a,s,u,c,l=this;return(0,m.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=n?this.getPostUrl():this.getUrl(e,t),o=n?this.getPostData(e,t):null,a="proxy"===e?tn:en,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return l.isCommunityResource()&&Ae(),Promise.resolve(!0)}},u=null,o&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},u=Object.keys(o).map((function(e){return"".concat(e,"=").concat(o[e])})).join("&")),r.next=9,de(s,u,a||tn);case 9:return c=r.sent,this.emit("debug",{action:"response",request:i,response:(0,k.p$)(c),provider:this}),r.abrupt("return",c);case 12:case"end":return r.stop()}}),r,this)})))}},{key:"detectNetwork",value:function(){return Qt(this,void 0,void 0,(0,m.Z)().mark((function e(){return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network);case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var r=this,o=Object.create(null,{perform:{get:function(){return(0,Qe.Z)((0,Xe.Z)(n.prototype),"perform",r)}}});return Qt(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,a,s,u,c,l,f,d,p;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=e,n.next="getBlockNumber"===n.t0?3:"getGasPrice"===n.t0?4:"getBalance"===n.t0?5:"getTransactionCount"===n.t0?6:"getCode"===n.t0?7:"getStorageAt"===n.t0?8:"sendTransaction"===n.t0?9:"getBlock"===n.t0?10:"getTransaction"===n.t0?13:"getTransactionReceipt"===n.t0?14:"call"===n.t0?15:"estimateGas"===n.t0?29:"getLogs"===n.t0?41:"getEtherPrice"===n.t0?65:72;break;case 3:return n.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return n.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return n.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return n.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return n.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return n.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return rn("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){n.next=12;break}return n.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return n.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){n.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(r=$t(t.transaction)).module="proxy",r.action="eth_call",n.prev=20,n.next=23,this.fetch("proxy",r,!0);case 23:return n.abrupt("return",n.sent);case 26:return n.prev=26,n.t1=n.catch(20),n.abrupt("return",rn("call",n.t1,t.transaction));case 29:return(a=$t(t.transaction)).module="proxy",a.action="eth_estimateGas",n.prev=32,n.next=35,this.fetch("proxy",a,!0);case 35:return n.abrupt("return",n.sent);case 38:return n.prev=38,n.t2=n.catch(32),n.abrupt("return",rn("estimateGas",n.t2,t.transaction));case 41:return s={action:"getLogs"},t.filter.fromBlock&&(s.fromBlock=nn(t.filter.fromBlock)),t.filter.toBlock&&(s.toBlock=nn(t.filter.toBlock)),t.filter.address&&(s.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Xt.throwError("unsupported topic count",i.Yd.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"===typeof(u=t.filter.topics[0])&&66===u.length||Xt.throwError("unsupported topic format",i.Yd.errors.UNSUPPORTED_OPERATION,{topic0:u}),s.topic0=u)),n.next=48,this.fetch("logs",s);case 48:c=n.sent,l={},f=0;case 51:if(!(f0;t--){var n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}var sn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},un=new i.Yd(me);function cn(){return(new Date).getTime()}function ln(e){for(var t=null,n=0;nt?null:(r+i)/2}function dn(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(A.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return dn(e)})));if("object"===typeof e){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var n=e[t];return n="function"===typeof n?"[function]":dn(n),JSON.stringify(t)+":"+n})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var pn=1;function hn(e){var t=null,n=null,r=new Promise((function(r){t=function(){n&&(clearTimeout(n),n=null),r()},n=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return r},wait:function(e){return r=r.then(e)}}}var vn=[i.Yd.errors.CALL_EXCEPTION,i.Yd.errors.INSUFFICIENT_FUNDS,i.Yd.errors.NONCE_EXPIRED,i.Yd.errors.REPLACEMENT_UNDERPRICED,i.Yd.errors.UNPREDICTABLE_GAS_LIMIT],mn=["address","args","errorArgs","errorSignature","method","transaction"];function gn(e,t){var n={weight:e.weight};return Object.defineProperty(n,"provider",{get:function(){return e.provider}}),e.start&&(n.start=e.start),t&&(n.duration=t-e.start),e.done&&(e.error?n.error=e.error:n.result=e.result||null),n}function yn(e,t,n){var r=dn;switch(t){case"getBlockNumber":return function(t){var n=t.map((function(e){return e.result})),r=fn(t.map((function(e){return e.result})),2);if(null!=r)return r=Math.ceil(r),n.indexOf(r+1)>=0&&r++,r>=e._highestBlockNumber&&(e._highestBlockNumber=r),e._highestBlockNumber};case"getGasPrice":return function(e){var t=e.map((function(e){return e.result}));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return fn(e.map((function(e){return e.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":r=function(e){return null==e?null:((e=(0,k.DC)(e)).confirmations=-1,dn(e))};break;case"getBlock":r=n.includeTransactions?function(e){return null==e?null:((e=(0,k.DC)(e)).transactions=e.transactions.map((function(e){return(e=(0,k.DC)(e)).confirmations=-1,e})),dn(e))}:function(e){return null==e?null:dn(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(n){var r={};n.forEach((function(t){var n=e(t.result);r[n]||(r[n]={count:0,result:t.result}),r[n].count++}));for(var i=Object.keys(r),o=0;o=t)return a.result}}}(r,e.quorum)}function bn(e,t){return sn(this,void 0,void 0,(0,m.Z)().mark((function n(){var r;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(null!=(r=e.provider).blockNumber&&r.blockNumber>=t||-1===t)){n.next=3;break}return n.abrupt("return",r);case 3:return n.abrupt("return",pe((function(){return new Promise((function(n,i){setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))}),{oncePoll:r}));case 4:case"end":return n.stop()}}),n)})))}function wn(e,t,n,r){return sn(this,void 0,void 0,(0,m.Z)().mark((function o(){var a,s;return(0,m.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:a=e.provider,o.t0=n,o.next="getBlockNumber"===o.t0||"getGasPrice"===o.t0?4:"getEtherPrice"===o.t0?5:"getBalance"===o.t0||"getTransactionCount"===o.t0||"getCode"===o.t0?8:"getStorageAt"===o.t0?13:"getBlock"===o.t0?18:"call"===o.t0||"estimateGas"===o.t0?23:"getTransaction"===o.t0||"getTransactionReceipt"===o.t0?30:"getLogs"===o.t0?31:37;break;case 4:return o.abrupt("return",a[n]());case 5:if(!a.getEtherPrice){o.next=7;break}return o.abrupt("return",a.getEtherPrice());case 7:return o.abrupt("break",37);case 8:if(!r.blockTag||!(0,b.A7)(r.blockTag)){o.next=12;break}return o.next=11,bn(e,t);case 11:a=o.sent;case 12:return o.abrupt("return",a[n](r.address,r.blockTag||"latest"));case 13:if(!r.blockTag||!(0,b.A7)(r.blockTag)){o.next=17;break}return o.next=16,bn(e,t);case 16:a=o.sent;case 17:return o.abrupt("return",a.getStorageAt(r.address,r.position,r.blockTag||"latest"));case 18:if(!r.blockTag||!(0,b.A7)(r.blockTag)){o.next=22;break}return o.next=21,bn(e,t);case 21:a=o.sent;case 22:return o.abrupt("return",a[r.includeTransactions?"getBlockWithTransactions":"getBlock"](r.blockTag||r.blockHash));case 23:if(!r.blockTag||!(0,b.A7)(r.blockTag)){o.next=27;break}return o.next=26,bn(e,t);case 26:a=o.sent;case 27:if("call"!==n||!r.blockTag){o.next=29;break}return o.abrupt("return",a[n](r.transaction,r.blockTag));case 29:return o.abrupt("return",a[n](r.transaction));case 30:return o.abrupt("return",a[n](r.transactionHash));case 31:if(!((s=r.filter).fromBlock&&(0,b.A7)(s.fromBlock)||s.toBlock&&(0,b.A7)(s.toBlock))){o.next=36;break}return o.next=35,bn(e,t);case 35:a=o.sent;case 36:return o.abrupt("return",a.getLogs(s));case 37:return o.abrupt("return",un.throwError("unknown method error",i.Yd.errors.UNKNOWN_ERROR,{method:n,params:r}));case 38:case"end":return o.stop()}}),o)})))}var xn=function(e){(0,h.Z)(n,e);var t=(0,v.Z)(n);function n(e,i){var o;(0,g.Z)(this,n),0===e.length&&un.throwArgumentError("missing providers","providers",e);var a=e.map((function(e,t){if(r.zt.isProvider(e)){var n=_e(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:n,priority:1})}var i=(0,k.DC)(e);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=_e(e)?2e3:750),null==i.weight&&(i.weight=1);var o=i.weight;return(o%1||o>512||o<1)&&un.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),o),Object.freeze(i)})),s=a.reduce((function(e,t){return e+t.weight}),0);null==i?i=s/2:i>s&&un.throwArgumentError("quorum will always fail; larger than total weight","quorum",i);var u=ln(a.map((function(e){return e.provider.network})));return null==u&&(u=new Promise((function(e,t){setTimeout((function(){o.detectNetwork().then(e,t)}),0)}))),o=t.call(this,u),(0,k.zG)((0,p.Z)(o),"providerConfigs",Object.freeze(a)),(0,k.zG)((0,p.Z)(o),"quorum",i),o._highestBlockNumber=-1,o}return(0,y.Z)(n,[{key:"detectNetwork",value:function(){return sn(this,void 0,void 0,(0,m.Z)().mark((function e(){var t;return(0,m.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",ln(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return sn(this,void 0,void 0,(0,m.Z)().mark((function n(){var r,o,a,s,u,c,l,f,d,p,h=this;return(0,m.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if("sendTransaction"!==e){n.next=13;break}return n.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))})));case 3:r=n.sent,o=0;case 5:if(!(o=h.quorum)){n.next=22;break}if(void 0===(p=s(d))){n.next=18;break}return u.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),n.abrupt("return",{v:p});case 18:if(f){n.next=21;break}return n.next=21,hn(100).getPromise();case 21:f=!1;case 22:if(v=u.reduce((function(e,t){if(!t.done||null==t.error)return e;var n=t.error.code;return vn.indexOf(n)>=0&&(e[n]||(e[n]={error:t.error,weight:0}),e[n].weight+=t.weight),e}),{}),Object.keys(v).forEach((function(e){var t=v[e];if(!(t.weight>=8;return t}function s(e,t,n){for(var r=0,i=0;it+1+r&&o.throwError("child data too short",i.Yd.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:a}}function f(e,t){if(0===e.length&&o.throwError("data too short",i.Yd.errors.BUFFER_OVERRUN,{}),e[t]>=248){var n=e[t]-247;t+1+n>e.length&&o.throwError("data short segment too short",i.Yd.errors.BUFFER_OVERRUN,{});var a=s(e,t+1,n);return t+1+n+a>e.length&&o.throwError("data long segment too short",i.Yd.errors.BUFFER_OVERRUN,{}),l(e,t,t+1+n,n+a)}if(e[t]>=192){var u=e[t]-192;return t+1+u>e.length&&o.throwError("data array too short",i.Yd.errors.BUFFER_OVERRUN,{}),l(e,t,t+1,u)}if(e[t]>=184){var c=e[t]-183;t+1+c>e.length&&o.throwError("data array too short",i.Yd.errors.BUFFER_OVERRUN,{});var f=s(e,t+1,c);return t+1+c+f>e.length&&o.throwError("data array too short",i.Yd.errors.BUFFER_OVERRUN,{}),{consumed:1+c+f,result:(0,r.Dv)(e.slice(t+1+c,t+1+c+f))}}if(e[t]>=128){var d=e[t]-128;return t+1+d>e.length&&o.throwError("data too short",i.Yd.errors.BUFFER_OVERRUN,{}),{consumed:1+d,result:(0,r.Dv)(e.slice(t+1,t+1+d))}}return{consumed:1,result:(0,r.Dv)(e[t])}}function d(e){var t=(0,r.lE)(e),n=f(t,0);return n.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),n.result}},83431:function(e,t,n){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(62808).Buffer}catch(T){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(T){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-u.length]+u+n:u+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=p[e],l=h[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?v+n:d[c-v.length]+v+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,d=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=d;p++){var h=c-p|0;l+=(a=(i=0|e.words[h])*(o=0|t.words[p])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,p=0|a[1],h=8191&p,v=p>>>13,m=0|a[2],g=8191&m,y=m>>>13,b=0|a[3],w=8191&b,x=b>>>13,k=0|a[4],_=8191&k,E=k>>>13,A=0|a[5],S=8191&A,O=A>>>13,T=0|a[6],P=8191&T,C=T>>>13,I=0|a[7],R=8191&I,j=I>>>13,N=0|a[8],M=8191&N,L=N>>>13,U=0|a[9],D=8191&U,B=U>>>13,F=0|s[0],Z=8191&F,z=F>>>13,H=0|s[1],q=8191&H,V=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,K=0|s[3],J=8191&K,Q=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,de=le>>>13,pe=0|s[9],he=8191&pe,ve=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(c+(r=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(d,Z)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,Z),i=(i=Math.imul(h,z))+Math.imul(v,Z)|0,o=Math.imul(v,z);var ge=(c+(r=r+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(d,q)|0))<<13)|0;c=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(g,Z),i=(i=Math.imul(g,z))+Math.imul(y,Z)|0,o=Math.imul(y,z),r=r+Math.imul(h,q)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,V)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,Z),i=(i=Math.imul(w,z))+Math.imul(x,Z)|0,o=Math.imul(x,z),r=r+Math.imul(g,q)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0,r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Y)|0;var be=(c+(r=r+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(_,Z),i=(i=Math.imul(_,z))+Math.imul(E,Z)|0,o=Math.imul(E,z),r=r+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,r=r+Math.imul(g,G)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Y)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Q)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Q)|0;var we=(c+(r=r+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,Z),i=(i=Math.imul(S,z))+Math.imul(O,Z)|0,o=Math.imul(O,z),r=r+Math.imul(_,q)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,V)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,r=r+Math.imul(g,J)|0,i=(i=i+Math.imul(g,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,r=r+Math.imul(h,$)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var xe=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(d,ne)|0))<<13)|0;c=((o=o+Math.imul(d,re)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(P,Z),i=(i=Math.imul(P,z))+Math.imul(C,Z)|0,o=Math.imul(C,z),r=r+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,Y)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(g,$)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(v,ne)|0,o=o+Math.imul(v,re)|0;var ke=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(R,Z),i=(i=Math.imul(R,z))+Math.imul(j,Z)|0,o=Math.imul(j,z),r=r+Math.imul(P,q)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Y)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Q)|0,r=r+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,r=r+Math.imul(g,ne)|0,i=(i=i+Math.imul(g,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(h,oe)|0,i=(i=i+Math.imul(h,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var _e=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(M,Z),i=(i=Math.imul(M,z))+Math.imul(L,Z)|0,o=Math.imul(L,z),r=r+Math.imul(R,q)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,V)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,r=r+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(x,ne)|0,o=o+Math.imul(x,re)|0,r=r+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Ee=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,de)|0)+Math.imul(d,fe)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,Z),i=(i=Math.imul(D,z))+Math.imul(B,Z)|0,o=Math.imul(B,z),r=r+Math.imul(M,q)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,Y)|0,r=r+Math.imul(P,J)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,Q)|0,r=r+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(_,ne)|0,i=(i=i+Math.imul(_,re)|0)+Math.imul(E,ne)|0,o=o+Math.imul(E,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,r=r+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(h,fe)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,de)|0;var Ae=(c+(r=r+Math.imul(f,he)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(d,he)|0))<<13)|0;c=((o=o+Math.imul(d,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(D,q),i=(i=Math.imul(D,V))+Math.imul(B,q)|0,o=Math.imul(B,V),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,ce)|0,r=r+Math.imul(g,fe)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,de)|0;var Se=(c+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(v,he)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(D,G),i=(i=Math.imul(D,Y))+Math.imul(B,G)|0,o=Math.imul(B,Y),r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,Q)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(C,ne)|0,o=o+Math.imul(C,re)|0,r=r+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,fe)|0,o=o+Math.imul(x,de)|0;var Oe=(c+(r=r+Math.imul(g,he)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(y,he)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(D,J),i=(i=Math.imul(D,Q))+Math.imul(B,J)|0,o=Math.imul(B,Q),r=r+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,i=(i=i+Math.imul(R,re)|0)+Math.imul(j,ne)|0,o=o+Math.imul(j,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,r=r+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,de)|0)+Math.imul(E,fe)|0,o=o+Math.imul(E,de)|0;var Te=(c+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(x,he)|0))<<13)|0;c=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(D,$),i=(i=Math.imul(D,ee))+Math.imul(B,$)|0,o=Math.imul(B,ee),r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,r=r+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,de)|0;var Pe=(c+(r=r+Math.imul(_,he)|0)|0)+((8191&(i=(i=i+Math.imul(_,ve)|0)+Math.imul(E,he)|0))<<13)|0;c=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(D,ne),i=(i=Math.imul(D,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(R,ue)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(C,fe)|0,o=o+Math.imul(C,de)|0;var Ce=(c+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,ve)|0)+Math.imul(O,he)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(R,fe)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,de)|0;var Ie=(c+(r=r+Math.imul(P,he)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(C,he)|0))<<13)|0;c=((o=o+Math.imul(C,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(D,ue),i=(i=Math.imul(D,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(M,fe)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,de)|0;var Re=(c+(r=r+Math.imul(R,he)|0)|0)+((8191&(i=(i=i+Math.imul(R,ve)|0)+Math.imul(j,he)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(D,fe),i=(i=Math.imul(D,de))+Math.imul(B,fe)|0,o=Math.imul(B,de);var je=(c+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(L,he)|0))<<13)|0;c=((o=o+Math.imul(L,ve)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863;var Ne=(c+(r=Math.imul(D,he))|0)+((8191&(i=(i=Math.imul(D,ve))+Math.imul(B,he)|0))<<13)|0;return c=((o=Math.imul(B,ve))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ye,u[3]=be,u[4]=we,u[5]=xe,u[6]=ke,u[7]=_e,u[8]=Ee,u[9]=Ae,u[10]=Se,u[11]=Oe,u[12]=Te,u[13]=Pe,u[14]=Ce,u[15]=Ie,u[16]=Re,u[17]=je,u[18]=Ne,0!==c&&(u[19]=c,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(e,t,n){return g(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(m=v),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?v(this,e,t):n<1024?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},b.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var d=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,f);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var d=0,p=1;0===(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var h=0,v=1;0===(n.words[0]&v)&&h<26;++h,v<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,d=1;0===(n.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},i(k,x),k.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},S.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),p=this.pow(e,i),h=a;0!==p.cmp(s);){for(var v=p,m=0;0!==v.cmp(s);m++)v=v.redSqr();r(m=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,S),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=n.nmd(e),this)},91953:function(e,t,n){"use strict";n.d(t,{Y0:function(){return l},XL:function(){return d},ZN:function(){return f}});var r,i,o=n(52009),a=new(n(2735).Yd)("strings/5.7.0");function s(e,t,n,r,o){if(e===i.BAD_PREFIX||e===i.UNEXPECTED_CONTINUE){for(var a=0,s=t+1;s>6===2;s++)a++;return a}return e===i.OVERRUN?n.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(r||(r={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(i||(i={}));var u=Object.freeze({error:function(e,t,n,r,i){return a.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",n)},ignore:s,replace:function(e,t,n,r,o){return e===i.OVERLONG?(r.push(o),0):(r.push(65533),s(e,t,n))}});function c(e,t){null==t&&(t=u.error),e=(0,o.lE)(e);for(var n=[],r=0;r>7!==0){var s=null,c=null;if(192===(224&a))s=1,c=127;else if(224===(240&a))s=2,c=2047;else{if(240!==(248&a)){r+=t(128===(192&a)?i.UNEXPECTED_CONTINUE:i.BAD_PREFIX,r-1,e,n);continue}s=3,c=65535}if(r-1+s>=e.length)r+=t(i.OVERRUN,r-1,e,n);else{for(var l=a&(1<<8-s-1)-1,f=0;f1114111?r+=t(i.OUT_OF_RANGE,r-1-s,e,n,l):l>=55296&&l<=57343?r+=t(i.UTF16_SURROGATE,r-1-s,e,n,l):l<=c?r+=t(i.OVERLONG,r-1-s,e,n,l):n.push(l))}}else n.push(a)}return n}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current;t!=r.current&&(a.checkNormalize(),e=e.normalize(t));for(var n=[],i=0;i>6|192),n.push(63&s|128);else if(55296==(64512&s)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!==(64512&u))throw new Error("invalid utf-8 string");var c=65536+((1023&s)<<10)+(1023&u);n.push(c>>18|240),n.push(c>>12&63|128),n.push(c>>6&63|128),n.push(63&c|128)}else n.push(s>>12|224),n.push(s>>6&63|128),n.push(63&s|128)}return(0,o.lE)(n)}function f(e,t){return c(e,t).map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function d(e){return c(l(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.current))}},14046:function(e,t,n){"use strict";n.d(t,{z7:function(){return fe},Qc:function(){return me}});var r=n(28552),i=n(19560),o=n(52009),a=n(6321),s=n(11291),u=n(80807),c=n(15671),l=n(43144),f=n(83431),d=n.n(f),p=n(37553),h=n.n(p);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self&&self;function v(e,t,n){return n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&n.path)}},e(n,n.exports),n.exports}var m=g;function g(e,t){if(!e)throw new Error(t||"Assertion failed")}g.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)};var y=v((function(e,t){var n=t;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",n=0;n>8,a=255&i;o?n.push(o,a):n.push(a)}return n},n.zero2=r,n.toHex=i,n.encode=function(e,t){return"hex"===t?i(e):e}})),b=v((function(e,t){var n=t;n.assert=m,n.toArray=y.toArray,n.zero2=y.zero2,n.toHex=y.toHex,n.encode=y.encode,n.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},n.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[0].push(a),s=0===(1&c)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},n.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},n.parseBytes=function(e){return"string"===typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new(d())(e,"hex","le")}})),w=b.getNAF,x=b.getJSF,k=b.assert;function _(e,t){this.type=e,this.p=new(d())(t.p,16),this.red=t.prime?d().red(t.prime):d().mont(this.p),this.zero=new(d())(0).toRed(this.red),this.one=new(d())(1).toRed(this.red),this.two=new(d())(2).toRed(this.red),this.n=t.n&&new(d())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var E=_;function A(e,t){this.curve=e,this.type=t,this.precomputed=null}_.prototype.point=function(){throw new Error("Not implemented")},_.prototype.validate=function(){throw new Error("Not implemented")},_.prototype._fixedNafMul=function(e,t){k(e.precomputed);var n=e._getDoubles(),r=w(t,1,this._bitLength),i=(1<=o;u--)a=(a<<1)+r[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];k(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},_.prototype._wnafMulAdd=function(e,t,n,r,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(o=0;o=1;o-=2){var p=o-1,h=o;if(1===u[p]&&1===u[h]){var v=[t[p],null,null,t[h]];0===t[p].y.cmp(t[h].y)?(v[1]=t[p].add(t[h]),v[2]=t[p].toJ().mixedAdd(t[h].neg())):0===t[p].y.cmp(t[h].y.redNeg())?(v[1]=t[p].toJ().mixedAdd(t[h]),v[2]=t[p].add(t[h].neg())):(v[1]=t[p].toJ().mixedAdd(t[h]),v[2]=t[p].toJ().mixedAdd(t[h].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=x(n[p],n[h]);for(f=Math.max(g[0].length,f),l[p]=new Array(f),l[h]=new Array(f),a=0;a=0;o--){for(var E=0;o>=0;){var A=!0;for(a=0;a=0&&E++,k=k.dblp(E),o<0)break;for(a=0;a0?s=c[a][S-1>>1]:S<0&&(s=c[a][-S-1>>1].neg()),k="affine"===s.type?k.mixedAdd(s):k.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},A.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i=0&&(o=t,a=n),r.negative&&(r=r.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:r,b:i},{a:o,b:a}]},T.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=i.mul(n.a),s=o.mul(r.a),u=i.mul(n.b),c=o.mul(r.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},T.prototype.pointFromX=function(e,t){(e=new(d())(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},T.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(i).cmpn(0)},T.prototype._endoWnafMulAdd=function(e,t,n){for(var r=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},C.prototype.isInfinity=function(){return this.inf},C.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},C.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),r=e.redInvm(),i=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(r),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},C.prototype.getX=function(){return this.x.fromRed()},C.prototype.getY=function(){return this.y.fromRed()},C.prototype.mul=function(e){return e=new(d())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},C.prototype.mulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i):this.curve._wnafMulAdd(1,r,i,2)},C.prototype.jmulAdd=function(e,t,n){var r=[this,t],i=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,i,!0):this.curve._wnafMulAdd(1,r,i,2,!0)},C.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},C.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return t},C.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},S(I,E.BasePoint),T.prototype.jpoint=function(e,t,n){return new I(this,e,t,n)},I.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(n,r)},I.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},I.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(t),i=e.x.redMul(n),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),s=r.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=r.redMul(c),d=u.redSqr().redIAdd(l).redISub(f).redISub(f),p=u.redMul(f.redISub(d)).redISub(o.redMul(l)),h=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,p,h)},I.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,r=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=n.redSub(r),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=n.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),d=s.redMul(l.redISub(f)).redISub(i.redMul(c)),p=this.z.redMul(a);return this.curve.jpoint(f,d,p)},I.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(i),0===this.x.cmp(n))return!0}},I.prototype.inspect=function(){return this.isInfinity()?"":""},I.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var R=v((function(e,t){var n=t;n.base=E,n.short=P,n.mont=null,n.edwards=null})),j=v((function(e,t){var n,r=t,i=b.assert;function o(e){"short"===e.type?this.curve=new R.short(e):"edwards"===e.type?this.curve=new R.edwards(e):this.curve=new R.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new o(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:h().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:h().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:h().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:h().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:h().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:h().sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:h().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=null.crash()}catch(s){n=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:h().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})}));function N(e){if(!(this instanceof N))return new N(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=y.toArray(e.entropy,e.entropyEnc||"hex"),n=y.toArray(e.nonce,e.nonceEnc||"hex"),r=y.toArray(e.pers,e.persEnc||"hex");m(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,r)}var M=N;N.prototype._init=function(e,t,n){var r=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},N.prototype.generate=function(e,t,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=n,n=t,t=null),n&&(n=y.toArray(n,r||"hex"),this._update(n));for(var i=[];i.length"};var B=b.assert;function F(e,t){if(e instanceof F)return e;this._importDER(e,t)||(B(e.r&&e.s,"Signature without r or s"),this.r=new(d())(e.r,16),this.s=new(d())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Z=F;function z(){this.place=0}function H(e,t){var n=e[t.place++];if(!(128&n))return n;var r=15&n;if(0===r||r>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function q(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}F.prototype._importDER=function(e,t){e=b.toArray(e,t);var n=new z;if(48!==e[n.place++])return!1;var r=H(e,n);if(!1===r)return!1;if(r+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var i=H(e,n);if(!1===i)return!1;var o=e.slice(n.place,i+n.place);if(n.place+=i,2!==e[n.place++])return!1;var a=H(e,n);if(!1===a)return!1;if(e.length!==a+n.place)return!1;var s=e.slice(n.place,a+n.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(d())(o),this.s=new(d())(s),this.recoveryParam=null,!0},F.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=q(t),n=q(n);!n[0]&&!(128&n[1]);)n=n.slice(1);var r=[2];V(r,t.length),(r=r.concat(t)).push(2),V(r,n.length);var i=r.concat(n),o=[48];return V(o,i.length),o=o.concat(i),b.encode(o,e)};var W=function(){throw new Error("unsupported")},G=b.assert;function Y(e){if(!(this instanceof Y))return new Y(e);"string"===typeof e&&(G(Object.prototype.hasOwnProperty.call(j,e),"Unknown curve "+e),e=j[e]),e instanceof j.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var K=Y;Y.prototype.keyPair=function(e){return new D(this,e)},Y.prototype.keyFromPrivate=function(e,t){return D.fromPrivate(this,e,t)},Y.prototype.keyFromPublic=function(e,t){return D.fromPublic(this,e,t)},Y.prototype.genKeyPair=function(e){e||(e={});for(var t=new M({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||W(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new(d())(2));;){var i=new(d())(t.generate(n));if(!(i.cmp(r)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Y.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Y.prototype.sign=function(e,t,n,r){"object"===typeof n&&(r=n,n=null),r||(r={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new(d())(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new M({hash:this.hash,entropy:o,nonce:a,pers:r.pers,persEnc:r.persEnc||"utf8"}),u=this.n.sub(new(d())(1)),c=0;;c++){var l=r.k?r.k(c):new(d())(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var f=this.g.mul(l);if(!f.isInfinity()){var p=f.getX(),h=p.umod(this.n);if(0!==h.cmpn(0)){var v=l.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var m=(f.getY().isOdd()?1:0)|(0!==p.cmp(h)?2:0);return r.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),m^=1),new Z({r:h,s:v,recoveryParam:m})}}}}}},Y.prototype.verify=function(e,t,n,r){e=this._truncateToN(new(d())(e,16)),n=this.keyFromPublic(n,r);var i=(t=new Z(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),c)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,n.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Y.prototype.recoverPubKey=function(e,t,n,r){G((3&n)===n,"The recovery param is more than two bits"),t=new Z(t,r);var i=this.n,o=new(d())(e),a=t.r,s=t.s,u=1&n,c=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(i),f=i.sub(o).mul(l).umod(i),p=s.mul(l).umod(i);return this.g.mulAdd(f,a,p)},Y.prototype.getKeyRecoveryParam=function(e,t,n,r){if(null!==(t=new Z(t,r)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(n))return i}throw new Error("Unable to find valid recovery factor")};var J=v((function(e,t){var n=t;n.version="6.5.4",n.utils=b,n.rand=function(){throw new Error("unsupported")},n.curve=R,n.curves=j,n.ec=K,n.eddsa=null})).ec,Q=n(54812),X=n(2735),$=new X.Yd("signing-key/5.7.0"),ee=null;function te(){return ee||(ee=new J("secp256k1")),ee}var ne=function(){function e(t){(0,c.Z)(this,e),(0,Q.zG)(this,"curve","secp256k1"),(0,Q.zG)(this,"privateKey",(0,o.Dv)(t)),32!==(0,o.E1)(this.privateKey)&&$.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var n=te().keyFromPrivate((0,o.lE)(this.privateKey));(0,Q.zG)(this,"publicKey","0x"+n.getPublic(!1,"hex")),(0,Q.zG)(this,"compressedPublicKey","0x"+n.getPublic(!0,"hex")),(0,Q.zG)(this,"_isSigningKey",!0)}return(0,l.Z)(e,[{key:"_addPoint",value:function(e){var t=te().keyFromPublic((0,o.lE)(this.publicKey)),n=te().keyFromPublic((0,o.lE)(e));return"0x"+t.pub.add(n.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=te().keyFromPrivate((0,o.lE)(this.privateKey)),n=(0,o.lE)(e);32!==n.length&&$.throwArgumentError("bad digest length","digest",e);var r=t.sign(n,{canonical:!0});return(0,o.N)({recoveryParam:r.recoveryParam,r:(0,o.$m)("0x"+r.r.toString(16),32),s:(0,o.$m)("0x"+r.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=te().keyFromPrivate((0,o.lE)(this.privateKey)),n=te().keyFromPublic((0,o.lE)(re(e)));return(0,o.$m)("0x"+t.derive(n.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function re(e,t){var n=(0,o.lE)(e);if(32===n.length){var r=new ne(n);return t?"0x"+te().keyFromPrivate(n).getPublic(!0,"hex"):r.publicKey}return 33===n.length?t?(0,o.Dv)(n):"0x"+te().keyFromPublic(n).getPublic(!1,"hex"):65===n.length?t?"0x"+te().keyFromPublic(n).getPublic(!0,"hex"):(0,o.Dv)(n):$.throwArgumentError("invalid public or private key","key","[REDACTED]")}var ie,oe=new X.Yd("transactions/5.7.0");function ae(e){return"0x"===e?null:(0,r.getAddress)(e)}function se(e){return"0x"===e?a._Y:i.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(ie||(ie={}));function ue(e,t){return function(e){var t=re(e);return(0,r.getAddress)((0,o.p3)((0,s.w)((0,o.p3)(t,1)),12))}(function(e,t){var n=(0,o.N)(t),r={r:(0,o.lE)(n.r),s:(0,o.lE)(n.s)};return"0x"+te().recoverPubKey((0,o.lE)(e),r,n.recoveryParam).encode("hex",!1)}((0,o.lE)(e),t))}function ce(e,t){var n=(0,o.G1)(i.O$.from(e).toHexString());return n.length>32&&oe.throwArgumentError("invalid length for "+t,"transaction:"+t,e),n}function le(e,t){return{address:(0,r.getAddress)(e),storageKeys:(t||[]).map((function(t,n){return 32!==(0,o.E1)(t)&&oe.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(n,"]"),t),t.toLowerCase()}))}}function fe(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&oe.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),le(e[0],e[1])):le(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var n=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return le(t,Object.keys(n).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function de(e){return fe(e).map((function(e){return[e.address,e.storageKeys]}))}function pe(e,t){if(null!=e.gasPrice){var n=i.O$.from(e.gasPrice),a=i.O$.from(e.maxFeePerGas||0);n.eq(a)||oe.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:a})}var s=[ce(e.chainId||0,"chainId"),ce(e.nonce||0,"nonce"),ce(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ce(e.maxFeePerGas||0,"maxFeePerGas"),ce(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.getAddress)(e.to):"0x",ce(e.value||0,"value"),e.data||"0x",de(e.accessList||[])];if(t){var c=(0,o.N)(t);s.push(ce(c.recoveryParam,"recoveryParam")),s.push((0,o.G1)(c.r)),s.push((0,o.G1)(c.s))}return(0,o.xs)(["0x02",u.c(s)])}function he(e,t){var n=[ce(e.chainId||0,"chainId"),ce(e.nonce||0,"nonce"),ce(e.gasPrice||0,"gasPrice"),ce(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.getAddress)(e.to):"0x",ce(e.value||0,"value"),e.data||"0x",de(e.accessList||[])];if(t){var i=(0,o.N)(t);n.push(ce(i.recoveryParam,"recoveryParam")),n.push((0,o.G1)(i.r)),n.push((0,o.G1)(i.s))}return(0,o.xs)(["0x01",u.c(n)])}function ve(e,t,n){try{var r=se(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(a){oe.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,o.$m)(t[1],32),e.s=(0,o.$m)(t[2],32);try{var i=(0,s.w)(n(e));e.from=ue(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(a){}}function me(e){var t=(0,o.lE)(e);if(t[0]>127)return function(e){var t=u.J(e);9!==t.length&&6!==t.length&&oe.throwArgumentError("invalid raw transaction","rawTransaction",e);var n={nonce:se(t[0]).toNumber(),gasPrice:se(t[1]),gasLimit:se(t[2]),to:ae(t[3]),value:se(t[4]),data:t[5],chainId:0};if(6===t.length)return n;try{n.v=i.O$.from(t[6]).toNumber()}catch(l){return n}if(n.r=(0,o.$m)(t[7],32),n.s=(0,o.$m)(t[8],32),i.O$.from(n.r).isZero()&&i.O$.from(n.s).isZero())n.chainId=n.v,n.v=0;else{n.chainId=Math.floor((n.v-35)/2),n.chainId<0&&(n.chainId=0);var r=n.v-27,a=t.slice(0,6);0!==n.chainId&&(a.push((0,o.Dv)(n.chainId)),a.push("0x"),a.push("0x"),r-=2*n.chainId+8);var c=(0,s.w)(u.c(a));try{n.from=ue(c,{r:(0,o.Dv)(n.r),s:(0,o.Dv)(n.s),recoveryParam:r})}catch(l){}n.hash=(0,s.w)(e)}return n.type=null,n}(t);switch(t[0]){case 1:return function(e){var t=u.J(e.slice(1));8!==t.length&&11!==t.length&&oe.throwArgumentError("invalid component count for transaction type: 1","payload",(0,o.Dv)(e));var n={type:1,chainId:se(t[0]).toNumber(),nonce:se(t[1]).toNumber(),gasPrice:se(t[2]),gasLimit:se(t[3]),to:ae(t[4]),value:se(t[5]),data:t[6],accessList:fe(t[7])};return 8===t.length||(n.hash=(0,s.w)(e),ve(n,t.slice(8),he)),n}(t);case 2:return function(e){var t=u.J(e.slice(1));9!==t.length&&12!==t.length&&oe.throwArgumentError("invalid component count for transaction type: 2","payload",(0,o.Dv)(e));var n=se(t[2]),r=se(t[3]),i={type:2,chainId:se(t[0]).toNumber(),nonce:se(t[1]).toNumber(),maxPriorityFeePerGas:n,maxFeePerGas:r,gasPrice:null,gasLimit:se(t[4]),to:ae(t[5]),value:se(t[6]),data:t[7],accessList:fe(t[8])};return 9===t.length||(i.hash=(0,s.w)(e),ve(i,t.slice(9),pe)),i}(t)}return oe.throwError("unsupported transaction type: ".concat(t[0]),X.Yd.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},63811:function(e){"use strict";e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mustBeMetaMask,n=void 0!==t&&t,r=e.silent,i=void 0!==r&&r,o=e.timeout,a=void 0===o?3e3:o;!function(){if("boolean"!==typeof n)throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if("boolean"!==typeof i)throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if("number"!==typeof a)throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}();var s=!1;return new Promise((function(e){function t(){if(!s){s=!0,window.removeEventListener("ethereum#initialized",t);var r=window.ethereum;if(!r||n&&!r.isMetaMask){var o=n&&r?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum.";!i&&console.error("@metamask/detect-provider:",o),e(null)}else e(r)}}window.ethereum?t():(window.addEventListener("ethereum#initialized",t,{once:!0}),setTimeout((function(){t()}),a))}))}},4609:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,o=n(61655).default,a=n(26389).default;function s(e,t,n){try{Reflect.apply(e,t,n)}catch(r){setTimeout((function(){throw r}))}}Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){o(n,e);var t=a(n);function n(){return r(this,n),t.apply(this,arguments)}return i(n,[{key:"emit",value:function(e){var t="error"===e,n=this._events;if(void 0!==n)t=t&&void 0===n.error;else if(!t)return!1;for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o0&&(a=i[0]),a instanceof Error)throw a;var u=new Error("Unhandled error.".concat(a?" (".concat(a.message,")"):""));throw u.context=a,u}var c=n[e];if(void 0===c)return!1;if("function"===typeof c)s(c,this,i);else for(var l=c.length,f=function(e){for(var t=e.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:"Assertion failed.";if(!e){if(t instanceof Error)throw t;throw c(arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,t)}},t.assertStruct=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Assertion failed",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l;try{(0,u.assert)(e,t)}catch(i){throw c(r,"".concat(n,": ").concat(function(e){var t=function(e){return"object"===typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(i),"."))}},t.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},12802:function(e,t,n){"use strict";var r,i,o=n(59400).default;Object.defineProperty(t,"__esModule",{value:!0}),t.base64=void 0;var a=n(62746),s=n(35517);t.base64=function(e){var t,n,u,c,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=null!==(t=l.paddingRequired)&&void 0!==t&&t,d=null!==(n=l.characterSet)&&void 0!==n?n:"base64";return"base64"===d?u=String.raw(r||(r=o(["[A-Za-z0-9+/]"],["[A-Za-z0-9+\\/]"]))):((0,s.assert)("base64url"===d),u=String.raw(i||(i=o(["[-_A-Za-z0-9]"])))),c=f?new RegExp("^(?:".concat(u,"{4})*(?:").concat(u,"{3}=|").concat(u,"{2}==)?$"),"u"):new RegExp("^(?:".concat(u,"{4})*(?:").concat(u,"{2,3}|").concat(u,"{3}=|").concat(u,"{2}==)?$"),"u"),(0,a.pattern)(e,c)}},53310:function(e,t,n){"use strict";var r=n(74704).default;Object.defineProperty(t,"__esModule",{value:!0}),t.createDataView=t.concatBytes=t.valueToBytes=t.stringToBytes=t.numberToBytes=t.signedBigIntToBytes=t.bigIntToBytes=t.hexToBytes=t.bytesToString=t.bytesToNumber=t.bytesToSignedBigInt=t.bytesToBigInt=t.bytesToHex=t.assertIsBytes=t.isBytes=void 0;var i=n(35517),o=n(26135),a=48,s=58,u=87;var c=function(){var e=[];return function(){if(0===e.length)for(var t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function l(e){return e instanceof Uint8Array}function f(e){(0,i.assert)(l(e),"Value must be a Uint8Array.")}function d(e){if(f(e),0===e.length)return"0x";for(var t=c(),n=new Array(e.length),r=0;r=BigInt(0),"Value must be a non-negative bigint."),h(e.toString(16))}function m(e){return(0,i.assert)("number"===typeof e,"Value must be a number."),(0,i.assert)(e>=0,"Value must be a non-negative number."),(0,i.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),h(e.toString(16))}function g(e){return(0,i.assert)("string"===typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function y(e){if("bigint"===typeof e)return v(e);if("number"===typeof e)return m(e);if("string"===typeof e)return e.startsWith("0x")?h(e):g(e);if(l(e))return e;throw new TypeError('Unsupported value type: "'.concat(typeof e,'".'))}t.isBytes=l,t.assertIsBytes=f,t.bytesToHex=d,t.bytesToBigInt=p,t.bytesToSignedBigInt=function(e){f(e);var t,n=BigInt(0),i=r(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;n=(n<0,"Byte length must be greater than 0."),(0,i.assert)(function(e,t){(0,i.assert)(t>0);var n=e>>BigInt(31);return!((~e&n)+(e&~n)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");for(var n=e,r=new Uint8Array(t),o=0;o>=BigInt(8);return r.reverse()},t.numberToBytes=m,t.stringToBytes=g,t.valueToBytes=y,t.concatBytes=function(e){for(var t=new Array(e.length),n=0,r=0;r0?" ".concat(a(this.entries()).map((function(e){var t=o(e,2),n=t[0],r=t[1];return"".concat(String(n)," => ").concat(String(r))})).join(", ")," "):"","}")}}]),t}((r=new WeakMap,Symbol.iterator));t.FrozenMap=f;var d=function(e){function t(e){s(this,t),i.set(this,void 0),c(this,i,new Set(e),"f"),Object.freeze(this)}return u(t,[{key:"size",get:function(){return l(this,i,"f").size}},{key:e,value:function(){return l(this,i,"f")[Symbol.iterator]()}},{key:"entries",value:function(){return l(this,i,"f").entries()}},{key:"forEach",value:function(e,t){var n=this;return l(this,i,"f").forEach((function(r,i,o){return e.call(t,r,i,n)}))}},{key:"has",value:function(e){return l(this,i,"f").has(e)}},{key:"keys",value:function(){return l(this,i,"f").keys()}},{key:"values",value:function(){return l(this,i,"f").values()}},{key:"toString",value:function(){return"FrozenSet(".concat(this.size,") {").concat(this.size>0?" ".concat(a(this.values()).map((function(e){return String(e)})).join(", ")," "):"","}")}}]),t}((i=new WeakMap,Symbol.iterator));t.FrozenSet=d,Object.freeze(f),Object.freeze(f.prototype),Object.freeze(d),Object.freeze(d.prototype)},26135:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;var r=n(62746),i=n(35517);function o(e){return(0,r.is)(e,t.HexStruct)}function a(e){return(0,r.is)(e,t.StrictHexStruct)}t.HexStruct=(0,r.pattern)((0,r.string)(),/^(?:0x)?[0-9a-f]+$/i),t.StrictHexStruct=(0,r.pattern)((0,r.string)(),/^0x[0-9a-f]+$/i),t.isHexString=o,t.isStrictHexString=a,t.assertIsHexString=function(e){(0,i.assert)(o(e),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(e){(0,i.assert)(a(e),'Value must be a hexadecimal string, starting with "0x".')},t.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?"0x".concat(e.substring(2)):"0x".concat(e)},t.remove0x=function(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}},95533:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(35517),t),i(n(12802),t),i(n(53310),t),i(n(78531),t),i(n(70854),t),i(n(72465),t),i(n(26135),t),i(n(18420),t),i(n(88859),t),i(n(96013),t),i(n(3913),t),i(n(70304),t),i(n(57519),t),i(n(81482),t)},18420:function(e,t,n){"use strict";var r=n(27424).default;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;var i=n(62746),o=n(35517),a=n(96013);function s(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Set;return function e(t,i){if(void 0===t)return[!1,0];if(null===t)return[!0,i?0:a.JsonSize.Null];var o=typeof t;try{if("function"===o)return[!1,0];if("string"===o||t instanceof String)return[!0,i?0:(0,a.calculateStringSize)(t)+2*a.JsonSize.Quote];if("boolean"===o||t instanceof Boolean)return i?[!0,0]:[!0,1==t?a.JsonSize.True:a.JsonSize.False];if("number"===o||t instanceof Number)return i?[!0,0]:[!0,(0,a.calculateNumberSize)(t)];if(t instanceof Date)return i?[!0,0]:[!0,isNaN(t.getDate())?a.JsonSize.Null:a.JsonSize.Date+2*a.JsonSize.Quote]}catch(s){return[!1,0]}if(!(0,a.isPlainObject)(t)&&!Array.isArray(t))return[!1,0];if(n.has(t))return[!1,0];n.add(t);try{return[!0,Object.entries(t).reduce((function(o,s,u,c){var l=r(s,2),f=l[0],d=e(l[1],i),p=r(d,2),h=p[0],v=p[1];if(!h)throw new Error("JSON validation did not pass. Validation process stopped.");return n.delete(t),i?0:o+(Array.isArray(t)?0:f.length+a.JsonSize.Comma+2*a.JsonSize.Colon)+v+(u0)||i&&null===e)}},t.validateJsonAndGetSize=s},88859:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.createProjectLogger=void 0;var i=(0,r(n(44054)).default)("metamask");t.createProjectLogger=function(e){return i.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},96013:function(e,t){"use strict";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,t.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},t.isNullOrUndefined=function(e){return null===e||void 0===e},t.isObject=function(e){return Boolean(e)&&"object"===typeof e&&!Array.isArray(e)};function n(e){return e.charCodeAt(0)<=127}t.hasProperty=function(e,t){return Object.hasOwnProperty.call(e,t)},function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/g,t.isPlainObject=function(e){if("object"!==typeof e||null===e)return!1;try{for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(n){return!1}},t.isASCII=n,t.calculateStringSize=function(e){var r;return e.split("").reduce((function(e,t){return n(t)?e+1:e+2}),0)+(null!==(r=e.match(t.ESCAPE_CHARACTERS_REGEXP))&&void 0!==r?r:[]).length},t.calculateNumberSize=function(e){return e.toString().length}},3913:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBigInt=t.hexToNumber=t.bigIntToHex=t.numberToHex=void 0;var r=n(35517),i=n(26135);t.numberToHex=function(e){return(0,r.assert)("number"===typeof e,"Value must be a number."),(0,r.assert)(e>=0,"Value must be a non-negative number."),(0,r.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,i.add0x)(e.toString(16))};t.bigIntToHex=function(e){return(0,r.assert)("bigint"===typeof e,"Value must be a bigint."),(0,r.assert)(e>=0,"Value must be a non-negative bigint."),(0,i.add0x)(e.toString(16))};t.hexToNumber=function(e){(0,i.assertIsHexString)(e);var t=parseInt(e,16);return(0,r.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};t.hexToBigInt=function(e){return(0,i.assertIsHexString)(e),BigInt((0,i.add0x)(e))}},70304:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},57519:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));var n=function(e,t){if(!function(e){return Number.isInteger(e)&&e>=0}(e))throw new Error('"'.concat(t,'" must be a non-negative integer. Received: "').concat(e,'".'))};t.inMilliseconds=function(e,t){return n(e,"count"),e*t},t.timeSince=function(e){return n(e,"timestamp"),Date.now()-e}},81482:function(e,t,n){"use strict";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;var r=n(26931),i=n(62746),o=n(35517);t.VersionStruct=(0,i.refine)((0,i.string)(),"Version",(function(e){return null!==(0,r.valid)(e)||'Expected SemVer version, got "'.concat(e,'"')})),t.VersionRangeStruct=(0,i.refine)((0,i.string)(),"Version range",(function(e){return null!==(0,r.validRange)(e)||'Expected SemVer range, got "'.concat(e,'"')})),t.isValidSemVerVersion=function(e){return(0,i.is)(e,t.VersionStruct)},t.isValidSemVerRange=function(e){return(0,i.is)(e,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,o.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,o.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(e,t){return(0,r.gt)(e,t)},t.gtRange=function(e,t){return(0,r.gtr)(e,t)},t.satisfiesVersionRange=function(e,t){return(0,r.satisfies)(e,t,{includePrerelease:!0})}},76756:function(e,t,n){var r=n(56690).default,i=n(89728).default,o=Symbol("SemVer ANY"),a=function(){"use strict";function e(t,n){if(r(this,e),n=s(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}d("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===o?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}return i(e,[{key:"parse",value:function(e){var t=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new p(n[2],this.options.loose):this.semver=o}},{key:"toString",value:function(){return this.value}},{key:"test",value:function(e){if(d("Comparator.test",e,this.options.loose),this.semver===o||e===o)return!0;if("string"===typeof e)try{e=new p(e,this.options)}catch(t){return!1}return f(e,this.operator,this.semver,this.options)}},{key:"intersects",value:function(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new h(t.value,n).test(this.value):""===t.operator?""===t.value||new h(this.value,n).test(t.semver):(!(n=s(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==t.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!t.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!t.operator.startsWith("<"))||(!(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))||(!!(f(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))||!!(f(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))))))}}],[{key:"ANY",get:function(){return o}}]),e}();e.exports=a;var s=n(45505),u=n(60997),c=u.re,l=u.t,f=n(24671),d=n(91050),p=n(95210),h=n(84999)},84999:function(e,t,n){var r=n(861).default,i=n(74704).default,o=n(56690).default,a=n(89728).default,s=function(){"use strict";function e(t,n){var r=this;if(o(this,e),n=c(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof l)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t,this.set=t.split("||").map((function(e){return r.parseRange(e.trim())})).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(t));if(this.set.length>1){var a=this.set[0];if(this.set=this.set.filter((function(e){return!k(e[0])})),0===this.set.length)this.set=[a];else if(this.set.length>1){var s,u=i(this.set);try{for(u.s();!(s=u.n()).done;){var f=s.value;if(1===f.length&&_(f[0])){this.set=[f];break}}}catch(d){u.e(d)}finally{u.f()}}}this.format()}return a(e,[{key:"format",value:function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(e){var t=this;e=e.trim();var n=((this.options.includePrerelease&&w)|(this.options.loose&&x))+":"+e,o=u.get(n);if(o)return o;var a=this.options.loose,s=a?h[v.HYPHENRANGELOOSE]:h[v.HYPHENRANGE];e=e.replace(s,M(this.options.includePrerelease)),f("hyphen replace",e),e=e.replace(h[v.COMPARATORTRIM],m),f("comparator trim",e);var c=(e=(e=(e=e.replace(h[v.TILDETRIM],g)).replace(h[v.CARETTRIM],y)).split(/\s+/).join(" ")).split(" ").map((function(e){return A(e,t.options)})).join(" ").split(/\s+/).map((function(e){return N(e,t.options)}));a&&(c=c.filter((function(e){return f("loose invalid filter",e,t.options),!!e.match(h[v.COMPARATORLOOSE])}))),f("range list",c);var d,p=new Map,b=c.map((function(e){return new l(e,t.options)})),_=i(b);try{for(_.s();!(d=_.n()).done;){var E=d.value;if(k(E))return[E];p.set(E.value,E)}}catch(O){_.e(O)}finally{_.f()}p.size>1&&p.has("")&&p.delete("");var S=r(p.values());return u.set(n,S),S}},{key:"intersects",value:function(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((function(e){return E(e,n)&&t.set.some((function(t){return E(t,n)&&e.every((function(e){return t.every((function(t){return e.intersects(t,n)}))}))}))}))}},{key:"test",value:function(e){if(!e)return!1;if("string"===typeof e)try{e=new d(e,this.options)}catch(n){return!1}for(var t=0;t=".concat(n,".").concat(i,".0").concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".0").concat(r," <").concat(+n+1,".0.0-0"):a?(f("replaceCaret pr",a),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o,"-").concat(a," <").concat(+n+1,".0.0-0")):(f("no pr"),s="0"===n?"0"===i?">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(i,".").concat(+o+1,"-0"):">=".concat(n,".").concat(i,".").concat(o).concat(r," <").concat(n,".").concat(+i+1,".0-0"):">=".concat(n,".").concat(i,".").concat(o," <").concat(+n+1,".0.0-0")),f("caret return",s),s}))},I=function(e,t){return f("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return R(e,t)})).join(" ")},R=function(e,t){e=e.trim();var n=t.loose?h[v.XRANGELOOSE]:h[v.XRANGE];return e.replace(n,(function(n,r,i,o,a,s){f("xRange",e,n,r,i,o,a,s);var u=S(i),c=u||S(o),l=c||S(a),d=l;return"="===r&&d&&(r=""),s=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(o=0),a=0,">"===r?(r=">=",c?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===r&&(r="<",c?i=+i+1:o=+o+1),"<"===r&&(s="-0"),n="".concat(r+i,".").concat(o,".").concat(a).concat(s)):c?n=">=".concat(i,".0.0").concat(s," <").concat(+i+1,".0.0-0"):l&&(n=">=".concat(i,".").concat(o,".0").concat(s," <").concat(i,".").concat(+o+1,".0-0")),f("xRange return",n),n}))},j=function(e,t){return f("replaceStars",e,t),e.trim().replace(h[v.STAR],"")},N=function(e,t){return f("replaceGTE0",e,t),e.trim().replace(h[t.includePrerelease?v.GTE0PRE:v.GTE0],"")},M=function(e){return function(t,n,r,i,o,a,s,u,c,l,f,d,p){return n=S(r)?"":S(i)?">=".concat(r,".0.0").concat(e?"-0":""):S(o)?">=".concat(r,".").concat(i,".0").concat(e?"-0":""):a?">=".concat(n):">=".concat(n).concat(e?"-0":""),u=S(c)?"":S(l)?"<".concat(+c+1,".0.0-0"):S(f)?"<".concat(c,".").concat(+l+1,".0-0"):d?"<=".concat(c,".").concat(l,".").concat(f,"-").concat(d):e?"<".concat(c,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(u),"".concat(n," ").concat(u).trim()}},L=function(e,t,n){for(var r=0;r0){var o=e[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}},95210:function(e,t,n){var r=n(56690).default,i=n(89728).default,o=n(91050),a=n(12319),s=a.MAX_LENGTH,u=a.MAX_SAFE_INTEGER,c=n(60997),l=c.re,f=c.t,d=n(45505),p=n(61068).compareIdentifiers,h=function(){"use strict";function e(t,n){if(r(this,e),n=d(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!==typeof t)throw new TypeError('Invalid version. Must be a string. Got type "'.concat(typeof t,'".'));if(t.length>s)throw new TypeError("version is longer than ".concat(s," characters"));o("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;var i=t.trim().match(n.loose?l[f.LOOSE]:l[f.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(t));if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>u||this.major<0)throw new TypeError("Invalid major version");if(this.minor>u||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>u||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"===typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(t){var o=[t,r];!1===n&&(o=[t]),0===p(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}]),e}();e.exports=h},51976:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},24671:function(e,t,n){var r=n(90416),i=n(33962),o=n(18930),a=n(50316),s=n(93991),u=n(94838);e.exports=function(e,t,n,c){switch(t){case"===":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e===n;case"!==":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,c);case"!=":return i(e,n,c);case">":return o(e,n,c);case">=":return a(e,n,c);case"<":return s(e,n,c);case"<=":return u(e,n,c);default:throw new TypeError("Invalid operator: ".concat(t))}}},47021:function(e,t,n){var r=n(95210),i=n(84342),o=n(60997),a=o.re,s=o.t;e.exports=function(e,t){if(e instanceof r)return e;if("number"===typeof e&&(e=String(e)),"string"!==typeof e)return null;var n=null;if((t=t||{}).rtl){for(var o;(o=a[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&o.index+o[0].length===n.index+n[0].length||(n=o),a[s.COERCERTL].lastIndex=o.index+o[1].length+o[2].length;a[s.COERCERTL].lastIndex=-1}else n=e.match(a[s.COERCE]);return null===n?null:i("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),t)}},24046:function(e,t,n){var r=n(95210);e.exports=function(e,t,n){var i=new r(e,n),o=new r(t,n);return i.compare(o)||i.compareBuild(o)}},76858:function(e,t,n){var r=n(34324);e.exports=function(e,t){return r(e,t,!0)}},34324:function(e,t,n){var r=n(95210);e.exports=function(e,t,n){return new r(e,n).compare(new r(t,n))}},82190:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e,null,!0),i=r(t,null,!0),o=n.compare(i);if(0===o)return null;var a=o>0,s=a?i:n,u=!!(a?n:i).prerelease.length,c=u?"pre":"";return n.major!==i.major?c+"major":n.minor!==i.minor?c+"minor":n.patch!==i.patch?c+"patch":u?"prerelease":s.patch?"patch":s.minor?"minor":"major"}},90416:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return 0===r(e,t,n)}},18930:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)>0}},50316:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)>=0}},75950:function(e,t,n){var r=n(95210);e.exports=function(e,t,n,i,o){"string"===typeof n&&(o=i,i=n,n=void 0);try{return new r(e instanceof r?e.version:e,n).inc(t,i,o).version}catch(a){return null}}},93991:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)<0}},94838:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(e,t,n)<=0}},99881:function(e,t,n){var r=n(95210);e.exports=function(e,t){return new r(e,t).major}},36925:function(e,t,n){var r=n(95210);e.exports=function(e,t){return new r(e,t).minor}},33962:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return 0!==r(e,t,n)}},84342:function(e,t,n){var r=n(95210);e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e instanceof r)return e;try{return new r(e,t)}catch(i){if(!n)return null;throw i}}},99149:function(e,t,n){var r=n(95210);e.exports=function(e,t){return new r(e,t).patch}},36090:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},35008:function(e,t,n){var r=n(34324);e.exports=function(e,t,n){return r(t,e,n)}},13536:function(e,t,n){var r=n(24046);e.exports=function(e,t){return e.sort((function(e,n){return r(n,e,t)}))}},25656:function(e,t,n){var r=n(84999);e.exports=function(e,t,n){try{t=new r(t,n)}catch(i){return!1}return t.test(e)}},9210:function(e,t,n){var r=n(24046);e.exports=function(e,t){return e.sort((function(e,n){return r(e,n,t)}))}},16038:function(e,t,n){var r=n(84342);e.exports=function(e,t){var n=r(e,t);return n?n.version:null}},26931:function(e,t,n){var r=n(60997),i=n(12319),o=n(95210),a=n(61068),s=n(84342),u=n(16038),c=n(51976),l=n(75950),f=n(82190),d=n(99881),p=n(36925),h=n(99149),v=n(36090),m=n(34324),g=n(35008),y=n(76858),b=n(24046),w=n(9210),x=n(13536),k=n(18930),_=n(93991),E=n(90416),A=n(33962),S=n(50316),O=n(94838),T=n(24671),P=n(47021),C=n(76756),I=n(84999),R=n(25656),j=n(32212),N=n(46395),M=n(80213),L=n(34869),U=n(40857),D=n(65704),B=n(7566),F=n(52928),Z=n(22480),z=n(50772),H=n(99180);e.exports={parse:s,valid:u,clean:c,inc:l,diff:f,major:d,minor:p,patch:h,prerelease:v,compare:m,rcompare:g,compareLoose:y,compareBuild:b,sort:w,rsort:x,gt:k,lt:_,eq:E,neq:A,gte:S,lte:O,cmp:T,coerce:P,Comparator:C,Range:I,satisfies:R,toComparators:j,maxSatisfying:N,minSatisfying:M,minVersion:L,validRange:U,outside:D,gtr:B,ltr:F,intersects:Z,simplifyRange:z,subset:H,SemVer:o,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},12319:function(e){var t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},91050:function(e){var t="object"===typeof process&&{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.NODE_DEBUG&&/\bsemver\b/i.test({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.NODE_DEBUG)?function(){for(var e,t=arguments.length,n=new Array(t),r=0;r)?=?)"),c("XRANGEIDENTIFIERLOOSE","".concat(a[s.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),c("XRANGEIDENTIFIER","".concat(a[s.NUMERICIDENTIFIER],"|x|X|\\*")),c("XRANGEPLAIN","[v=\\s]*(".concat(a[s.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIER],")")+"(?:".concat(a[s.PRERELEASE],")?").concat(a[s.BUILD],"?")+")?)?"),c("XRANGEPLAINLOOSE","[v=\\s]*(".concat(a[s.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[s.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(a[s.PRERELEASELOOSE],")?").concat(a[s.BUILD],"?")+")?)?"),c("XRANGE","^".concat(a[s.GTLT],"\\s*").concat(a[s.XRANGEPLAIN],"$")),c("XRANGELOOSE","^".concat(a[s.GTLT],"\\s*").concat(a[s.XRANGEPLAINLOOSE],"$")),c("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(r,"})")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:$|[^\\d])"),c("COERCERTL",a[s.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM","(\\s*)".concat(a[s.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",c("TILDE","^".concat(a[s.LONETILDE]).concat(a[s.XRANGEPLAIN],"$")),c("TILDELOOSE","^".concat(a[s.LONETILDE]).concat(a[s.XRANGEPLAINLOOSE],"$")),c("LONECARET","(?:\\^)"),c("CARETTRIM","(\\s*)".concat(a[s.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",c("CARET","^".concat(a[s.LONECARET]).concat(a[s.XRANGEPLAIN],"$")),c("CARETLOOSE","^".concat(a[s.LONECARET]).concat(a[s.XRANGEPLAINLOOSE],"$")),c("COMPARATORLOOSE","^".concat(a[s.GTLT],"\\s*(").concat(a[s.LOOSEPLAIN],")$|^$")),c("COMPARATOR","^".concat(a[s.GTLT],"\\s*(").concat(a[s.FULLPLAIN],")$|^$")),c("COMPARATORTRIM","(\\s*)".concat(a[s.GTLT],"\\s*(").concat(a[s.LOOSEPLAIN],"|").concat(a[s.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE","^\\s*(".concat(a[s.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(a[s.XRANGEPLAIN],")")+"\\s*$"),c("HYPHENRANGELOOSE","^\\s*(".concat(a[s.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(a[s.XRANGEPLAINLOOSE],")")+"\\s*$"),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7566:function(e,t,n){var r=n(65704);e.exports=function(e,t,n){return r(e,t,">",n)}},22480:function(e,t,n){var r=n(84999);e.exports=function(e,t,n){return e=new r(e,n),t=new r(t,n),e.intersects(t,n)}},52928:function(e,t,n){var r=n(65704);e.exports=function(e,t,n){return r(e,t,"<",n)}},46395:function(e,t,n){var r=n(95210),i=n(84999);e.exports=function(e,t,n){var o=null,a=null,s=null;try{s=new i(t,n)}catch(u){return null}return e.forEach((function(e){s.test(e)&&(o&&-1!==a.compare(e)||(a=new r(o=e,n)))})),o}},80213:function(e,t,n){var r=n(95210),i=n(84999);e.exports=function(e,t,n){var o=null,a=null,s=null;try{s=new i(t,n)}catch(u){return null}return e.forEach((function(e){s.test(e)&&(o&&1!==a.compare(e)||(a=new r(o=e,n)))})),o}},34869:function(e,t,n){var r=n(95210),i=n(84999),o=n(18930);e.exports=function(e,t){e=new i(e,t);var n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(var a=function(){var t=e.set[s],i=null;t.forEach((function(e){var t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!o(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(e.operator))}})),!i||n&&!o(n,i)||(n=i)},s=0;s":p=u,h=l,v=c,m=">",g=">=";break;case"<":p=c,h=f,v=u,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,d))return!1;for(var y=function(){var n=t.set[b],r=null,a=null;return n.forEach((function(e){e.semver===o&&(e=new i(">=0.0.0")),r=r||e,a=a||e,p(e.semver,r.semver,d)?r=e:v(e.semver,a.semver,d)&&(a=e)})),r.operator===m||r.operator===g?{v:!1}:a.operator&&a.operator!==m||!h(e,a.semver)?a.operator===g&&v(e,a.semver)?{v:!1}:void 0:{v:!1}},b=0;b=".concat(y)):h.push("*")}var w=h.join(" || "),x="string"===typeof t.raw?t.raw:String(t);return w.length=0.0.0-0")],l=[new o(">=0.0.0")],f=function(e,t,n){if(e===t)return!0;if(1===e.length&&e[0].semver===a){if(1===t.length&&t[0].semver===a)return!0;e=n.includePrerelease?c:l}if(1===t.length&&t[0].semver===a){if(n.includePrerelease)return!0;t=l}var i,o,f,h,v=new Set,m=r(e);try{for(m.s();!(f=m.n()).done;){var g=f.value;">"===g.operator||">="===g.operator?i=d(i,g,n):"<"===g.operator||"<="===g.operator?o=p(o,g,n):v.add(g.semver)}}catch(j){m.e(j)}finally{m.f()}if(v.size>1)return null;if(i&&o){if((h=u(i.semver,o.semver,n))>0)return null;if(0===h&&(">="!==i.operator||"<="!==o.operator))return null}var y,b,w,x,k,_=r(v);try{for(_.s();!(y=_.n()).done;){var E=y.value;if(i&&!s(E,String(i),n))return null;if(o&&!s(E,String(o),n))return null;var A,S=r(t);try{for(S.s();!(A=S.n()).done;){var O=A.value;if(!s(E,String(O),n))return!1}}catch(j){S.e(j)}finally{S.f()}return!0}}catch(j){_.e(j)}finally{_.f()}var T=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver,P=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;T&&1===T.prerelease.length&&"<"===o.operator&&0===T.prerelease[0]&&(T=!1);var C,I=r(t);try{for(I.s();!(C=I.n()).done;){var R=C.value;if(k=k||">"===R.operator||">="===R.operator,x=x||"<"===R.operator||"<="===R.operator,i)if(P&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===P.major&&R.semver.minor===P.minor&&R.semver.patch===P.patch&&(P=!1),">"===R.operator||">="===R.operator){if((b=d(i,R,n))===R&&b!==i)return!1}else if(">="===i.operator&&!s(i.semver,String(R),n))return!1;if(o)if(T&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===T.major&&R.semver.minor===T.minor&&R.semver.patch===T.patch&&(T=!1),"<"===R.operator||"<="===R.operator){if((w=p(o,R,n))===R&&w!==o)return!1}else if("<="===o.operator&&!s(o.semver,String(R),n))return!1;if(!R.operator&&(o||i)&&0!==h)return!1}}catch(j){I.e(j)}finally{I.f()}return!(i&&x&&!o&&0!==h)&&(!(o&&k&&!i&&0!==h)&&(!P&&!T))},d=function(e,t,n){if(!e)return t;var r=u(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},p=function(e,t,n){if(!e)return t;var r=u(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e===t)return!0;e=new i(e,n),t=new i(t,n);var o,a=!1,s=r(e.set);try{e:for(s.s();!(o=s.n()).done;){var u,c=o.value,l=r(t.set);try{for(l.s();!(u=l.n()).done;){var d=u.value,p=f(c,d,n);if(a=a||null!==p,p)continue e}}catch(h){l.e(h)}finally{l.f()}if(a)return!1}}catch(h){s.e(h)}finally{s.f()}return!0}},32212:function(e,t,n){var r=n(84999);e.exports=function(e,t){return new r(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))}},40857:function(e,t,n){var r=n(84999);e.exports=function(e,t){try{return new r(e,t).range||"*"}catch(n){return null}}},17391:function(e){"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n>>0,c=new Uint8Array(o);e[n];){var l=t[e.charCodeAt(n)];if(255===l)return;for(var f=0,d=o-1;(0!==l||f>>0,c[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,n++}if(" "!==e[n]){for(var p=o-i;p!==o&&0===c[p];)p++;for(var h=new Uint8Array(r+(o-p)),v=r;p!==o;)h[v++]=c[p++];return h}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var f=t[i],d=0,p=u-1;(0!==f||d>>0,l[p]=f%a>>>0,f=f/a>>>0;if(0!==f)throw new Error("Non-zero carry");r=d,i++}for(var h=u-r;h!==u&&0===l[h];)h++;for(var v=s.repeat(n);h1?n-1:0),a=1;aa;)n&s&&(r=r.add(i)),i=i.double(),n>>=s;return r},precomputeWindow:function(e,t){for(var n=r(t),i=n.windows,o=n.windowSize,a=[],s=e,u=s,c=0;c>=h,g>c&&(g-=p,o+=s);var y=m,b=m+Math.abs(g)-1,w=v%2!==0,x=g<0;0===g?f=f.add(n(w,i[y])):l=l.add(n(x,i[b]))}return{p:l,f:f}},wNAFCached:function(e,t,n,r){var i=e._WINDOW_SIZE||1,o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,r(o))),this.wNAF(i,o,n)}}},t.validateBasic=function(e){return(0,i.validateField)(e.Fp),(0,o.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze(r(r(r({},(0,i.nLength)(e.n,e.nBitLength)),e),{p:e.Fp.ORDER}))}},59496:function(e,t,n){"use strict";var r=n(42122).default,i=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.createHasher=t.isogenyMap=t.hash_to_field=t.expand_message_xof=t.expand_message_xmd=void 0;var o=n(22818),a=n(47308);var s=a.bytesToNumberBE;function u(e,t){if(e<0||e>=1<<8*t)throw new Error("bad I2OSP call: value=".concat(e," length=").concat(t));for(var n=Array.from({length:t}).fill(0),r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function c(e,t){for(var n=new Uint8Array(e.length),r=0;r255&&(t=r((0,a.concatBytes)((0,a.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));var i=r.outputLen,o=r.blockLen,s=Math.ceil(n/i);if(s>255)throw new Error("Invalid xmd length");var d=(0,a.concatBytes)(t,u(t.length,1)),p=u(0,o),h=u(n,2),v=new Array(s),m=r((0,a.concatBytes)(p,e,h,u(0,1),d));v[0]=r((0,a.concatBytes)(m,u(1,1),d));for(var g=1;g<=s;g++){var y=[c(m,v[g-1]),u(g+1,1),d];v[g]=r(a.concatBytes.apply(void 0,y))}return a.concatBytes.apply(void 0,v).slice(0,n)}function p(e,t,n,r,i){if(l(e),l(t),f(n),t.length>255){var o=Math.ceil(2*r/8);t=i.create({dkLen:o}).update((0,a.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:n}).update(e).update(u(n,2)).update(t).update(u(t.length,1)).digest()}function h(e,t,n){(0,a.validateObject)(n,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});var r=n.p,i=n.k,u=n.m,c=n.hash,h=n.expand,v=n.DST;l(e),f(t);var m,g=function(e){if(e instanceof Uint8Array)return e;if("string"===typeof e)return(0,a.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}(v),y=r.toString(2).length,b=Math.ceil((y+i)/8),w=t*u*b;if("xmd"===h)m=d(e,g,w,c);else if("xof"===h)m=p(e,g,w,i,c);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');m=e}for(var x=new Array(t),k=0;k=i?n:t+n}function d(e,t,n){if(n<=i||t 0");if(n===o)return i;for(var r=o;t>i;)t&o&&(r=r*e%n),e=e*e%n,t>>=o;return r}function p(e,t){if(e===i||t<=i)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var n=f(e,t),r=t,a=i,s=o,u=o,c=i;n!==i;){var l=r/n,d=r%n,p=a-u*l,h=s-c*l;r=n,n=d,a=u,s=c,u=p,c=h}if(r!==o)throw new Error("invert: does not exist");return f(a,t)}function h(e){var t,n,r,s=(e-o)/a;for(t=e-o,n=0;t%a===i;t/=a,n++);for(r=a;ri;)r*=r,r%=n;return r},t.invert=p,t.tonelliShanks=h,t.FpSqrt=v;t.isNegativeLE=function(e,t){return(f(e,t)&o)===o};var m=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function g(e,t,n){if(n 0");if(n===i)return e.ONE;if(n===o)return t;for(var r=e.ONE,a=t;n>i;)n&o&&(r=e.mul(r,a)),a=e.sqr(a),n>>=o;return r}function y(e,t){var n=new Array(t.length),r=t.reduce((function(t,r,i){return e.is0(r)?t:(n[i]=t,e.mul(t,r))}),e.ONE),i=e.inv(r);return t.reduceRight((function(t,r,i){return e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r))}),i),n}function b(e,t){var n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}t.validateField=function(e){var t=m.reduce((function(e,t){return e[t]="function",e}),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,r.validateObject)(e,t)},t.FpPow=g,t.FpInvertBatch=y,t.FpDiv=function(e,t,n){return e.mul(t,"bigint"===typeof n?p(n,e.ORDER):e.inv(n))},t.FpIsSquare=function(e){var t=(e.ORDER-o)/a;return function(n){var r=e.pow(n,t);return e.eql(r,e.ZERO)||e.eql(r,e.ONE)}},t.nLength=b,t.Field=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e<=i)throw new Error("Expected Fp ORDER > 0, got ".concat(e));var s=b(e,t),u=s.nBitLength,c=s.nByteLength;if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");var l=v(e),d=Object.freeze({ORDER:e,BITS:u,BYTES:c,MASK:(0,r.bitMask)(u),ZERO:i,ONE:o,create:function(t){return f(t,e)},isValid:function(t){if("bigint"!==typeof t)throw new Error("Invalid field element: expected bigint, got ".concat(typeof t));return i<=t&&t2&&void 0!==arguments[2]&&arguments[2],i=(e=(0,r.ensureBytes)("privateHash",e)).length,a=b(t).nByteLength+8;if(a<24||i1024)throw new Error("hashToPrivateScalar: expected ".concat(a,"-1024 bytes of input, got ").concat(i));return f(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-o)+o}},47308:function(e,t,n){"use strict";var r=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.validateObject=t.createHmacDrbg=t.bitMask=t.bitSet=t.bitGet=t.bitLen=t.utf8ToBytes=t.equalBytes=t.concatBytes=t.ensureBytes=t.numberToVarBytesBE=t.numberToBytesLE=t.numberToBytesBE=t.bytesToNumberLE=t.bytesToNumberBE=t.hexToBytes=t.hexToNumber=t.numberToHexUnpadded=t.bytesToHex=void 0;var i=BigInt(0),o=BigInt(1),a=BigInt(2),s=function(e){return e instanceof Uint8Array},u=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));function c(e){if(!s(e))throw new Error("Uint8Array expected");for(var t="",n=0;ni;e>>=o,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&o};t.bitSet=function(e,t,n){return e|(n?o:i)<0&&void 0!==arguments[0]?arguments[0]:v();i=s(m([0]),e),r=s(),0!==e.length&&(i=s(m([1]),e),r=s())},c=function(){if(o++>=1e3)throw new Error("drbg: tried 1000 values");for(var e=0,n=[];e2&&void 0!==arguments[2]?arguments[2]:{},i=function(t,n,r){var i=g[n];if("function"!==typeof i)throw new Error('Invalid validator "'.concat(n,'", expected function'));var o=e[t];if((!r||void 0!==o)&&!i(o,e))throw new Error("Invalid param ".concat(String(t),"=").concat(o," (").concat(typeof o,"), expected ").concat(n))},o=0,a=Object.entries(t);o0&&void 0!==arguments[0]?arguments[0]:"";return i(this,n),t.call(this,e)}return r(n)}(s(Error)),_parseInt:function(e){var n=t.DER.Err;if(e.length<2||2!==e[0])throw new n("Invalid signature integer tag");var r=e[1],i=e.subarray(2,r+2);if(!r||i.length!==r)throw new n("Invalid signature integer: wrong length");if(128&i[0])throw new n("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new n("Invalid signature integer: unnecessary leading zero");return{d:p(i),l:e.subarray(r+2)}},toSig:function(e){var n=t.DER.Err,r="string"===typeof e?h(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");var i=r.length;if(i<2||48!=r[0])throw new n("Invalid signature tag");if(r[1]!==i-2)throw new n("Invalid signature: incorrect length");var o=t.DER._parseInt(r.subarray(2)),a=o.d,s=o.l,u=t.DER._parseInt(s),c=u.d;if(u.l.length)throw new n("Invalid signature: left bytes after parsing");return{r:a,s:c}},hexFromSig:function(e){var t=function(e){return 8&Number.parseInt(e[0],16)?"00"+e:e},n=function(e){var t=e.toString(16);return 1&t.length?"0".concat(t):t},r=t(n(e.s)),i=t(n(e.r)),o=r.length/2,a=i.length/2,s=n(o),u=n(a);return"30".concat(n(a+o+4),"02").concat(u).concat(i,"02").concat(s).concat(r)}};var v=BigInt(0),m=BigInt(1),g=BigInt(2),y=BigInt(3),b=BigInt(4);function w(e){var t=function(e){var t=(0,d.validateBasic)(e);l.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});var n=t.endo,r=t.Fp,i=t.a;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!==typeof n||"bigint"!==typeof n.beta||"function"!==typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze(u({},t))}(e),n=t.Fp,o=t.toBytes||function(e,t,r){var i=t.toAffine();return l.concatBytes(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))},a=t.fromBytes||function(e){var t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}};function s(e){var r=t.a,i=t.b,o=n.sqr(e),a=n.mul(o,e);return n.add(n.add(a,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function p(e){return"bigint"===typeof e&&vv||l>v;)u&m&&(f=f.add(p)),l&m&&(d=d.add(p)),p=p.double(),u>>=m,l>>=m;return s&&(f=f.negate()),c&&(d=d.negate()),d=new e(n.mul(d.px,o.beta),d.py,d.pz),f.add(d)}},{key:"multiply",value:function(r){h(r);var i,o,a=r,s=t.endo;if(s){var u=s.splitScalar(a),c=u.k1neg,l=u.k1,f=u.k2neg,d=u.k2,p=this.wNAF(l),v=p.p,m=p.f,g=this.wNAF(d),y=g.p,b=g.f;v=_.constTimeNegate(c,v),y=_.constTimeNegate(f,y),y=new e(n.mul(y.px,s.beta),y.py,y.pz),i=v.add(y),o=m.add(b)}else{var w=this.wNAF(a);i=w.p,o=w.f}return e.normalizeZ([i,o])[0]}},{key:"multiplyAndAddUnsafe",value:function(t,n,r){var i=e.BASE,o=function(e,t){return t!==v&&t!==m&&e.equals(i)?e.multiply(t):e.multiplyUnsafe(t)},a=o(this,n).add(o(t,r));return a.is0()?void 0:a}},{key:"toAffine",value:function(e){var t=this.px,r=this.py,i=this.pz,o=this.is0();null==e&&(e=o?n.ONE:n.inv(i));var a=n.mul(t,e),s=n.mul(r,e),u=n.mul(i,e);if(o)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:a,y:s}}},{key:"isTorsionFree",value:function(){var n=t.h,r=t.isTorsionFree;if(n===m)return!0;if(r)return r(e,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}},{key:"clearCofactor",value:function(){var n=t.h,r=t.clearCofactor;return n===m?this:r?r(e,this):this.multiplyUnsafe(t.h)}},{key:"toRawBytes",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.assertValidity(),o(e,this,t)}},{key:"toHex",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return l.bytesToHex(this.toRawBytes(e))}}],[{key:"fromAffine",value:function(t){var r=t||{},i=r.x,o=r.y;if(!t||!n.isValid(i)||!n.isValid(o))throw new Error("invalid affine point");if(t instanceof e)throw new Error("projective point not allowed");var a=function(e){return n.eql(e,n.ZERO)};return a(i)&&a(o)?e.ZERO:new e(i,o,n.ONE)}},{key:"normalizeZ",value:function(t){var r=n.invertBatch(t.map((function(e){return e.pz})));return t.map((function(e,t){return e.toAffine(r[t])})).map(e.fromAffine)}},{key:"fromHex",value:function(t){var n=e.fromAffine(a((0,f.ensureBytes)("pointHex",t)));return n.assertValidity(),n}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(g(t))}}]),e}();x.BASE=new x(t.Gx,t.Gy,n.ONE),x.ZERO=new x(n.ZERO,n.ONE,n.ZERO);var k=t.nBitLength,_=(0,d.wNAF)(x,t.endo?Math.ceil(k/2):k);return{CURVE:t,ProjectivePoint:x,normPrivateKeyToScalar:g,weierstrassEquation:s,isWithinCurveOrder:p}}function x(e,t){for(var n=e.ORDER,r=v,i=n-m;i%g===v;i/=g)r+=m;var o=r,a=g<m;v--){var y=v-g;y=g<a>>m}var S=function(e,t,n){return l.bytesToNumberBE(e.slice(t,n))},O=function(){function e(t,n,r){i(this,e),this.r=t,this.s=n,this.recovery=r,this.assertValidity()}return r(e,[{key:"assertValidity",value:function(){if(!_(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!_(this.s))throw new Error("s must be 0 < s < CURVE.n")}},{key:"addRecoveryBit",value:function(t){return new e(this.r,this.s,t)}},{key:"recoverPublicKey",value:function(e){var t=this.r,r=this.s,i=this.recovery,a=I((0,f.ensureBytes)("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");var s=2===i||3===i?t+n.n:t;if(s>=o.ORDER)throw new Error("recovery id 2 or 3 invalid");var u=0===(1&i)?"02":"03",c=b.fromHex(u+E(s)),l=g(s),d=h(-a*l),p=h(r*l),v=b.BASE.multiplyAndAddUnsafe(c,d,p);if(!v)throw new Error("point at infinify");return v.assertValidity(),v}},{key:"hasHighS",value:function(){return A(this.s)}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,h(-this.s),this.recovery):this}},{key:"toDERRawBytes",value:function(){return l.hexToBytes(this.toDERHex())}},{key:"toDERHex",value:function(){return t.DER.hexFromSig({r:this.r,s:this.s})}},{key:"toCompactRawBytes",value:function(){return l.hexToBytes(this.toCompactHex())}},{key:"toCompactHex",value:function(){return E(this.r)+E(this.s)}}],[{key:"fromCompact",value:function(t){var r=n.nByteLength;return t=(0,f.ensureBytes)("compactSignature",t,2*r),new e(S(t,0,r),S(t,r,2*r))}},{key:"fromDER",value:function(n){var r=t.DER.toSig((0,f.ensureBytes)("DER",n));return new e(r.r,r.s)}}]),e}(),T={isValidPrivateKey:function(e){try{return x(e),!0}catch(t){return!1}},normPrivateKeyToScalar:x,randomPrivateKey:function(){var e=n.randomBytes(o.BYTES+8),t=c.hashToPrivateScalar(e,a);return l.numberToBytesBE(t,n.nByteLength)},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.BASE;return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function P(e){var t=e instanceof Uint8Array,n="string"===typeof e,r=(t||n)&&e.length;return t?r===s||r===p:n?r===2*s||r===2*p:e instanceof b}var C=n.bits2int||function(e){var t=l.bytesToNumberBE(e),r=8*e.length-n.nBitLength;return r>0?t>>BigInt(r):t},I=n.bits2int_modN||function(e){return h(C(e))},R=l.bitMask(n.nBitLength);function j(e){if("bigint"!==typeof e)throw new Error("bigint expected");if(!(v<=e&&e2&&void 0!==arguments[2]?arguments[2]:M;if(["recovered","canonical"].some((function(e){return e in r})))throw new Error("sign() legacy options not supported");var i=n.hash,a=n.randomBytes,s=r.lowS,u=r.prehash,c=r.extraEntropy;null==s&&(s=!0),e=(0,f.ensureBytes)("msgHash",e),u&&(e=(0,f.ensureBytes)("prehashed msgHash",i(e)));var d=I(e),p=x(t),y=[j(p),j(d)];if(null!=c){var w=!0===c?a(o.BYTES):c;y.push((0,f.ensureBytes)("extraEntropy",w,o.BYTES))}var k=l.concatBytes.apply(l,y),E=d;return{seed:k,k2sig:function(e){var t=C(e);if(_(t)){var n=g(t),r=b.BASE.multiply(t).toAffine(),i=h(r.x);if(i!==v){var o=h(n*h(E+i*p));if(o!==v){var a=(r.x===i?0:2)|Number(r.y&m),u=o;return s&&A(o)&&(u=function(e){return A(e)?h(-e):e}(o),a^=1),new O(i,u,a)}}}}}}var M={lowS:n.lowS,prehash:!1},L={lowS:n.lowS,prehash:!1};return b.BASE._setWindowSize(8),{CURVE:n,getPublicKey:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return b.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(P(e))throw new Error("first arg must be private key");if(!P(t))throw new Error("second arg must be public key");return b.fromHex(t).multiply(x(e)).toRawBytes(n)},sign:function(e,t){var r=N(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:M),i=r.seed,o=r.k2sig,a=n;return l.createHmacDrbg(a.hash.outputLen,a.nByteLength,a.hmac)(i,o)},verify:function(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:L,s=e;if(r=(0,f.ensureBytes)("msgHash",r),i=(0,f.ensureBytes)("publicKey",i),"strict"in a)throw new Error("options.strict was renamed to lowS");var u,c=a.lowS,l=a.prehash,d=void 0;try{if("string"===typeof s||s instanceof Uint8Array)try{d=O.fromDER(s)}catch(S){if(!(S instanceof t.DER.Err))throw S;d=O.fromCompact(s)}else{if("object"!==typeof s||"bigint"!==typeof s.r||"bigint"!==typeof s.s)throw new Error("PARSE");var p=s.r,v=s.s;d=new O(p,v)}u=b.fromHex(i)}catch(T){if("PARSE"===T.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&d.hasHighS())return!1;l&&(r=n.hash(r));var m=d,y=m.r,w=m.s,x=I(r),k=g(w),_=h(x*k),E=h(y*k),A=null===(o=b.BASE.multiplyAndAddUnsafe(u,_,E))||void 0===o?void 0:o.toAffine();return!!A&&h(A.x)===y},ProjectivePoint:b,Signature:O,utils:T}},t.SWUFpSqrtRatio=x,t.mapToCurveSimpleSWU=function(e,t){if(c.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");var n=x(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return function(r){var i,o,a,s,u,c,l,f;i=e.sqr(r),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),a=e.add(o,e.ONE),a=e.mul(a,t.B),s=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),s=e.mul(s,t.A),o=e.sqr(a),c=e.sqr(s),u=e.mul(c,t.A),o=e.add(o,u),o=e.mul(o,a),c=e.mul(c,s),u=e.mul(c,t.B),o=e.add(o,u),l=e.mul(i,a);var d=n(o,c),p=d.isValid,h=d.value;f=e.mul(i,r),f=e.mul(f,h),l=e.cmov(l,a,p),f=e.cmov(f,h,p);var v=e.isOdd(r)===e.isOdd(f);return f=e.cmov(e.neg(f),f,v),{x:l=e.div(l,s),y:f}}}},55033:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.schnorr=t.secp256k1=void 0;var r=n(15925),i=n(54242),o=n(22818),a=n(86983),s=n(47308),u=n(59496),c=n(50132),l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),f=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),d=BigInt(1),p=BigInt(2),h=function(e,t){return(e+t/p)/t};function v(e){var t=l,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),s=BigInt(23),u=BigInt(44),c=BigInt(88),f=e*e*e%t,d=f*f*e%t,h=(0,o.pow2)(d,n,t)*d%t,v=(0,o.pow2)(h,n,t)*d%t,g=(0,o.pow2)(v,p,t)*f%t,y=(0,o.pow2)(g,i,t)*g%t,b=(0,o.pow2)(y,a,t)*y%t,w=(0,o.pow2)(b,u,t)*b%t,x=(0,o.pow2)(w,c,t)*w%t,k=(0,o.pow2)(x,u,t)*b%t,_=(0,o.pow2)(k,n,t)*d%t,E=(0,o.pow2)(_,s,t)*y%t,A=(0,o.pow2)(E,r,t)*f%t,S=(0,o.pow2)(A,p,t);if(!m.eql(m.sqr(S),e))throw new Error("Cannot find square root");return S}var m=(0,o.Field)(l,void 0,void 0,{sqrt:v});t.secp256k1=(0,c.createCurve)({a:BigInt(0),b:BigInt(7),Fp:m,n:f,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:function(e){var t=f,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-d*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,s=BigInt("0x100000000000000000000000000000000"),u=h(a*e,t),c=h(-r*e,t),l=(0,o.mod)(e-u*n-c*i,t),p=(0,o.mod)(-u*r-c*a,t),v=l>s,m=p>s;if(v&&(l=t-l),m&&(p=t-p),l>s||p>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:v,k1:l,k2neg:m,k2:p}}}},r.sha256);var g=BigInt(0),y=function(e){return"bigint"===typeof e&&g1?i-1:0),a=1;a2&&void 0!==arguments[2]?arguments[2]:(0,i.randomBytes)(32),r=(0,s.ensureBytes)("message",e),o=T(t),a=o.bytes,u=o.scalar,c=(0,s.ensureBytes)("auxRand",n,32),l=_(u^(0,s.bytesToNumberBE)(x("BIP0340/aux",c))),f=x("BIP0340/nonce",l,a,r),d=A((0,s.bytesToNumberBE)(f));if(d===g)throw new Error("sign failed: k is zero");var p=T(d),h=p.bytes,v=p.scalar,m=C(h,a,r),y=new Uint8Array(64);if(y.set(h,0),y.set(_(A(v+m*u)),32),!j(y,r,a))throw new Error("sign: Invalid signature produced");return y}function j(e,t,n){var r=(0,s.ensureBytes)("signature",e,64),i=(0,s.ensureBytes)("message",t),o=(0,s.ensureBytes)("publicKey",n,32);try{var a=P((0,s.bytesToNumberBE)(o)),u=(0,s.bytesToNumberBE)(r.subarray(0,32));if(!y(u))return!1;var c=(0,s.bytesToNumberBE)(r.subarray(32,64));if(!b(c))return!1;var l=C(_(u),k(a),i),f=O(a,c,A(-l));return!(!f||!f.hasEvenY()||f.toAffine().x!==u)}catch(d){return!1}}t.schnorr={getPublicKey:I,sign:R,verify:j,utils:{randomPrivateKey:t.secp256k1.utils.randomPrivateKey,lift_x:P,pointToBytes:k,numberToBytesBE:s.numberToBytesBE,bytesToNumberBE:s.bytesToNumberBE,taggedHash:x,mod:o.mod}};var N=function(){return(0,u.isogenyMap)(m,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((function(e){return e.map((function(e){return BigInt(e)}))})))}(),M=function(){return(0,a.mapToCurveSimpleSWU)(m,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:m.create(BigInt("-11"))})}(),L=function(){return(0,u.createHasher)(t.secp256k1.ProjectivePoint,(function(e){var t=M(m.create(e[0])),n=t.x,r=t.y;return N(n,r)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:m.ORDER,m:1,k:128,expand:"xmd",hash:r.sha256})}();t.hashToCurve=L.hashToCurve,t.encodeToCurve=L.encodeToCurve},28583:function(e,t){"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Wrong positive integer: ".concat(e))}function r(e){if("boolean"!==typeof e)throw new Error("Expected boolean, not ".concat(e))}function i(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&!n.includes(e.length))throw new Error("Expected Uint8Array of length ".concat(n,", not of length=").concat(e.length))}function o(e){if("function"!==typeof e||"function"!==typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function a(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function s(e,t){i(e);var n=t.outputLen;if(e.lengthr-o&&(this.process(n,0),o=0);for(var a=o;a>i&o),s=Number(n&o),u=r?4:0,c=r?0:4;e.setUint32(t+u,a,r),e.setUint32(t+c,s,r)}(n,r-8,BigInt(8*this.length),i),this.process(n,0);var s=(0,c.createView)(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");var f=l/4,d=this.get();if(f>d.length)throw new Error("_sha2: outputLen bigger than state");for(var p=0;pc?e.create().update(a).digest():a);for(var f=0;f>>3,s=(0,u.rotr)(o,17)^(0,u.rotr)(o,19)^o>>>10;p[r]=s+p[r-7]+a+p[r-16]|0}for(var d=this.A,h=this.B,v=this.C,m=this.D,g=this.E,y=this.F,b=this.G,w=this.H,x=0;x<64;x++){var k=w+((0,u.rotr)(g,6)^(0,u.rotr)(g,11)^(0,u.rotr)(g,25))+c(g,y,b)+f[x]+p[x]|0,_=((0,u.rotr)(d,2)^(0,u.rotr)(d,13)^(0,u.rotr)(d,22))+l(d,h,v)|0;w=b,b=y,y=g,g=m+k|0,m=v,v=h,h=d,d=k+_|0}d=d+this.A|0,h=h+this.B|0,v=v+this.C|0,m=m+this.D|0,g=g+this.E|0,y=y+this.F|0,b=b+this.G|0,w=w+this.H|0,this.set(d,h,v,m,g,y,b,w)}},{key:"roundClean",value:function(){p.fill(0)}},{key:"destroy",value:function(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}]),n}(s.SHA2),v=function(e){o(n,e);var t=a(n);function n(){var e;return r(this,n),(e=t.call(this)).A=-1056596264,e.B=914150663,e.C=812702999,e.D=-150054599,e.E=-4191439,e.F=1750603025,e.G=1694076839,e.H=-1090891868,e.outputLen=28,e}return i(n)}(h);t.sha256=(0,u.wrapConstructor)((function(){return new h})),t.sha224=(0,u.wrapConstructor)((function(){return new v}))},54242:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,o=n(17061).default,a=n(17156).default;Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;var s=n(87580),u=function(e){return e instanceof Uint8Array};t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))};t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)};if(t.rotr=function(e,t){return e<<32-t|e>>>t},t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");var c=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));t.bytesToHex=function(e){if(!u(e))throw new Error("Uint8Array expected");for(var t="",n=0;n=0&&u0&&void 0!==arguments[0]?arguments[0]:32;if(s.crypto&&"function"===typeof s.crypto.getRandomValues)return s.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},78489:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeAppProvider=void 0;var r=n(71769);Object.defineProperty(t,"SafeAppProvider",{enumerable:!0,get:function(){return r.SafeAppProvider}})},71769:function(e,t,n){"use strict";var r=n(27424).default,i=n(17061).default,o=n(17156).default,a=n(56690).default,s=n(89728).default,u=n(61655).default,c=n(26389).default;Object.defineProperty(t,"__esModule",{value:!0}),t.SafeAppProvider=void 0;var l=n(68041),f=n(26869),d=function(e){u(n,e);var t=c(n);function n(e,r){var i;return a(this,n),(i=t.call(this)).submittedTxs=new Map,i.safe=e,i.sdk=r,i}return s(n,[{key:"connect",value:function(){var e=o(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.emit("connect",{chainId:this.chainId}),e.abrupt("return");case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=o(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"chainId",get:function(){return this.safe.chainId}},{key:"request",value:function(){var e=o(i().mark((function e(t){var n,o,a,s,u,c,l,d,p,h,v,m,g,y,b,w,x,k,_,E,A,S,O,T,P,C;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.method,o=t.params,a=void 0===o?[]:o,e.t0=n,e.next="eth_accounts"===e.t0?4:"net_version"===e.t0||"eth_chainId"===e.t0?5:"personal_sign"===e.t0?6:"eth_sign"===e.t0?14:"eth_signTypedData"===e.t0||"eth_signTypedData_v4"===e.t0?22:"eth_sendTransaction"===e.t0?31:"eth_blockNumber"===e.t0?38:"eth_getBalance"===e.t0?42:"eth_getCode"===e.t0?43:"eth_getTransactionCount"===e.t0?44:"eth_getStorageAt"===e.t0?45:"eth_getBlockByNumber"===e.t0?46:"eth_getBlockByHash"===e.t0?47:"eth_getTransactionByHash"===e.t0?48:"eth_getTransactionReceipt"===e.t0?61:"eth_estimateGas"===e.t0?72:"eth_call"===e.t0?73:"eth_getLogs"===e.t0?74:"eth_gasPrice"===e.t0?75:"wallet_getPermissions"===e.t0?76:"wallet_requestPermissions"===e.t0?77:"safe_setSettings"===e.t0?78:79;break;case 4:return e.abrupt("return",[this.safe.safeAddress]);case 5:return e.abrupt("return","0x".concat(this.chainId.toString(16)));case 6:if(s=r(a,2),u=s[0],c=s[1],this.safe.safeAddress.toLowerCase()===c.toLowerCase()){e.next=9;break}throw new Error("The address or message hash is invalid");case 9:return e.next=11,this.sdk.txs.signMessage(u);case 11:return l=e.sent,d="signature"in l?l.signature:void 0,e.abrupt("return",d||"0x");case 14:if(p=r(a,2),h=p[0],v=p[1],this.safe.safeAddress.toLowerCase()===h.toLowerCase()&&v.startsWith("0x")){e.next=17;break}throw new Error("The address or message hash is invalid");case 17:return e.next=19,this.sdk.txs.signMessage(v);case 19:return m=e.sent,g="signature"in m?m.signature:void 0,e.abrupt("return",g||"0x");case 22:if(y=r(a,2),b=y[0],w=y[1],x="string"===typeof w?JSON.parse(w):w,this.safe.safeAddress.toLowerCase()===b.toLowerCase()){e.next=26;break}throw new Error("The address is invalid");case 26:return e.next=28,this.sdk.txs.signTypedMessage(x);case 28:return k=e.sent,_="signature"in k?k.signature:void 0,e.abrupt("return",_||"0x");case 31:return"string"===typeof(E=Object.assign({value:"0",data:"0x"},a[0])).gas&&E.gas.startsWith("0x")&&(E.gas=parseInt(E.gas,16)),e.next=35,this.sdk.txs.send({txs:[E],params:{safeTxGas:E.gas}});case 35:return A=e.sent,this.submittedTxs.set(A.safeTxHash,{from:this.safe.safeAddress,hash:A.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:E.data,value:E.value,to:E.to,blockHash:null,blockNumber:null,transactionIndex:null}),e.abrupt("return",A.safeTxHash);case 38:return e.next=40,this.sdk.eth.getBlockByNumber(["latest"]);case 40:return S=e.sent,e.abrupt("return",S.number);case 42:return e.abrupt("return",this.sdk.eth.getBalance([(0,f.getLowerCase)(a[0]),a[1]]));case 43:return e.abrupt("return",this.sdk.eth.getCode([(0,f.getLowerCase)(a[0]),a[1]]));case 44:return e.abrupt("return",this.sdk.eth.getTransactionCount([(0,f.getLowerCase)(a[0]),a[1]]));case 45:return e.abrupt("return",this.sdk.eth.getStorageAt([(0,f.getLowerCase)(a[0]),a[1],a[2]]));case 46:return e.abrupt("return",this.sdk.eth.getBlockByNumber([a[0],a[1]]));case 47:return e.abrupt("return",this.sdk.eth.getBlockByHash([a[0],a[1]]));case 48:return O=a[0],e.prev=49,e.next=52,this.sdk.txs.getBySafeTxHash(O);case 52:T=e.sent,O=T.txHash||O,e.next=58;break;case 56:e.prev=56,e.t1=e.catch(49);case 58:if(!this.submittedTxs.has(O)){e.next=60;break}return e.abrupt("return",this.submittedTxs.get(O));case 60:return e.abrupt("return",this.sdk.eth.getTransactionByHash([O]).then((function(e){return e&&(e.hash=a[0]),e})));case 61:return P=a[0],e.prev=62,e.next=65,this.sdk.txs.getBySafeTxHash(P);case 65:C=e.sent,P=C.txHash||P,e.next=71;break;case 69:e.prev=69,e.t2=e.catch(62);case 71:return e.abrupt("return",this.sdk.eth.getTransactionReceipt([P]).then((function(e){return e&&(e.transactionHash=a[0]),e})));case 72:return e.abrupt("return",this.sdk.eth.getEstimateGas(a[0]));case 73:return e.abrupt("return",this.sdk.eth.call([a[0],a[1]]));case 74:return e.abrupt("return",this.sdk.eth.getPastLogs([a[0]]));case 75:return e.abrupt("return",this.sdk.eth.getGasPrice());case 76:return e.abrupt("return",this.sdk.wallet.getPermissions());case 77:return e.abrupt("return",this.sdk.wallet.requestPermissions(a[0]));case 78:return e.abrupt("return",this.sdk.eth.setSafeSettings([a[0]]));case 79:throw Error('"'.concat(t.method,'" not implemented'));case 80:case"end":return e.stop()}}),e,this,[[49,56],[62,69]])})));return function(t){return e.apply(this,arguments)}}()},{key:"send",value:function(e,t){e||t("Undefined request"),this.request(e).then((function(n){return t(null,{jsonrpc:"2.0",id:e.id,result:n})})).catch((function(e){return t(e,null)}))}}]),n}(l.EventEmitter);t.SafeAppProvider=d},26869:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLowerCase=void 0,t.getLowerCase=function(e){return e?e.toLowerCase():e}},59103:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0});var s=n(62321),u=r((function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i(this,e),this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer="undefined"===typeof window,this.isValidMessage=function(e){var n=e.origin,r=e.data,i=e.source,o=!r,a=!t.isServer&&i===window.parent,s=("undefined"!==typeof r.version&&parseInt(r.version.split(".")[0]))>=1,u=!0;return Array.isArray(t.allowedOrigins)&&(u=void 0!==t.allowedOrigins.find((function(e){return e.test(n)}))),!o&&a&&s&&u},this.logIncomingMessage=function(e){console.info("Safe Apps SDK v1: A message was received from origin ".concat(e.origin,". "),e.data)},this.onParentMessage=function(e){t.isValidMessage(e)&&(t.debugMode&&t.logIncomingMessage(e),t.handleIncomingMessage(e.data))},this.handleIncomingMessage=function(e){var n=e.id,r=t.callbacks.get(n);r&&(r(e),t.callbacks.delete(n))},this.send=function(e,n){var r=s.MessageFormatter.makeRequest(e,n);if(t.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(r,"*"),new Promise((function(e,n){t.callbacks.set(r.id,(function(t){t.success?e(t):n(new Error(t.error))}))}))},this.allowedOrigins=n,this.debugMode=r,this.isServer||window.addEventListener("message",this.onParentMessage)}));t.default=u,a(n(29117),t)},62321:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default;Object.defineProperty(t,"__esModule",{value:!0}),t.MessageFormatter=void 0;var o=n(72605),a=n(46773),s=r((function e(){i(this,e)}));t.MessageFormatter=s,s.makeRequest=function(e,t){return{id:(0,a.generateRequestId)(),method:e,params:t,env:{sdkVersion:(0,o.getSDKVersion)()}}},s.makeResponse=function(e,t,n){return{id:e,success:!0,version:n,data:t}},s.makeErrorResponse=function(e,t,n){return{id:e,success:!1,error:t,version:n}}},29117:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RestrictedMethods=t.Methods=void 0,function(e){e.sendTransactions="sendTransactions",e.rpcCall="rpcCall",e.getChainInfo="getChainInfo",e.getSafeInfo="getSafeInfo",e.getTxBySafeTxHash="getTxBySafeTxHash",e.getSafeBalances="getSafeBalances",e.signMessage="signMessage",e.signTypedMessage="signTypedMessage",e.getEnvironmentInfo="getEnvironmentInfo",e.getOffChainSignature="getOffChainSignature",e.requestAddressBook="requestAddressBook",e.wallet_getPermissions="wallet_getPermissions",e.wallet_requestPermissions="wallet_requestPermissions"}(t.Methods||(t.Methods={})),function(e){e.requestAddressBook="requestAddressBook"}(t.RestrictedMethods||(t.RestrictedMethods={}))},46773:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateRequestId=void 0;var n=function(e){return e.toString(16).padStart(2,"0")};t.generateRequestId=function(){return"undefined"!==typeof window?function(e){var t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,n).join("")}(10):(new Date).getTime().toString(36)}},53477:function(e,t,n){"use strict";var r=n(17061).default,i=n(38416).default,o=n(17156).default;Object.defineProperty(t,"__esModule",{value:!0});var a=n(54330),s=n(78953),u=function(e,t){return t.some((function(t){return t.parentCapability===e}))};t.default=function(){return function(e,t,n){var c=n.value;return n.value=o(r().mark((function e(){var n,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new a.Wallet(this.communicator),e.next=3,n.getPermissions();case 3:if(o=e.sent,u(t,o)){e.next=8;break}return e.next=7,n.requestPermissions([i({},t,{})]);case 7:o=e.sent;case 8:if(u(t,o)){e.next=10;break}throw new s.PermissionsError("Permissions rejected",s.PERMISSIONS_REQUEST_REJECTED);case 10:return e.abrupt("return",c.apply(this));case 11:case"end":return e.stop()}}),e,this)}))),n}}},78729:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RPC_CALLS=void 0,t.RPC_CALLS={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"}},7226:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Eth=void 0;var s=n(78729),u=n(29117),c={defaultBlockParam:function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"latest"},returnFullTxObjectParam:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]},blockNumberToHex:function(e){return Number.isInteger(e)?"0x".concat(e.toString(16)):e}},l=function(){function e(t){var n=this;o(this,e),this.communicator=t,this.call=this.buildRequest({call:s.RPC_CALLS.eth_call,formatters:[null,c.defaultBlockParam]}),this.getBalance=this.buildRequest({call:s.RPC_CALLS.eth_getBalance,formatters:[null,c.defaultBlockParam]}),this.getCode=this.buildRequest({call:s.RPC_CALLS.eth_getCode,formatters:[null,c.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:s.RPC_CALLS.eth_getStorageAt,formatters:[null,c.blockNumberToHex,c.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:s.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:s.RPC_CALLS.eth_getBlockByHash,formatters:[null,c.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:s.RPC_CALLS.eth_getBlockByNumber,formatters:[c.blockNumberToHex,c.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:s.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:s.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:s.RPC_CALLS.eth_getTransactionCount,formatters:[null,c.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:s.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=function(e){return n.buildRequest({call:s.RPC_CALLS.eth_estimateGas})([e])},this.setSafeSettings=this.buildRequest({call:s.RPC_CALLS.safe_setSettings})}return a(e,[{key:"buildRequest",value:function(e){var t=this,n=e.call,o=e.formatters;return function(){var e=i(r().mark((function e(i){var a,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o&&Array.isArray(i)&&o.forEach((function(e,t){e&&(i[t]=e(i[t]))})),a={call:n,params:i||[]},e.next=4,t.communicator.send(u.Methods.rpcCall,a);case 4:return s=e.sent,e.abrupt("return",s.data);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}]),e}();t.Eth=l},38290:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getSDKVersion=void 0;var a=o(n(44597));t.default=a.default,i(n(44597),t),i(n(20951),t),i(n(29117),t),i(n(62321),t);var s=n(72605);Object.defineProperty(t,"getSDKVersion",{enumerable:!0,get:function(){return s.getSDKVersion}})},11112:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default,s=this&&this.__decorate||function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Safe=void 0;var c=n(4590),l=n(82436),f=n(29117),d=n(78729),p=n(20951),h=u(n(53477)),v=function(){function e(t){o(this,e),this.communicator=t}return a(e,[{key:"getChainInfo",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.communicator.send(f.Methods.getChainInfo,void 0);case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getInfo",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.communicator.send(f.Methods.getSafeInfo,void 0);case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"experimental_getBalances",value:function(){var e=i(r().mark((function e(){var t,n,i,o=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(o.length>0&&void 0!==o[0]?o[0]:{}).currency,n=void 0===t?"usd":t,e.next=3,this.communicator.send(f.Methods.getSafeBalances,{currency:n});case 3:return i=e.sent,e.abrupt("return",i.data);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"check1271Signature",value:function(){var e=i(r().mark((function e(t){var n,i,o,a,s,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:"0x",e.next=3,this.getInfo();case 3:return i=e.sent,o=(0,c.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,n]}),a={call:d.RPC_CALLS.eth_call,params:[{to:i.safeAddress,data:o},"latest"]},e.prev=6,e.next=9,this.communicator.send(f.Methods.rpcCall,a);case 9:return s=e.sent,e.abrupt("return",s.data.slice(0,10).toLowerCase()===l.MAGIC_VALUE);case 13:return e.prev=13,e.t0=e.catch(6),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,this,[[6,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"check1271SignatureBytes",value:function(){var e=i(r().mark((function e(t){var n,i,o,a,s,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:"0x",e.next=3,this.getInfo();case 3:return i=e.sent,o=(0,c.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,n]}),a={call:d.RPC_CALLS.eth_call,params:[{to:i.safeAddress,data:o},"latest"]},e.prev=6,e.next=9,this.communicator.send(f.Methods.rpcCall,a);case 9:return s=e.sent,e.abrupt("return",s.data.slice(0,10).toLowerCase()===l.MAGIC_VALUE_BYTES);case 13:return e.prev=13,e.t0=e.catch(6),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,this,[[6,13]])})));return function(t){return e.apply(this,arguments)}}()},{key:"calculateMessageHash",value:function(e){return(0,c.hashMessage)(e)}},{key:"calculateTypedMessageHash",value:function(e){var t="object"===typeof e.domain.chainId?e.domain.chainId.toNumber():Number(e.domain.chainId),n=e.primaryType;if(!n){var r=Object.values(e.types),i=Object.keys(e.types).filter((function(e){return r.every((function(t){return t.every((function(t){return t.type.replace("[","").replace("]","")!==e}))}))}));if(0===i.length||i.length>1)throw new Error("Please specify primaryType");n=i[0]}return(0,c.hashTypedData)({message:e.message,domain:Object.assign(Object.assign({},e.domain),{chainId:t,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt}),types:e.types,primaryType:n})}},{key:"getOffChainSignature",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.communicator.send(f.Methods.getOffChainSignature,t);case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isMessageSigned",value:function(){var e=i(r().mark((function e(t){var n,o,a,s=this,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=u.length>1&&void 0!==u[1]?u[1]:"0x","string"===typeof t&&(o=function(){var e=i(r().mark((function e(){var i,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.calculateMessageHash(t),e.next=3,s.isMessageHashSigned(i,n);case 3:return o=e.sent,e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),(0,p.isObjectEIP712TypedData)(t)&&(o=function(){var e=i(r().mark((function e(){var i,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.calculateTypedMessageHash(t),e.next=3,s.isMessageHashSigned(i,n);case 3:return o=e.sent,e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),!o){e.next=8;break}return e.next=6,o();case 6:return a=e.sent,e.abrupt("return",a);case 8:throw new Error("Invalid message type");case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"isMessageHashSigned",value:function(){var e=i(r().mark((function e(t){var n,i,o,a,s,u=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=u.length>1&&void 0!==u[1]?u[1]:"0x",i=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)],o=0,a=i;case 3:if(!(o0&&void 0!==arguments[0]?arguments[0]:{};i(this,e);var n=t.allowedDomains,r=void 0===n?null:n,o=t.debug,f=void 0!==o&&o;this.communicator=new a.default(r,f),this.eth=new u.Eth(this.communicator),this.txs=new s.TXs(this.communicator),this.safe=new c.Safe(this.communicator),this.wallet=new l.Wallet(this.communicator)}));t.default=f},75284:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.TXs=void 0;var s=n(29117),u=n(20951),c=function(){function e(t){o(this,e),this.communicator=t}return a(e,[{key:"getBySafeTxHash",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error("Invalid safeTxHash");case 2:return e.next=4,this.communicator.send(s.Methods.getTxBySafeTxHash,{safeTxHash:t});case 4:return n=e.sent,e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signMessage",value:function(){var e=i(r().mark((function e(t){var n,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={message:t},e.next=3,this.communicator.send(s.Methods.signMessage,n);case 3:return i=e.sent,e.abrupt("return",i.data);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signTypedMessage",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,u.isObjectEIP712TypedData)(t)){e.next=2;break}throw new Error("Invalid typed data");case 2:return e.next=4,this.communicator.send(s.Methods.signTypedMessage,{typedData:t});case 4:return n=e.sent,e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=i(r().mark((function e(t){var n,i,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.txs,i=t.params,n&&n.length){e.next=3;break}throw new Error("No transactions were passed");case 3:return o={txs:n,params:i},e.next=6,this.communicator.send(s.Methods.sendTransactions,o);case 6:return a=e.sent,e.abrupt("return",a.data);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();t.TXs=c},77906:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransferDirection=t.TransactionStatus=t.TokenType=t.Operation=void 0;var r=n(23422);Object.defineProperty(t,"Operation",{enumerable:!0,get:function(){return r.Operation}}),Object.defineProperty(t,"TokenType",{enumerable:!0,get:function(){return r.TokenType}}),Object.defineProperty(t,"TransactionStatus",{enumerable:!0,get:function(){return r.TransactionStatus}}),Object.defineProperty(t,"TransferDirection",{enumerable:!0,get:function(){return r.TransferDirection}})},20951:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(11947),t),i(n(67740),t),i(n(77906),t),i(n(49453),t)},49453:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(29117)},78953:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default,o=n(66115).default,a=n(61655).default,s=n(26389).default,u=n(33496).default;Object.defineProperty(t,"__esModule",{value:!0}),t.PermissionsError=t.PERMISSIONS_REQUEST_REJECTED=void 0,t.PERMISSIONS_REQUEST_REJECTED=4001;var c=function(e){a(n,e);var t=s(n);function n(e,r,a){var s;return i(this,n),(s=t.call(this,e)).code=r,s.data=a,Object.setPrototypeOf(o(s),n.prototype),s}return r(n)}(u(Error));t.PermissionsError=c},67740:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},11947:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectEIP712TypedData=void 0;t.isObjectEIP712TypedData=function(e){return"object"===typeof e&&null!=e&&"domain"in e&&"types"in e&&"message"in e}},72605:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getSDKVersion=void 0;var i=r(n(29242));t.getSDKVersion=function(){return i.default.version.split("-")[0]}},54330:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=void 0;var s=n(29117),u=n(78953),c=function(){function e(t){o(this,e),this.communicator=t}return a(e,[{key:"getPermissions",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.communicator.send(s.Methods.wallet_getPermissions,void 0);case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"requestPermissions",value:function(){var e=i(r().mark((function e(t){var n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isPermissionRequestValid(t)){e.next=2;break}throw new u.PermissionsError("Permissions request is invalid",u.PERMISSIONS_REQUEST_REJECTED);case 2:return e.prev=2,e.next=5,this.communicator.send(s.Methods.wallet_requestPermissions,t);case 5:return n=e.sent,e.abrupt("return",n.data);case 9:throw e.prev=9,e.t0=e.catch(2),new u.PermissionsError("Permissions rejected",u.PERMISSIONS_REQUEST_REJECTED);case 12:case"end":return e.stop()}}),e,this,[[2,9]])})));return function(t){return e.apply(this,arguments)}}()},{key:"isPermissionRequestValid",value:function(e){return e.every((function(e){return"object"===typeof e&&Object.keys(e).every((function(e){return!!Object.values(s.RestrictedMethods).includes(e)}))}))}}]),e}();t.Wallet=c},31883:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BASE_URL=void 0,t.DEFAULT_BASE_URL="https://safe-client.safe.global"},80042:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEndpoint=t.postEndpoint=void 0;var r=n(26301);function i(e,t,n,i){var o=(0,r.insertParams)(t,n),a=(0,r.stringifyQuery)(i);return"".concat(e).concat(o).concat(a)}t.postEndpoint=function(e,t,n){var o=i(e,t,null===n||void 0===n?void 0:n.path,null===n||void 0===n?void 0:n.query);return(0,r.fetchData)(o,null===n||void 0===n?void 0:n.body)},t.getEndpoint=function(e,t,n,o){if(o)return(0,r.fetchData)(o);var a=i(e,t,null===n||void 0===n?void 0:n.path,null===n||void 0===n?void 0:n.query);return(0,r.fetchData)(a)}},23422:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.getDelegates=t.confirmSafeMessage=t.proposeSafeMessage=t.getSafeMessage=t.getSafeMessages=t.getDecodedData=t.getMasterCopies=t.getSafeApps=t.getChainConfig=t.getChainsConfig=t.proposeTransaction=t.postSafeGasEstimation=t.getTransactionDetails=t.getTransactionQueue=t.getTransactionHistory=t.getCollectiblesPage=t.getCollectibles=t.getOwnedSafes=t.getFiatCurrencies=t.getBalances=t.getMultisigTransactions=t.getModuleTransactions=t.getIncomingTransfers=t.getSafeInfo=t.setBaseUrl=void 0;var o=n(80042),a=n(31883);i(n(80641),t),i(n(68496),t),i(n(52498),t),i(n(47413),t),i(n(67874),t),i(n(20691),t),i(n(71309),t),i(n(17542),t);var s=a.DEFAULT_BASE_URL;t.setBaseUrl=function(e){s=e},t.getSafeInfo=function(e,t){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}",{path:{chainId:e,address:t}})},t.getIncomingTransfers=function(e,t,n,r){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/incoming-transfers/",{path:{chainId:e,address:t},query:n},r)},t.getModuleTransactions=function(e,t,n,r){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/module-transactions/",{path:{chainId:e,address:t},query:n},r)},t.getMultisigTransactions=function(e,t,n,r){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/multisig-transactions/",{path:{chainId:e,address:t},query:n},r)},t.getBalances=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"usd",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/balances/{currency}",{path:{chainId:e,address:t,currency:n},query:r})},t.getFiatCurrencies=function(){return(0,o.getEndpoint)(s,"/v1/balances/supported-fiat-codes")},t.getOwnedSafes=function(e,t){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/owners/{address}/safes",{path:{chainId:e,address:t}})},t.getCollectibles=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:e,address:t},query:n})},t.getCollectiblesPage=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;return(0,o.getEndpoint)(s,"/v2/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:e,address:t},query:n},r)},t.getTransactionHistory=function(e,t,n){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/transactions/history",{path:{chainId:e,safe_address:t},query:{}},n)},t.getTransactionQueue=function(e,t,n,r){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/transactions/queued",{path:{chainId:e,safe_address:t},query:{trusted:r}},n)},t.getTransactionDetails=function(e,t){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/transactions/{transactionId}",{path:{chainId:e,transactionId:t}})},t.postSafeGasEstimation=function(e,t,n){return(0,o.postEndpoint)(s,"/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations",{path:{chainId:e,safe_address:t},body:n})},t.proposeTransaction=function(e,t,n){return(0,o.postEndpoint)(s,"/v1/chains/{chainId}/transactions/{safe_address}/propose",{path:{chainId:e,safe_address:t},body:n})},t.getChainsConfig=function(e){return(0,o.getEndpoint)(s,"/v1/chains",{query:e})},t.getChainConfig=function(e){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}",{path:{chainId:e}})},t.getSafeApps=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safe-apps",{path:{chainId:e},query:t})},t.getMasterCopies=function(e){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/about/master-copies",{path:{chainId:e}})},t.getDecodedData=function(e,t,n){return(0,o.postEndpoint)(s,"/v1/chains/{chainId}/data-decoder",{path:{chainId:e},body:{data:t,to:n}})},t.getSafeMessages=function(e,t,n){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:e,safe_address:t},query:{}},n)},t.getSafeMessage=function(e,t){return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/messages/{message_hash}",{path:{chainId:e,message_hash:t}})},t.proposeSafeMessage=function(e,t,n){return(0,o.postEndpoint)(s,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:e,safe_address:t},body:n})},t.confirmSafeMessage=function(e,t,n){return(0,o.postEndpoint)(s,"/v1/chains/{chainId}/messages/{message_hash}/signatures",{path:{chainId:e,message_hash:t},body:n})},t.getDelegates=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.getEndpoint)(s,"/v1/chains/{chainId}/delegates",{path:{chainId:e},query:t})}},47413:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FEATURES=t.GAS_PRICE_TYPE=t.RPC_AUTHENTICATION=void 0,function(e){e.API_KEY_PATH="API_KEY_PATH",e.NO_AUTHENTICATION="NO_AUTHENTICATION",e.UNKNOWN="UNKNOWN"}(t.RPC_AUTHENTICATION||(t.RPC_AUTHENTICATION={})),function(e){e.ORACLE="ORACLE",e.FIXED="FIXED",e.FIXED_1559="FIXED1559",e.UNKNOWN="UNKNOWN"}(t.GAS_PRICE_TYPE||(t.GAS_PRICE_TYPE={})),function(e){e.ERC721="ERC721",e.SAFE_APPS="SAFE_APPS",e.CONTRACT_INTERACTION="CONTRACT_INTERACTION",e.DOMAIN_LOOKUP="DOMAIN_LOOKUP",e.SPENDING_LIMIT="SPENDING_LIMIT",e.EIP1559="EIP1559",e.SAFE_TX_GAS_OPTIONAL="SAFE_TX_GAS_OPTIONAL",e.TX_SIMULATION="TX_SIMULATION",e.EIP1271="EIP1271"}(t.FEATURES||(t.FEATURES={}))},67874:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenType=void 0,function(e){e.ERC20="ERC20",e.ERC721="ERC721",e.NATIVE_TOKEN="NATIVE_TOKEN"}(t.TokenType||(t.TokenType={}))},71309:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},20691:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68496:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeAppSocialPlatforms=t.SafeAppFeatures=t.SafeAppAccessPolicyTypes=void 0,function(e){e.NoRestrictions="NO_RESTRICTIONS",e.DomainAllowlist="DOMAIN_ALLOWLIST"}(t.SafeAppAccessPolicyTypes||(t.SafeAppAccessPolicyTypes={})),function(e){e.BATCHED_TRANSACTIONS="BATCHED_TRANSACTIONS"}(t.SafeAppFeatures||(t.SafeAppFeatures={})),function(e){e.TWITTER="TWITTER",e.GITHUB="GITHUB",e.DISCORD="DISCORD"}(t.SafeAppSocialPlatforms||(t.SafeAppSocialPlatforms={}))},80641:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationVersionState=void 0,function(e){e.UP_TO_DATE="UP_TO_DATE",e.OUTDATED="OUTDATED",e.UNKNOWN="UNKNOWN"}(t.ImplementationVersionState||(t.ImplementationVersionState={}))},17542:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SafeMessageStatus=t.SafeMessageListItemType=void 0,function(e){e.DATE_LABEL="DATE_LABEL",e.MESSAGE="MESSAGE"}(t.SafeMessageListItemType||(t.SafeMessageListItemType={})),function(e){e.NEEDS_CONFIRMATION="NEEDS_CONFIRMATION",e.CONFIRMED="CONFIRMED"}(t.SafeMessageStatus||(t.SafeMessageStatus={}))},52498:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LabelValue=t.DetailedExecutionInfoType=t.TransactionListItemType=t.ConflictType=t.TransactionInfoType=t.SettingsInfoType=t.TransactionTokenType=t.TransferDirection=t.TransactionStatus=t.Operation=void 0,function(e){e[e.CALL=0]="CALL",e[e.DELEGATE=1]="DELEGATE"}(t.Operation||(t.Operation={})),function(e){e.AWAITING_CONFIRMATIONS="AWAITING_CONFIRMATIONS",e.AWAITING_EXECUTION="AWAITING_EXECUTION",e.CANCELLED="CANCELLED",e.FAILED="FAILED",e.SUCCESS="SUCCESS"}(t.TransactionStatus||(t.TransactionStatus={})),function(e){e.INCOMING="INCOMING",e.OUTGOING="OUTGOING",e.UNKNOWN="UNKNOWN"}(t.TransferDirection||(t.TransferDirection={})),function(e){e.ERC20="ERC20",e.ERC721="ERC721",e.NATIVE_COIN="NATIVE_COIN"}(t.TransactionTokenType||(t.TransactionTokenType={})),function(e){e.SET_FALLBACK_HANDLER="SET_FALLBACK_HANDLER",e.ADD_OWNER="ADD_OWNER",e.REMOVE_OWNER="REMOVE_OWNER",e.SWAP_OWNER="SWAP_OWNER",e.CHANGE_THRESHOLD="CHANGE_THRESHOLD",e.CHANGE_IMPLEMENTATION="CHANGE_IMPLEMENTATION",e.ENABLE_MODULE="ENABLE_MODULE",e.DISABLE_MODULE="DISABLE_MODULE",e.SET_GUARD="SET_GUARD",e.DELETE_GUARD="DELETE_GUARD"}(t.SettingsInfoType||(t.SettingsInfoType={})),function(e){e.TRANSFER="Transfer",e.SETTINGS_CHANGE="SettingsChange",e.CUSTOM="Custom",e.CREATION="Creation"}(t.TransactionInfoType||(t.TransactionInfoType={})),function(e){e.NONE="None",e.HAS_NEXT="HasNext",e.END="End"}(t.ConflictType||(t.ConflictType={})),function(e){e.TRANSACTION="TRANSACTION",e.LABEL="LABEL",e.CONFLICT_HEADER="CONFLICT_HEADER",e.DATE_LABEL="DATE_LABEL"}(t.TransactionListItemType||(t.TransactionListItemType={})),function(e){e.MULTISIG="MULTISIG",e.MODULE="MODULE"}(t.DetailedExecutionInfoType||(t.DetailedExecutionInfoType={})),function(e){e.Queued="Queued",e.Next="Next"}(t.LabelValue||(t.LabelValue={}))},26301:function(e,t,n){"use strict";var r=n(17061).default,i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchData=t.stringifyQuery=t.insertParams=void 0;var a=o(n(71652));t.insertParams=function(e,t){return t?Object.keys(t).reduce((function(e,n){return function(e,t,n){return e.replace(new RegExp("\\{".concat(t,"\\}"),"g"),n)}(e,n,String(t[n]))}),e):e},t.stringifyQuery=function(e){if(!e)return"";var t=new URLSearchParams;Object.keys(e).forEach((function(n){null!=e[n]&&t.append(n,String(e[n]))}));var n=t.toString();return n?"?".concat(n):""},t.fetchData=function(e,t){return i(this,void 0,void 0,r().mark((function n(){var i,o,s,u;return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null!=t&&(i={method:"POST",body:"string"===typeof t?t:JSON.stringify(t),headers:{"Content-Type":"application/json"}}),n.next=3,(0,a.default)(e,i);case 3:return o=n.sent,n.prev=4,n.next=7,o.json();case 7:s=n.sent,n.next=14;break;case 10:if(n.prev=10,n.t0=n.catch(4),!o.headers||"0"===o.headers.get("content-length")){n.next=14;break}throw new Error("Invalid response content: ".concat(o.statusText));case 14:if(o.ok){n.next=17;break}throw u="object"===typeof(r=s)&&null!==r&&"code"in r&&"message"in r?"".concat(s.code,": ").concat(s.message):o.statusText,new Error(u);case 17:return n.abrupt("return",s);case 18:case"end":return n.stop()}var r}),n,null,[[4,10]])})))}},71652:function(e,t){var n="undefined"!==typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!==typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=h(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"===typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"===typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=h(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function x(e){var t=new d;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t}function k(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},k.error=function(){var e=new k(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];k.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new k(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(A){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise((function(r,o){var a=new b(e,n);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:x(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;r(new k(t,e))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send("undefined"===typeof a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=d,e.Request=b,e.Response=k),t.Headers=d,t.Request=b,t.Response=k,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},79734:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(44654);function i(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>8,t[n+1]=e>>>0,t}function o(e,t,n){return void 0===t&&(t=new Uint8Array(2)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t}function a(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function s(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function u(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function c(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function l(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>24,t[n+1]=e>>>16,t[n+2]=e>>>8,t[n+3]=e>>>0,t}function f(e,t,n){return void 0===t&&(t=new Uint8Array(4)),void 0===n&&(n=0),t[n+0]=e>>>0,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24,t}function d(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),l(e/4294967296>>>0,t,n),l(e>>>0,t,n+4),t}function p(e,t,n){return void 0===t&&(t=new Uint8Array(8)),void 0===n&&(n=0),f(e>>>0,t,n),f(e/4294967296>>>0,t,n+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=o,t.writeInt16LE=o,t.readInt32BE=a,t.readUint32BE=s,t.readInt32LE=u,t.readUint32LE=c,t.writeUint32BE=l,t.writeInt32BE=l,t.writeUint32LE=f,t.writeInt32LE=f,t.readInt64BE=function(e,t){void 0===t&&(t=0);var n=a(e,t),r=a(e,t+4);return 4294967296*n+r-4294967296*(r>>31)},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*s(e,t)+s(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var n=u(e,t);return 4294967296*u(e,t+4)+n-4294967296*(n>>31)},t.readUint64LE=function(e,t){void 0===t&&(t=0);var n=c(e,t);return 4294967296*c(e,t+4)+n},t.writeUint64BE=d,t.writeInt64BE=d,t.writeUint64LE=p,t.writeInt64LE=p,t.readUintBE=function(e,t,n){if(void 0===n&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var r=0,i=1,o=e/8+n-1;o>=n;o--)r+=t[o]*i,i*=256;return r},t.readUintLE=function(e,t,n){if(void 0===n&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var r=0,i=1,o=n;o=i;a--)n[a]=t/o&255,o*=256;return n},t.writeUintLE=function(e,t,n,i){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!r.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var o=1,a=i;a>>16|j<<16)|0)>>>20|A<<12,S=(S^=C=C+(N=(N^=k=k+S|0)>>>16|N<<16)|0)>>>20|S<<12,O=(O^=I=I+(M=(M^=_=_+O|0)>>>16|M<<16)|0)>>>20|O<<12,T=(T^=R=R+(L=(L^=E=E+T|0)>>>16|L<<16)|0)>>>20|T<<12,O=(O^=I=I+(M=(M^=_=_+O|0)>>>24|M<<8)|0)>>>25|O<<7,T=(T^=R=R+(L=(L^=E=E+T|0)>>>24|L<<8)|0)>>>25|T<<7,S=(S^=C=C+(N=(N^=k=k+S|0)>>>24|N<<8)|0)>>>25|S<<7,A=(A^=P=P+(j=(j^=x=x+A|0)>>>24|j<<8)|0)>>>25|A<<7,S=(S^=I=I+(L=(L^=x=x+S|0)>>>16|L<<16)|0)>>>20|S<<12,O=(O^=R=R+(j=(j^=k=k+O|0)>>>16|j<<16)|0)>>>20|O<<12,T=(T^=P=P+(N=(N^=_=_+T|0)>>>16|N<<16)|0)>>>20|T<<12,A=(A^=C=C+(M=(M^=E=E+A|0)>>>16|M<<16)|0)>>>20|A<<12,T=(T^=P=P+(N=(N^=_=_+T|0)>>>24|N<<8)|0)>>>25|T<<7,A=(A^=C=C+(M=(M^=E=E+A|0)>>>24|M<<8)|0)>>>25|A<<7,O=(O^=R=R+(j=(j^=k=k+O|0)>>>24|j<<8)|0)>>>25|O<<7,S=(S^=I=I+(L=(L^=x=x+S|0)>>>24|L<<8)|0)>>>25|S<<7;r.writeUint32LE(x+i|0,e,0),r.writeUint32LE(k+a|0,e,4),r.writeUint32LE(_+s|0,e,8),r.writeUint32LE(E+u|0,e,12),r.writeUint32LE(A+c|0,e,16),r.writeUint32LE(S+l|0,e,20),r.writeUint32LE(O+f|0,e,24),r.writeUint32LE(T+d|0,e,28),r.writeUint32LE(P+p|0,e,32),r.writeUint32LE(C+h|0,e,36),r.writeUint32LE(I+v|0,e,40),r.writeUint32LE(R+m|0,e,44),r.writeUint32LE(j+g|0,e,48),r.writeUint32LE(N+y|0,e,52),r.writeUint32LE(M+b|0,e,56),r.writeUint32LE(L+w|0,e,60)}function s(e,t,n,r,o){if(void 0===o&&(o=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(r.length>>=8,t++;if(r>0)throw new Error("ChaCha: counter overflow")}t.streamXOR=s,t.stream=function(e,t,n,r){return void 0===r&&(r=0),i.wipe(n),s(e,t,n,n,r)}},74533:function(e,t,n){"use strict";var r=n(42873),i=n(82625),o=n(63227),a=n(79734),s=n(46852);t.Cv=32,t.WH=12,t.pg=16;var u=new Uint8Array(16),c=function(){function e(e){if(this.nonceLength=t.WH,this.tagLength=t.pg,e.length!==t.Cv)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return e.prototype.seal=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var a=new Uint8Array(16);a.set(e,a.length-e.length);var s=new Uint8Array(32);r.stream(this._key,a,s,4);var u,c=t.length+this.tagLength;if(i){if(i.length!==c)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(c);return r.streamXOR(this._key,a,t,u,4),this._authenticate(u.subarray(u.length-this.tagLength,u.length),s,u.subarray(0,u.length-this.tagLength),n),o.wipe(a),u},e.prototype.open=function(e,t,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(t.length0&&s.update(u.subarray(r.length%16))),s.update(n),n.length%16>0&&s.update(u.subarray(n.length%16));var c=new Uint8Array(8);r&&a.writeUint64LE(r.length,c),s.update(c),a.writeUint64LE(n.length,c),s.update(c);for(var l=s.digest(),f=0;f>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,n){return~(e-1)&t|e-1&n},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=n,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==n(e,t)}},44519:function(e,t,n){"use strict";t.Xx=t._w=t.aP=t.KS=t.jQ=void 0;var r=n(14701),i=n(21956),o=n(63227);function a(e){var t=new Float64Array(16);if(e)for(var n=0;n>16&1),n[s-1]&=65535;n[15]=r[15]-32767-(n[14]>>16&1);var u=n[15]>>16&1;n[14]&=65535,m(r,n,1-u)}for(var c=0;c<16;c++)e[2*c]=255&r[c],e[2*c+1]=r[c]>>8}function y(e,t){for(var n=0,r=0;r<32;r++)n|=e[r]^t[r];return(1&n-1>>>8)-1}function b(e,t){var n=new Uint8Array(32),r=new Uint8Array(32);return g(n,e),g(r,t),y(n,r)}function w(e){var t=new Uint8Array(32);return g(t,e),1&t[0]}function x(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]+n[r]}function k(e,t,n){for(var r=0;r<16;r++)e[r]=t[r]-n[r]}function _(e,t,n){var r,i,o=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,p=0,h=0,v=0,m=0,g=0,y=0,b=0,w=0,x=0,k=0,_=0,E=0,A=0,S=0,O=0,T=0,P=0,C=0,I=0,R=0,j=0,N=0,M=0,L=n[0],U=n[1],D=n[2],B=n[3],F=n[4],Z=n[5],z=n[6],H=n[7],q=n[8],V=n[9],W=n[10],G=n[11],Y=n[12],K=n[13],J=n[14],Q=n[15];o+=(r=t[0])*L,a+=r*U,s+=r*D,u+=r*B,c+=r*F,l+=r*Z,f+=r*z,d+=r*H,p+=r*q,h+=r*V,v+=r*W,m+=r*G,g+=r*Y,y+=r*K,b+=r*J,w+=r*Q,a+=(r=t[1])*L,s+=r*U,u+=r*D,c+=r*B,l+=r*F,f+=r*Z,d+=r*z,p+=r*H,h+=r*q,v+=r*V,m+=r*W,g+=r*G,y+=r*Y,b+=r*K,w+=r*J,x+=r*Q,s+=(r=t[2])*L,u+=r*U,c+=r*D,l+=r*B,f+=r*F,d+=r*Z,p+=r*z,h+=r*H,v+=r*q,m+=r*V,g+=r*W,y+=r*G,b+=r*Y,w+=r*K,x+=r*J,k+=r*Q,u+=(r=t[3])*L,c+=r*U,l+=r*D,f+=r*B,d+=r*F,p+=r*Z,h+=r*z,v+=r*H,m+=r*q,g+=r*V,y+=r*W,b+=r*G,w+=r*Y,x+=r*K,k+=r*J,_+=r*Q,c+=(r=t[4])*L,l+=r*U,f+=r*D,d+=r*B,p+=r*F,h+=r*Z,v+=r*z,m+=r*H,g+=r*q,y+=r*V,b+=r*W,w+=r*G,x+=r*Y,k+=r*K,_+=r*J,E+=r*Q,l+=(r=t[5])*L,f+=r*U,d+=r*D,p+=r*B,h+=r*F,v+=r*Z,m+=r*z,g+=r*H,y+=r*q,b+=r*V,w+=r*W,x+=r*G,k+=r*Y,_+=r*K,E+=r*J,A+=r*Q,f+=(r=t[6])*L,d+=r*U,p+=r*D,h+=r*B,v+=r*F,m+=r*Z,g+=r*z,y+=r*H,b+=r*q,w+=r*V,x+=r*W,k+=r*G,_+=r*Y,E+=r*K,A+=r*J,S+=r*Q,d+=(r=t[7])*L,p+=r*U,h+=r*D,v+=r*B,m+=r*F,g+=r*Z,y+=r*z,b+=r*H,w+=r*q,x+=r*V,k+=r*W,_+=r*G,E+=r*Y,A+=r*K,S+=r*J,O+=r*Q,p+=(r=t[8])*L,h+=r*U,v+=r*D,m+=r*B,g+=r*F,y+=r*Z,b+=r*z,w+=r*H,x+=r*q,k+=r*V,_+=r*W,E+=r*G,A+=r*Y,S+=r*K,O+=r*J,T+=r*Q,h+=(r=t[9])*L,v+=r*U,m+=r*D,g+=r*B,y+=r*F,b+=r*Z,w+=r*z,x+=r*H,k+=r*q,_+=r*V,E+=r*W,A+=r*G,S+=r*Y,O+=r*K,T+=r*J,P+=r*Q,v+=(r=t[10])*L,m+=r*U,g+=r*D,y+=r*B,b+=r*F,w+=r*Z,x+=r*z,k+=r*H,_+=r*q,E+=r*V,A+=r*W,S+=r*G,O+=r*Y,T+=r*K,P+=r*J,C+=r*Q,m+=(r=t[11])*L,g+=r*U,y+=r*D,b+=r*B,w+=r*F,x+=r*Z,k+=r*z,_+=r*H,E+=r*q,A+=r*V,S+=r*W,O+=r*G,T+=r*Y,P+=r*K,C+=r*J,I+=r*Q,g+=(r=t[12])*L,y+=r*U,b+=r*D,w+=r*B,x+=r*F,k+=r*Z,_+=r*z,E+=r*H,A+=r*q,S+=r*V,O+=r*W,T+=r*G,P+=r*Y,C+=r*K,I+=r*J,R+=r*Q,y+=(r=t[13])*L,b+=r*U,w+=r*D,x+=r*B,k+=r*F,_+=r*Z,E+=r*z,A+=r*H,S+=r*q,O+=r*V,T+=r*W,P+=r*G,C+=r*Y,I+=r*K,R+=r*J,j+=r*Q,b+=(r=t[14])*L,w+=r*U,x+=r*D,k+=r*B,_+=r*F,E+=r*Z,A+=r*z,S+=r*H,O+=r*q,T+=r*V,P+=r*W,C+=r*G,I+=r*Y,R+=r*K,j+=r*J,N+=r*Q,w+=(r=t[15])*L,a+=38*(k+=r*D),s+=38*(_+=r*B),u+=38*(E+=r*F),c+=38*(A+=r*Z),l+=38*(S+=r*z),f+=38*(O+=r*H),d+=38*(T+=r*q),p+=38*(P+=r*V),h+=38*(C+=r*W),v+=38*(I+=r*G),m+=38*(R+=r*Y),g+=38*(j+=r*K),y+=38*(N+=r*J),b+=38*(M+=r*Q),o=(r=(o+=38*(x+=r*U))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),a=(r=a+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=s+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),o=(r=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(r/65536)),a=(r=a+i+65535)-65536*(i=Math.floor(r/65536)),s=(r=s+i+65535)-65536*(i=Math.floor(r/65536)),u=(r=u+i+65535)-65536*(i=Math.floor(r/65536)),c=(r=c+i+65535)-65536*(i=Math.floor(r/65536)),l=(r=l+i+65535)-65536*(i=Math.floor(r/65536)),f=(r=f+i+65535)-65536*(i=Math.floor(r/65536)),d=(r=d+i+65535)-65536*(i=Math.floor(r/65536)),p=(r=p+i+65535)-65536*(i=Math.floor(r/65536)),h=(r=h+i+65535)-65536*(i=Math.floor(r/65536)),v=(r=v+i+65535)-65536*(i=Math.floor(r/65536)),m=(r=m+i+65535)-65536*(i=Math.floor(r/65536)),g=(r=g+i+65535)-65536*(i=Math.floor(r/65536)),y=(r=y+i+65535)-65536*(i=Math.floor(r/65536)),b=(r=b+i+65535)-65536*(i=Math.floor(r/65536)),w=(r=w+i+65535)-65536*(i=Math.floor(r/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=a,e[2]=s,e[3]=u,e[4]=c,e[5]=l,e[6]=f,e[7]=d,e[8]=p,e[9]=h,e[10]=v,e[11]=m,e[12]=g,e[13]=y,e[14]=b,e[15]=w}function E(e,t){_(e,t,t)}function A(e,t){var n,r=a();for(n=0;n<16;n++)r[n]=t[n];for(n=253;n>=0;n--)E(r,r),2!==n&&4!==n&&_(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}function S(e,t){var n=a(),r=a(),i=a(),o=a(),s=a(),u=a(),c=a(),f=a(),d=a();k(n,e[1],e[0]),k(d,t[1],t[0]),_(n,n,d),x(r,e[0],e[1]),x(d,t[0],t[1]),_(r,r,d),_(i,e[3],t[3]),_(i,i,l),_(o,e[2],t[2]),x(o,o,o),k(s,r,n),k(u,o,i),x(c,o,i),x(f,r,n),_(e[0],s,u),_(e[1],f,c),_(e[2],c,u),_(e[3],s,f)}function O(e,t,n){for(var r=0;r<4;r++)m(e[r],t[r],n)}function T(e,t){var n=a(),r=a(),i=a();A(i,t[2]),_(n,t[0],i),_(r,t[1],i),g(e,r),e[31]^=w(n)<<7}function P(e,t,n){h(e[0],s),h(e[1],u),h(e[2],u),h(e[3],s);for(var r=255;r>=0;--r){var i=n[r/8|0]>>(7&r)&1;O(e,t,i),S(t,e),S(e,e),O(e,t,i)}}function C(e,t){var n=[a(),a(),a(),a()];h(n[0],f),h(n[1],d),h(n[2],u),_(n[3],f,d),P(e,n,t)}function I(e){if(e.length!==t.aP)throw new Error("ed25519: seed must be ".concat(t.aP," bytes"));var n=(0,i.hash)(e);n[0]&=248,n[31]&=127,n[31]|=64;var r=new Uint8Array(32),o=[a(),a(),a(),a()];C(o,n),T(r,o);var s=new Uint8Array(64);return s.set(e),s.set(r,32),{publicKey:r,secretKey:s}}t._w=I;var R=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function j(e,t){var n,r,i,o;for(r=63;r>=32;--r){for(n=0,i=r-32,o=r-12;i>4)*R[i],n=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=n*R[i];for(r=0;r<32;r++)t[r+1]+=t[r]>>8,e[r]=255&t[r]}function N(e){for(var t=new Float64Array(64),n=0;n<64;n++)t[n]=e[n];for(var r=0;r<64;r++)e[r]=0;j(e,t)}function M(e,t){var n=a(),r=a(),i=a(),o=a(),l=a(),f=a(),d=a();return h(e[2],u),function(e,t){for(var n=0;n<16;n++)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]&=32767}(e[1],t),E(i,e[1]),_(o,i,c),k(i,i,e[2]),x(o,e[2],o),E(l,o),E(f,l),_(d,f,l),_(n,d,i),_(n,n,o),function(e,t){var n,r=a();for(n=0;n<16;n++)r[n]=t[n];for(n=250;n>=0;n--)E(r,r),1!==n&&_(r,r,t);for(n=0;n<16;n++)e[n]=r[n]}(n,n),_(n,n,i),_(n,n,o),_(n,n,o),_(e[0],n,o),E(r,e[0]),_(r,r,o),b(r,i)&&_(e[0],e[0],p),E(r,e[0]),_(r,r,o),b(r,i)?-1:(w(e[0])===t[31]>>7&&k(e[0],s,e[0]),_(e[3],e[0],e[1]),0)}t.Xx=function(e,t){var n=new Float64Array(64),r=[a(),a(),a(),a()],o=(0,i.hash)(e.subarray(0,32));o[0]&=248,o[31]&=127,o[31]|=64;var s=new Uint8Array(64);s.set(o.subarray(32),32);var u=new i.SHA512;u.update(s.subarray(32)),u.update(t);var c=u.digest();u.clean(),N(c),C(r,c),T(s,r),u.reset(),u.update(s.subarray(0,32)),u.update(e.subarray(32)),u.update(t);var l=u.digest();N(l);for(var f=0;f<32;f++)n[f]=c[f];for(var d=0;d<32;d++)for(var p=0;p<32;p++)n[d+p]+=l[d]*o[p];return j(s.subarray(32),n),s}},15202:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return"undefined"!==typeof e.saveState&&"undefined"!==typeof e.restoreState&&"undefined"!==typeof e.cleanSavedState}},81791:function(e,t,n){"use strict";var r=n(51680),i=n(63227),o=function(){function e(e,t,n,i){void 0===n&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=r.hmac(this._hash,n,t);this._hmac=new r.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(e){for(var t=new Uint8Array(e),n=0;nthis.blockSize?this._inner.update(t).finish(n).clean():n.set(t);for(var i=0;i>>16&65535)*r+n*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},82625:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(46852),i=n(63227);t.DIGEST_LENGTH=16;var o=function(){function e(e){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var n=e[0]|e[1]<<8;this._r[0]=8191&n;var r=e[2]|e[3]<<8;this._r[1]=8191&(n>>>13|r<<3);var i=e[4]|e[5]<<8;this._r[2]=7939&(r>>>10|i<<6);var o=e[6]|e[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var a=e[8]|e[9]<<8;this._r[4]=255&(o>>>4|a<<12),this._r[5]=a>>>1&8190;var s=e[10]|e[11]<<8;this._r[6]=8191&(a>>>14|s<<2);var u=e[12]|e[13]<<8;this._r[7]=8065&(s>>>11|u<<5);var c=e[14]|e[15]<<8;this._r[8]=8191&(u>>>8|c<<8),this._r[9]=c>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,n){for(var r=this._fin?0:2048,i=this._h[0],o=this._h[1],a=this._h[2],s=this._h[3],u=this._h[4],c=this._h[5],l=this._h[6],f=this._h[7],d=this._h[8],p=this._h[9],h=this._r[0],v=this._r[1],m=this._r[2],g=this._r[3],y=this._r[4],b=this._r[5],w=this._r[6],x=this._r[7],k=this._r[8],_=this._r[9];n>=16;){var E=e[t+0]|e[t+1]<<8;i+=8191&E;var A=e[t+2]|e[t+3]<<8;o+=8191&(E>>>13|A<<3);var S=e[t+4]|e[t+5]<<8;a+=8191&(A>>>10|S<<6);var O=e[t+6]|e[t+7]<<8;s+=8191&(S>>>7|O<<9);var T=e[t+8]|e[t+9]<<8;u+=8191&(O>>>4|T<<12),c+=T>>>1&8191;var P=e[t+10]|e[t+11]<<8;l+=8191&(T>>>14|P<<2);var C=e[t+12]|e[t+13]<<8;f+=8191&(P>>>11|C<<5);var I=e[t+14]|e[t+15]<<8,R=0,j=R;j+=i*h,j+=o*(5*_),j+=a*(5*k),j+=s*(5*x),R=(j+=u*(5*w))>>>13,j&=8191,j+=c*(5*b),j+=l*(5*y),j+=f*(5*g),j+=(d+=8191&(C>>>8|I<<8))*(5*m);var N=R+=(j+=(p+=I>>>5|r)*(5*v))>>>13;N+=i*v,N+=o*h,N+=a*(5*_),N+=s*(5*k),R=(N+=u*(5*x))>>>13,N&=8191,N+=c*(5*w),N+=l*(5*b),N+=f*(5*y),N+=d*(5*g),R+=(N+=p*(5*m))>>>13,N&=8191;var M=R;M+=i*m,M+=o*v,M+=a*h,M+=s*(5*_),R=(M+=u*(5*k))>>>13,M&=8191,M+=c*(5*x),M+=l*(5*w),M+=f*(5*b),M+=d*(5*y);var L=R+=(M+=p*(5*g))>>>13;L+=i*g,L+=o*m,L+=a*v,L+=s*h,R=(L+=u*(5*_))>>>13,L&=8191,L+=c*(5*k),L+=l*(5*x),L+=f*(5*w),L+=d*(5*b);var U=R+=(L+=p*(5*y))>>>13;U+=i*y,U+=o*g,U+=a*m,U+=s*v,R=(U+=u*h)>>>13,U&=8191,U+=c*(5*_),U+=l*(5*k),U+=f*(5*x),U+=d*(5*w);var D=R+=(U+=p*(5*b))>>>13;D+=i*b,D+=o*y,D+=a*g,D+=s*m,R=(D+=u*v)>>>13,D&=8191,D+=c*h,D+=l*(5*_),D+=f*(5*k),D+=d*(5*x);var B=R+=(D+=p*(5*w))>>>13;B+=i*w,B+=o*b,B+=a*y,B+=s*g,R=(B+=u*m)>>>13,B&=8191,B+=c*v,B+=l*h,B+=f*(5*_),B+=d*(5*k);var F=R+=(B+=p*(5*x))>>>13;F+=i*x,F+=o*w,F+=a*b,F+=s*y,R=(F+=u*g)>>>13,F&=8191,F+=c*m,F+=l*v,F+=f*h,F+=d*(5*_);var Z=R+=(F+=p*(5*k))>>>13;Z+=i*k,Z+=o*x,Z+=a*w,Z+=s*b,R=(Z+=u*y)>>>13,Z&=8191,Z+=c*g,Z+=l*m,Z+=f*v,Z+=d*h;var z=R+=(Z+=p*(5*_))>>>13;z+=i*_,z+=o*k,z+=a*x,z+=s*w,R=(z+=u*b)>>>13,z&=8191,z+=c*y,z+=l*g,z+=f*m,z+=d*v,i=j=8191&(R=(R=((R+=(z+=p*h)>>>13)<<2)+R|0)+(j&=8191)|0),o=N+=R>>>=13,a=M&=8191,s=L&=8191,u=U&=8191,c=D&=8191,l=B&=8191,f=F&=8191,d=Z&=8191,p=z&=8191,t+=16,n-=16}this._h[0]=i,this._h[1]=o,this._h[2]=a,this._h[3]=s,this._h[4]=u,this._h[5]=c,this._h[6]=l,this._h[7]=f,this._h[8]=d,this._h[9]=p},e.prototype.finish=function(e,t){void 0===t&&(t=0);var n,r,i,o,a=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(n=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=n,n=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*n,n=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=n,n=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=n,a[0]=this._h[0]+5,n=a[0]>>>13,a[0]&=8191,o=1;o<10;o++)a[o]=this._h[o]+n,n=a[o]>>>13,a[o]&=8191;for(a[9]-=8192,r=(1^n)-1,o=0;o<10;o++)a[o]&=r;for(r=~r,o=0;o<10;o++)this._h[o]=this._h[o]&r|a[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,n=0,r=e.length;if(this._leftover){(t=16-this._leftover)>r&&(t=r);for(var i=0;i=16&&(t=r-r%16,this._blocks(e,n,t),n+=t,r-=t),r){for(i=0;i1&&void 0!==arguments[1]?arguments[1]:t.defaultRandomSource).randomBytes(e)}t.defaultRandomSource=new r.SystemRandomSource,t.randomBytes=a,t.randomUint32=function(){var e=a(4,arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.defaultRandomSource),n=(0,i.readUint32LE)(e);return(0,o.wipe)(e),n};var s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.defaultRandomSource;if(n.length<2)throw new Error("randomString charset is too short");if(n.length>256)throw new Error("randomString charset is too long");for(var i="",u=n.length,c=256-256%u;e>0;){for(var l=a(Math.ceil(256*e/c),r),f=0;f0;f++){var d=l[f];d1&&void 0!==arguments[1]?arguments[1]:s,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.defaultRandomSource;return u(Math.ceil(e/(Math.log(n.length)/Math.LN2)),n,r)}},93687:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserRandomSource=void 0;var o=function(){function e(){r(this,e),this.isAvailable=!1,this.isInstantiated=!1;var t="undefined"!==typeof self?self.crypto||self.msCrypto:null;t&&void 0!==t.getRandomValues&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}return i(e,[{key:"randomBytes",value:function(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");for(var t=new Uint8Array(e),n=0;n0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[n++],t--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(n=s(this._temp,this._state,e,n,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[n++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,o=t<<3,a=t%64<56?64:128;this._buffer[n]=128;for(var u=n+1;u0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.mE=o;var a=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(e,t,n,i,o){for(;o>=64;){for(var s=t[0],u=t[1],c=t[2],l=t[3],f=t[4],d=t[5],p=t[6],h=t[7],v=0;v<16;v++){var m=i+4*v;e[v]=r.readUint32BE(n,m)}for(v=16;v<64;v++){var g=e[v-2],y=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,b=((g=e[v-15])>>>7|g<<25)^(g>>>18|g<<14)^g>>>3;e[v]=(y+e[v-7]|0)+(b+e[v-16]|0)}for(v=0;v<64;v++){y=(((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&d^~f&p)|0)+(h+(a[v]+e[v]|0)|0)|0,b=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&u^s&c^u&c)|0;h=p,p=d,d=f,f=l+y|0,l=c,c=u,u=s,s=y+b|0}t[0]+=s,t[1]+=u,t[2]+=c,t[3]+=l,t[4]+=f,t[5]+=d,t[6]+=p,t[7]+=h,i+=64,o-=64}return i}t.vp=function(e){var t=new o;t.update(e);var n=t.digest();return t.clean(),n}},21956:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(79734),i=n(63227);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var o=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,n){if(void 0===n&&(n=e.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var r=0;if(this._bytesHashed+=n,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[r++],n--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(n>=this.blockSize&&(r=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,r,n),n%=this.blockSize);n>0;)this._buffer[this._bufferLength++]=e[r++],n--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,n=this._bufferLength,i=t/536870912|0,o=t<<3,a=t%128<112?128:256;this._buffer[n]=128;for(var u=n+1;u0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.stateHi),i.wipe(e.stateLo),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=o;var a=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function s(e,t,n,i,o,s,u){for(var c,l,f,d,p,h,v,m,g=n[0],y=n[1],b=n[2],w=n[3],x=n[4],k=n[5],_=n[6],E=n[7],A=i[0],S=i[1],O=i[2],T=i[3],P=i[4],C=i[5],I=i[6],R=i[7];u>=128;){for(var j=0;j<16;j++){var N=8*j+s;e[j]=r.readUint32BE(o,N),t[j]=r.readUint32BE(o,N+4)}for(j=0;j<80;j++){var M,L,U=g,D=y,B=b,F=w,Z=x,z=k,H=_,q=A,V=S,W=O,G=T,Y=P,K=C,J=I;if(p=65535&(l=R),h=l>>>16,v=65535&(c=E),m=c>>>16,p+=65535&(l=(P>>>14|x<<18)^(P>>>18|x<<14)^(x>>>9|P<<23)),h+=l>>>16,v+=65535&(c=(x>>>14|P<<18)^(x>>>18|P<<14)^(P>>>9|x<<23)),m+=c>>>16,p+=65535&(l=P&C^~P&I),h+=l>>>16,v+=65535&(c=x&k^~x&_),m+=c>>>16,c=a[2*j],p+=65535&(l=a[2*j+1]),h+=l>>>16,v+=65535&c,m+=c>>>16,c=e[j%16],h+=(l=t[j%16])>>>16,v+=65535&c,m+=c>>>16,v+=(h+=(p+=65535&l)>>>16)>>>16,p=65535&(l=d=65535&p|h<<16),h=l>>>16,v=65535&(c=f=65535&v|(m+=v>>>16)<<16),m=c>>>16,p+=65535&(l=(A>>>28|g<<4)^(g>>>2|A<<30)^(g>>>7|A<<25)),h+=l>>>16,v+=65535&(c=(g>>>28|A<<4)^(A>>>2|g<<30)^(A>>>7|g<<25)),m+=c>>>16,h+=(l=A&S^A&O^S&O)>>>16,v+=65535&(c=g&y^g&b^y&b),m+=c>>>16,M=65535&(v+=(h+=(p+=65535&l)>>>16)>>>16)|(m+=v>>>16)<<16,L=65535&p|h<<16,p=65535&(l=G),h=l>>>16,v=65535&(c=F),m=c>>>16,h+=(l=d)>>>16,v+=65535&(c=f),m+=c>>>16,y=U,b=D,w=B,x=F=65535&(v+=(h+=(p+=65535&l)>>>16)>>>16)|(m+=v>>>16)<<16,k=Z,_=z,E=H,g=M,S=q,O=V,T=W,P=G=65535&p|h<<16,C=Y,I=K,R=J,A=L,j%16===15)for(N=0;N<16;N++)c=e[N],p=65535&(l=t[N]),h=l>>>16,v=65535&c,m=c>>>16,c=e[(N+9)%16],p+=65535&(l=t[(N+9)%16]),h+=l>>>16,v+=65535&c,m+=c>>>16,f=e[(N+1)%16],p+=65535&(l=((d=t[(N+1)%16])>>>1|f<<31)^(d>>>8|f<<24)^(d>>>7|f<<25)),h+=l>>>16,v+=65535&(c=(f>>>1|d<<31)^(f>>>8|d<<24)^f>>>7),m+=c>>>16,f=e[(N+14)%16],h+=(l=((d=t[(N+14)%16])>>>19|f<<13)^(f>>>29|d<<3)^(d>>>6|f<<26))>>>16,v+=65535&(c=(f>>>19|d<<13)^(d>>>29|f<<3)^f>>>6),m+=c>>>16,m+=(v+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,e[N]=65535&v|m<<16,t[N]=65535&p|h<<16}p=65535&(l=A),h=l>>>16,v=65535&(c=g),m=c>>>16,c=n[0],h+=(l=i[0])>>>16,v+=65535&c,m+=c>>>16,m+=(v+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[0]=g=65535&v|m<<16,i[0]=A=65535&p|h<<16,p=65535&(l=S),h=l>>>16,v=65535&(c=y),m=c>>>16,c=n[1],h+=(l=i[1])>>>16,v+=65535&c,m+=c>>>16,m+=(v+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[1]=y=65535&v|m<<16,i[1]=S=65535&p|h<<16,p=65535&(l=O),h=l>>>16,v=65535&(c=b),m=c>>>16,c=n[2],h+=(l=i[2])>>>16,v+=65535&c,m+=c>>>16,m+=(v+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[2]=b=65535&v|m<<16,i[2]=O=65535&p|h<<16,p=65535&(l=T),h=l>>>16,v=65535&(c=w),m=c>>>16,c=n[3],h+=(l=i[3])>>>16,v+=65535&c,m+=c>>>16,m+=(v+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[3]=w=65535&v|m<<16,i[3]=T=65535&p|h<<16,p=65535&(l=P),h=l>>>16,v=65535&(c=x),m=c>>>16,c=n[4],h+=(l=i[4])>>>16,v+=65535&c,m+=c>>>16,m+=(v+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[4]=x=65535&v|m<<16,i[4]=P=65535&p|h<<16,p=65535&(l=C),h=l>>>16,v=65535&(c=k),m=c>>>16,c=n[5],h+=(l=i[5])>>>16,v+=65535&c,m+=c>>>16,m+=(v+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[5]=k=65535&v|m<<16,i[5]=C=65535&p|h<<16,p=65535&(l=I),h=l>>>16,v=65535&(c=_),m=c>>>16,c=n[6],h+=(l=i[6])>>>16,v+=65535&c,m+=c>>>16,m+=(v+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[6]=_=65535&v|m<<16,i[6]=I=65535&p|h<<16,p=65535&(l=R),h=l>>>16,v=65535&(c=E),m=c>>>16,c=n[7],h+=(l=i[7])>>>16,v+=65535&c,m+=c>>>16,m+=(v+=(h+=(p+=65535&l)>>>16)>>>16)>>>16,n[7]=E=65535&v|m<<16,i[7]=R=65535&p|h<<16,s+=128,u-=128}return s}t.hash=function(e){var t=new o;t.update(e);var n=t.digest();return t.clean(),n}},63227:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t=0;--w){var x=n[w>>>3]>>>(7&w)&1;c(i,a,x),c(h,v,x),l(m,i,h),f(i,i,h),l(h,a,v),f(a,a,v),p(v,m),p(g,i),d(i,h,i),d(h,a,m),l(m,i,h),f(i,i,h),p(a,i),f(h,v,g),d(i,h,s),l(i,i,v),d(h,h,i),d(i,v,g),d(v,a,r),p(a,m),c(i,a,x),c(h,v,x)}for(var k=0;k<16;k++)r[k+16]=i[k],r[k+32]=h[k],r[k+48]=a[k],r[k+64]=v[k];var _=r.subarray(32),E=r.subarray(16);!function(e,t){for(var n=o(),r=0;r<16;r++)n[r]=t[r];for(var i=253;i>=0;i--)p(n,n),2!==i&&4!==i&&d(n,n,t);for(var a=0;a<16;a++)e[a]=n[a]}(_,_),d(E,E,_);var A=new Uint8Array(32);return function(e,t){for(var n=o(),r=o(),i=0;i<16;i++)r[i]=t[i];u(r),u(r),u(r);for(var a=0;a<2;a++){n[0]=r[0]-65517;for(var s=1;s<15;s++)n[s]=r[s]-65535-(n[s-1]>>16&1),n[s-1]&=65535;n[15]=r[15]-32767-(n[14]>>16&1);var l=n[15]>>16&1;n[14]&=65535,c(r,n,1-l)}for(var f=0;f<16;f++)e[2*f]=255&r[f],e[2*f+1]=r[f]>>8}(A,E),A}function v(e){return h(e,a)}function m(e){if(e.length!==t.KS)throw new Error("x25519: seed must be ".concat(t.KS," bytes"));var n=new Uint8Array(e);return{publicKey:v(n),secretKey:n}}t.Au=function(e){var t=(0,r.randomBytes)(32,e),n=m(t);return(0,i.wipe)(t),n},t.gi=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.length!==t.kz)throw new Error("X25519: incorrect secret key length");if(n.length!==t.kz)throw new Error("X25519: incorrect public key length");var i=h(e,n);if(r){for(var o=0,a=0;a=0)return i(e,t,t);var n=Math.abs(t),r=i(e,n,n);return"string"===typeof r?"-"+r:-1*r},f=["margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","top","bottom","left","right"].reduce((function(e,t){var n;return r({},e,((n={})[t]=l,n))}),{}),d=function(e){return function(t){var n={},r=i(t,"breakpoints",o),a=[null].concat(r.map((function(e){return"@media screen and (min-width: "+e+")"})));for(var s in e){var u="function"===typeof e[s]?e[s](t):e[s];if(null!=u)if(Array.isArray(u))for(var c=0;c1&&void 0!==arguments[1]&&arguments[1];if((0,o.Z)(this,e),this.url=t,this.disableProviderPing=n,this.events=new s.EventEmitter,this.isAvailable=!1,this.registering=!1,!(0,f.isHttpUrl)(t))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(t));this.url=t,this.disableProviderPing=n}return(0,a.Z)(e,[{key:"connected",get:function(){return this.isAvailable}},{key:"connecting",get:function(){return this.registering}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"open",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.url,e.next=3,this.register(t);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isAvailable){e.next=2;break}throw new Error("Connection already closed");case 2:this.onClose();case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t,n){var i,o,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isAvailable){e.next=3;break}return e.next=3,this.register();case 3:return e.prev=3,i=(0,l.u)(t),e.next=7,c()(this.url,Object.assign(Object.assign({},d),{body:i}));case 7:return o=e.sent,e.next=10,o.json();case 10:a=e.sent,this.onPayload({data:a}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),this.onError(t.id,e.t0);case 17:case"end":return e.stop()}}),e,this,[[3,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"register",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n,i,o,a=this,s=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:this.url,(0,f.isHttpUrl)(t)){e.next=3;break}throw new Error("Provided URL is not compatible with HTTP connection: ".concat(t));case 3:if(!this.registering){e.next=7;break}return n=this.events.getMaxListeners(),(this.events.listenerCount("register_error")>=n||this.events.listenerCount("open")>=n)&&this.events.setMaxListeners(n+1),e.abrupt("return",new Promise((function(e,t){a.events.once("register_error",(function(e){a.resetMaxListeners(),t(e)})),a.events.once("open",(function(){if(a.resetMaxListeners(),"undefined"===typeof a.isAvailable)return t(new Error("HTTP connection is missing or invalid"));e()}))})));case 7:if(this.url=t,this.registering=!0,e.prev=9,this.disableProviderPing){e.next=14;break}return i=(0,l.u)({id:1,jsonrpc:"2.0",method:"test",params:[]}),e.next=14,c()(t,Object.assign(Object.assign({},d),{body:i}));case 14:this.onOpen(),e.next=23;break;case 17:throw e.prev=17,e.t0=e.catch(9),o=this.parseError(e.t0),this.events.emit("register_error",o),this.onClose(),o;case 23:case"end":return e.stop()}}),e,this,[[9,17]])})));return function(){return e.apply(this,arguments)}}()},{key:"onOpen",value:function(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}},{key:"onClose",value:function(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}},{key:"onPayload",value:function(e){if("undefined"!==typeof e.data){var t="string"===typeof e.data?(0,l.D)(e.data):e.data;this.events.emit("payload",t)}}},{key:"onError",value:function(e,t){var n=this.parseError(t),r=n.message||n.toString(),i=(0,f.formatJsonRpcError)(e,r);this.events.emit("payload",i)}},{key:"parseError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return(0,f.parseConnectionError)(e,t,"HTTP")}},{key:"resetMaxListeners",value:function(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}]),e}(),h=p},13730:function(e,t,n){"use strict";n.r(t),n.d(t,{JsonRpcProvider:function(){return f},default:function(){return d}});var r=n(74165),i=n(15861),o=n(15671),a=n(43144),s=n(60136),u=n(29388),c=n(68041),l=n(31567),f=function(e){(0,s.Z)(n,e);var t=(0,u.Z)(n);function n(e){var r;return(0,o.Z)(this,n),(r=t.call(this,e)).events=new c.EventEmitter,r.hasRegisteredEventListeners=!1,r.connection=r.setConnection(e),r.connection.connected&&r.registerEventListeners(),r}return(0,a.Z)(n,[{key:"connect",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.connection,e.next=3,this.open(t);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.close();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"request",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t,n){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.requestStrict((0,l.formatJsonRpcRequest)(t.method,t.params||[],t.id||(0,l.getBigIntRpcId)().toString()),n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"requestStrict",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t,n){var o=this;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=(0,i.Z)((0,r.Z)().mark((function e(i,a){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.connection.connected){e.next=9;break}return e.prev=1,e.next=4,o.open();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),a(e.t0);case 9:return o.events.on("".concat(t.id),(function(e){(0,l.isJsonRpcError)(e)?a(e.error):i(e.result)})),e.prev=10,e.next=13,o.connection.send(t,n);case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(10),a(e.t1);case 18:case"end":return e.stop()}}),e,null,[[1,6],[10,15]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"setConnection",value:function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connection}},{key:"onPayload",value:function(e){this.events.emit("payload",e),(0,l.isJsonRpcResponse)(e)?this.events.emit("".concat(e.id),e):this.events.emit("message",{type:e.method,data:e.params})}},{key:"onClose",value:function(e){e&&3e3===e.code&&this.events.emit("error",new Error("WebSocket connection closed abnormally with code: ".concat(e.code," ").concat(e.reason?"(".concat(e.reason,")"):""))),this.events.emit("disconnect")}},{key:"open",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n=arguments;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>0&&void 0!==n[0]?n[0]:this.connection,this.connection!==t||!this.connection.connected){e.next=3;break}return e.abrupt("return");case 3:if(this.connection.connected&&this.close(),"string"!==typeof t){e.next=8;break}return e.next=7,this.connection.open(t);case 7:t=this.connection;case 8:return this.connection=this.setConnection(t),e.next=11,this.connection.open();case 11:this.registerEventListeners(),this.events.emit("connect");case 13:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.connection.close();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"registerEventListeners",value:function(){var e=this;this.hasRegisteredEventListeners||(this.connection.on("payload",(function(t){return e.onPayload(t)})),this.connection.on("close",(function(t){return e.onClose(t)})),this.connection.on("error",(function(t){return e.events.emit("error",t)})),this.connection.on("register_error",(function(t){return e.onClose()})),this.hasRegisteredEventListeners=!0)}}]),n}(l.IJsonRpcProvider),d=f},92182:function(e,t,n){"use strict";n.d(t,{CA:function(){return a},JV:function(){return c},O4:function(){return o},dQ:function(){return s},xK:function(){return u}});var r,i=n(4942),o="INTERNAL_ERROR",a="SERVER_ERROR",s=[-32700,-32600,-32601,-32602,-32603],u=(r={},(0,i.Z)(r,"PARSE_ERROR",{code:-32700,message:"Parse error"}),(0,i.Z)(r,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),(0,i.Z)(r,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),(0,i.Z)(r,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),(0,i.Z)(r,o,{code:-32603,message:"Internal error"}),(0,i.Z)(r,a,{code:-32e3,message:"Server error"}),r),c=a},46362:function(e,t,n){"use strict";var r=n(55503);n.o(r,"IJsonRpcProvider")&&n.d(t,{IJsonRpcProvider:function(){return r.IJsonRpcProvider}}),n.o(r,"formatJsonRpcError")&&n.d(t,{formatJsonRpcError:function(){return r.formatJsonRpcError}}),n.o(r,"formatJsonRpcRequest")&&n.d(t,{formatJsonRpcRequest:function(){return r.formatJsonRpcRequest}}),n.o(r,"formatJsonRpcResult")&&n.d(t,{formatJsonRpcResult:function(){return r.formatJsonRpcResult}}),n.o(r,"getBigIntRpcId")&&n.d(t,{getBigIntRpcId:function(){return r.getBigIntRpcId}}),n.o(r,"isHttpUrl")&&n.d(t,{isHttpUrl:function(){return r.isHttpUrl}}),n.o(r,"isJsonRpcError")&&n.d(t,{isJsonRpcError:function(){return r.isJsonRpcError}}),n.o(r,"isJsonRpcRequest")&&n.d(t,{isJsonRpcRequest:function(){return r.isJsonRpcRequest}}),n.o(r,"isJsonRpcResponse")&&n.d(t,{isJsonRpcResponse:function(){return r.isJsonRpcResponse}}),n.o(r,"isJsonRpcResult")&&n.d(t,{isJsonRpcResult:function(){return r.isJsonRpcResult}}),n.o(r,"isLocalhostUrl")&&n.d(t,{isLocalhostUrl:function(){return r.isLocalhostUrl}}),n.o(r,"isReactNative")&&n.d(t,{isReactNative:function(){return r.isReactNative}}),n.o(r,"isWsUrl")&&n.d(t,{isWsUrl:function(){return r.isWsUrl}})},31140:function(e,t,n){"use strict";n.d(t,{CX:function(){return s},L2:function(){return a},by:function(){return o},i5:function(){return i}});var r=n(92182);function i(e){return r.dQ.includes(e)}function o(e){return Object.keys(r.xK).includes(e)?r.xK[e]:r.xK[r.JV]}function a(e){var t=Object.values(r.xK).find((function(t){return t.code===e}));return t||r.xK[r.JV]}function s(e,t,n){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error("Unavailable ".concat(n," RPC url at ").concat(t)):e}},4352:function(e,t,n){"use strict";n.d(t,{CS:function(){return a},RI:function(){return c},sT:function(){return s},tm:function(){return u}});var r=n(31140),i=n(92182);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function a(){return BigInt(o(arguments.length>0&&void 0!==arguments[0]?arguments[0]:6))}function s(e,t,n){return{id:n||o(),jsonrpc:"2.0",method:e,params:t}}function u(e,t){return{id:e,jsonrpc:"2.0",result:t}}function c(e,t,n){return{id:e,jsonrpc:"2.0",error:l(t,n)}}function l(e,t){return"undefined"===typeof e?(0,r.by)(i.O4):("string"===typeof e&&(e=Object.assign(Object.assign({},(0,r.by)(i.CA)),{message:e})),"undefined"!==typeof t&&(e.data=t),(0,r.i5)(e.code)&&(e=(0,r.L2)(e.code)),e)}},31567:function(e,t,n){"use strict";n.d(t,{IJsonRpcProvider:function(){return a.x0},formatJsonRpcError:function(){return o.RI},formatJsonRpcRequest:function(){return o.sT},formatJsonRpcResult:function(){return o.tm},getBigIntRpcId:function(){return o.CS},isHttpUrl:function(){return s.jK},isJsonRpcError:function(){return u.jg},isJsonRpcRequest:function(){return u.DW},isJsonRpcResponse:function(){return u.u},isJsonRpcResult:function(){return u.k4},isLocalhostUrl:function(){return s.JF},isWsUrl:function(){return s.UZ},parseConnectionError:function(){return r.CX}});n(92182);var r=n(31140),i=n(46362);n.o(i,"IJsonRpcProvider")&&n.d(t,{IJsonRpcProvider:function(){return i.IJsonRpcProvider}}),n.o(i,"formatJsonRpcError")&&n.d(t,{formatJsonRpcError:function(){return i.formatJsonRpcError}}),n.o(i,"formatJsonRpcRequest")&&n.d(t,{formatJsonRpcRequest:function(){return i.formatJsonRpcRequest}}),n.o(i,"formatJsonRpcResult")&&n.d(t,{formatJsonRpcResult:function(){return i.formatJsonRpcResult}}),n.o(i,"getBigIntRpcId")&&n.d(t,{getBigIntRpcId:function(){return i.getBigIntRpcId}}),n.o(i,"isHttpUrl")&&n.d(t,{isHttpUrl:function(){return i.isHttpUrl}}),n.o(i,"isJsonRpcError")&&n.d(t,{isJsonRpcError:function(){return i.isJsonRpcError}}),n.o(i,"isJsonRpcRequest")&&n.d(t,{isJsonRpcRequest:function(){return i.isJsonRpcRequest}}),n.o(i,"isJsonRpcResponse")&&n.d(t,{isJsonRpcResponse:function(){return i.isJsonRpcResponse}}),n.o(i,"isJsonRpcResult")&&n.d(t,{isJsonRpcResult:function(){return i.isJsonRpcResult}}),n.o(i,"isLocalhostUrl")&&n.d(t,{isLocalhostUrl:function(){return i.isLocalhostUrl}}),n.o(i,"isReactNative")&&n.d(t,{isReactNative:function(){return i.isReactNative}}),n.o(i,"isWsUrl")&&n.d(t,{isWsUrl:function(){return i.isWsUrl}});var o=n(4352),a=n(67099),s=n(10948),u=n(26063)},67099:function(e,t,n){"use strict";n.d(t,{x0:function(){return s}});var r=n(43144),i=n(15671),o=n(60136),a=n(29388),s=function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(e){return(0,i.Z)(this,n),t.call(this)}return(0,r.Z)(n)}(function(e){(0,o.Z)(n,e);var t=(0,a.Z)(n);function n(){return(0,i.Z)(this,n),t.call(this)}return(0,r.Z)(n)}((0,r.Z)((function e(){(0,i.Z)(this,e)}))))},10948:function(e,t,n){"use strict";n.d(t,{JF:function(){return u},UZ:function(){return s},jK:function(){return a}});var r="^https?:",i="^wss?:";function o(e,t){var n=function(e){var t=e.match(new RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return"undefined"!==typeof n&&new RegExp(t).test(n)}function a(e){return o(e,r)}function s(e){return o(e,i)}function u(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}},26063:function(e,t,n){"use strict";function r(e){return"object"===typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function i(e){return r(e)&&"method"in e}function o(e){return r(e)&&(a(e)||s(e))}function a(e){return"result"in e}function s(e){return"error"in e}n.d(t,{DW:function(){return i},jg:function(){return s},k4:function(){return a},u:function(){return o}})},60074:function(e,t,n){"use strict";var r=n(17061).default,i=n(56690).default,o=n(89728).default;var a=n(66797),s=n(84217),u=a.__importDefault(n(82703)),c=n(72038),l=function(){function e(){i(this,e),this.localStorage=u.default}return o(e,[{key:"getKeys",value:function(){return a.__awaiter(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object.keys(this.localStorage));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getEntries",value:function(){return a.__awaiter(this,void 0,void 0,r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Object.entries(this.localStorage).map(c.parseEntry));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getItem",value:function(e){return a.__awaiter(this,void 0,void 0,r().mark((function t(){var n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(n=this.localStorage.getItem(e))){t.next=3;break}return t.abrupt("return",void 0);case 3:return t.abrupt("return",s.safeJsonParse(n));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"setItem",value:function(e,t){return a.__awaiter(this,void 0,void 0,r().mark((function n(){return r().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:this.localStorage.setItem(e,s.safeJsonStringify(t));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"removeItem",value:function(e){return a.__awaiter(this,void 0,void 0,r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.localStorage.removeItem(e);case 1:case"end":return t.stop()}}),t,this)})))}}]),e}();t.ZP=l},82703:function(e,t,n){"use strict";!function(){var t;function r(){}(t=r).prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},t.prototype.setItem=function(e,t){this[e]=String(t)},t.prototype.removeItem=function(e){delete this[e]},t.prototype.clear=function(){var e=this;Object.keys(e).forEach((function(t){e[t]=void 0,delete e[t]}))},t.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},t.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),"undefined"!==typeof n.g&&n.g.localStorage?e.exports=n.g.localStorage:"undefined"!==typeof window&&window.localStorage?e.exports=window.localStorage:e.exports=new r}()},72038:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(28383),t),r.__exportStar(n(99483),t)},28383:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default;Object.defineProperty(t,"__esModule",{value:!0}),t.IKeyValueStorage=void 0;var o=r((function e(){i(this,e)}));t.IKeyValueStorage=o},99483:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseEntry=void 0;var r=n(84217);t.parseEntry=function(e){var t;return[e[0],r.safeJsonParse(null!==(t=e[1])&&void 0!==t?t:"")]}},82923:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PINO_CUSTOM_CONTEXT_KEY=t.PINO_LOGGER_DEFAULTS=void 0,t.PINO_LOGGER_DEFAULTS={level:"info"},t.PINO_CUSTOM_CONTEXT_KEY="custom_context"},91451:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;var r=n(66797),i=r.__importDefault(n(24));Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return i.default}}),r.__exportStar(n(82923),t),r.__exportStar(n(41067),t)},41067:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateChildLogger=t.formatChildLoggerContext=t.getLoggerContext=t.setBrowserLoggerContext=t.getBrowserLoggerContext=t.getDefaultLoggerOptions=void 0;var r=n(82923);function i(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.PINO_CUSTOM_CONTEXT_KEY]||""}function o(e,t){return e[arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.PINO_CUSTOM_CONTEXT_KEY]=t,e}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.PINO_CUSTOM_CONTEXT_KEY;return"undefined"===typeof e.bindings?i(e,t):e.bindings().context||""}function s(e,t){var n=a(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.PINO_CUSTOM_CONTEXT_KEY);return n.trim()?"".concat(n,"/").concat(t):t}t.getDefaultLoggerOptions=function(e){return Object.assign(Object.assign({},e),{level:(null===e||void 0===e?void 0:e.level)||r.PINO_LOGGER_DEFAULTS.level})},t.getBrowserLoggerContext=i,t.setBrowserLoggerContext=o,t.getLoggerContext=a,t.formatChildLoggerContext=s,t.generateChildLogger=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.PINO_CUSTOM_CONTEXT_KEY,i=s(e,t,n);return o(e.child({context:i}),i,n)}},7370:function(){},15139:function(){},76090:function(e,t,n){"use strict";n.d(t,{D:function(){return o},u:function(){return a}});var r=function(e){return JSON.stringify(e,(function(e,t){return"bigint"===typeof t?t.toString()+"n":t}))},i=function(e){var t=e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3');return JSON.parse(t,(function(e,t){return"string"===typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t}))};function o(e){if("string"!==typeof e)throw new Error("Cannot safe json parse value of type ".concat(typeof e));try{return i(e)}catch(t){return e}}function a(e){return"string"===typeof e?e:r(e)||""}},16073:function(e,t,n){"use strict";t.D=void 0;var r=n(38783);t.D=function(){var e,t;try{e=r.getDocumentOrThrow(),t=r.getLocationOrThrow()}catch(o){return null}function n(){for(var t=arguments.length,n=new Array(t),r=0;r-1){var s=o.getAttribute("href");if(s)if(-1===s.toLowerCase().indexOf("https:")&&-1===s.toLowerCase().indexOf("http:")&&0!==s.indexOf("//")){var u=t.protocol+"//"+t.host;if(0===s.indexOf("/"))u+=s;else{var c=t.pathname.split("/");c.pop(),u+=c.join("/")+"/"+s}r.push(u)}else if(0===s.indexOf("//")){var l=t.protocol+s;r.push(l)}else r.push(s)}}return r}(),name:i}}},88939:function(e,t,n){"use strict";var r=n(38416).default,i=n(27424).default,o=n(74704).default,a=n(861).default,s=n(82376),u=n(8271),c=n(94266),l=n(2214),f=Symbol("encodeFragmentIdentifier");function d(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function p(e,t){return t.encode?t.strict?s(e):encodeURIComponent(e):e}function h(e,t){return t.decode?u(e):e}function v(e){return Array.isArray(e)?e.sort():"object"===typeof e?v(Object.keys(e)).sort((function(e,t){return Number(e)-Number(t)})).map((function(t){return e[t]})):e}function m(e){var t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function g(e){var t=(e=m(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function y(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function b(e,t){d((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);var n=function(e){var t;switch(e.arrayFormat){case"index":return function(e,n,r){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return function(e,n,r){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return function(e,n,r){t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return function(t,n,r){var i="string"===typeof n&&n.includes(e.arrayFormatSeparator),o="string"===typeof n&&!i&&h(n,e).includes(e.arrayFormatSeparator);n=o?h(n,e):n;var a=i||o?n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)})):null===n?n:h(n,e);r[t]=a};case"bracket-separator":return function(t,n,r){var i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),i){var o=null===n?[]:n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)}));void 0!==r[t]?r[t]=[].concat(r[t],o):r[t]=o}else r[t]=n?h(n,e):n};default:return function(e,t,n){void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!==typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;var a,s=o(e.split("&"));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(""!==u){var l=c(t.decode?u.replace(/\+/g," "):u,"="),f=i(l,2),p=f[0],m=f[1];m=void 0===m?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?m:h(m,t),n(h(p,t),m,r)}}}catch(A){s.e(A)}finally{s.f()}for(var g=0,b=Object.keys(r);g0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var n=c(e,"#"),r=i(n,2),o=r[0],a=r[1];return Object.assign({url:o.split("?")[0]||"",query:b(g(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:h(a,t)}:{})},t.stringifyUrl=function(e,n){n=Object.assign(r({encode:!0,strict:!0},f,!0),n);var i=m(e.url).split("?")[0]||"",o=t.extract(e.url),a=t.parse(o,{sort:!1}),s=Object.assign(a,e.query),u=t.stringify(s,n);u&&(u="?".concat(u));var c=function(e){var t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(c="#".concat(n[f]?p(e.fragmentIdentifier,n):e.fragmentIdentifier)),"".concat(i).concat(u).concat(c)},t.pick=function(e,n,i){i=Object.assign(r({parseFragmentIdentifier:!0},f,!1),i);var o=t.parseUrl(e,i),a=o.url,s=o.query,u=o.fragmentIdentifier;return t.stringifyUrl({url:a,query:l(s,n),fragmentIdentifier:u},i)},t.exclude=function(e,n,r){var i=Array.isArray(n)?function(e){return!n.includes(e)}:function(e,t){return!n(e,t)};return t.pick(e,i,r)}},54813:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(6775),t),r.__exportStar(n(73403),t)},6775:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},73403:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},93659:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(60271),t),r.__exportStar(n(36349),t),r.__exportStar(n(28886),t),r.__exportStar(n(54813),t)},28886:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(66797).__exportStar(n(45780),t)},45780:function(e,t,n){"use strict";var r=n(89728).default,i=n(56690).default;Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;var o=r((function e(){i(this,e)}));t.IWatch=o},6317:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;var r=n(54813);t.toMiliseconds=function(e){return e*r.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/r.ONE_THOUSAND)}},98083:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise((function(t){setTimeout((function(){t(!0)}),e)}))}},60271:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(66797);r.__exportStar(n(98083),t),r.__exportStar(n(6317),t)},36349:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;var o=function(){function e(){r(this,e),this.timestamps=new Map}return i(e,[{key:"start",value:function(e){if(this.timestamps.has(e))throw new Error("Watch already started for label: ".concat(e));this.timestamps.set(e,{started:Date.now()})}},{key:"stop",value:function(e){var t=this.get(e);if("undefined"!==typeof t.elapsed)throw new Error("Watch already stopped for label: ".concat(e));var n=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:n})}},{key:"get",value:function(e){var t=this.timestamps.get(e);if("undefined"===typeof t)throw new Error("No timestamp found for label: ".concat(e));return t}},{key:"elapsed",value:function(e){var t=this.get(e),n=t.elapsed||Date.now()-t.started;return n}}]),e}();t.Watch=o,t.default=o},88283:function(e,t,n){"use strict";var r=n(38783)},7289:function(e,t,n){"use strict";var r=n(38416).default,i=n(27424).default,o=n(74704).default,a=n(861).default,s=n(82376),u=n(8271),c=n(94266),l=n(2214),f=Symbol("encodeFragmentIdentifier");function d(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function p(e,t){return t.encode?t.strict?s(e):encodeURIComponent(e):e}function h(e,t){return t.decode?u(e):e}function v(e){return Array.isArray(e)?e.sort():"object"===typeof e?v(Object.keys(e)).sort((function(e,t){return Number(e)-Number(t)})).map((function(t){return e[t]})):e}function m(e){var t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function g(e){var t=(e=m(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function y(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function b(e,t){d((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);var n=function(e){var t;switch(e.arrayFormat){case"index":return function(e,n,r){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return function(e,n,r){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return function(e,n,r){t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return function(t,n,r){var i="string"===typeof n&&n.includes(e.arrayFormatSeparator),o="string"===typeof n&&!i&&h(n,e).includes(e.arrayFormatSeparator);n=o?h(n,e):n;var a=i||o?n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)})):null===n?n:h(n,e);r[t]=a};case"bracket-separator":return function(t,n,r){var i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),i){var o=null===n?[]:n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)}));void 0!==r[t]?r[t]=[].concat(r[t],o):r[t]=o}else r[t]=n?h(n,e):n};default:return function(e,t,n){void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!==typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;var a,s=o(e.split("&"));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(""!==u){var l=c(t.decode?u.replace(/\+/g," "):u,"="),f=i(l,2),p=f[0],m=f[1];m=void 0===m?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?m:h(m,t),n(h(p,t),m,r)}}}catch(A){s.e(A)}finally{s.f()}for(var g=0,b=Object.keys(r);g0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var n=c(e,"#"),r=i(n,2),o=r[0],a=r[1];return Object.assign({url:o.split("?")[0]||"",query:b(g(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:h(a,t)}:{})},t.stringifyUrl=function(e,n){n=Object.assign(r({encode:!0,strict:!0},f,!0),n);var i=m(e.url).split("?")[0]||"",o=t.extract(e.url),a=t.parse(o,{sort:!1}),s=Object.assign(a,e.query),u=t.stringify(s,n);u&&(u="?".concat(u));var c=function(e){var t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(c="#".concat(n[f]?p(e.fragmentIdentifier,n):e.fragmentIdentifier)),"".concat(i).concat(u).concat(c)},t.pick=function(e,n,i){i=Object.assign(r({parseFragmentIdentifier:!0},f,!1),i);var o=t.parseUrl(e,i),a=o.url,s=o.query,u=o.fragmentIdentifier;return t.stringifyUrl({url:a,query:l(s,n),fragmentIdentifier:u},i)},t.exclude=function(e,n,r){var i=Array.isArray(n)?function(e){return!n.includes(e)}:function(e,t){return!n(e,t)};return t.pick(e,i,r)}},38783:function(e,t){"use strict";function n(e){var t=void 0;return"undefined"!==typeof window&&"undefined"!==typeof window[e]&&(t=window[e]),t}function r(e){var t=n(e);if(!t)throw new Error("".concat(e," is not defined in Window"));return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=n,t.getFromWindowOrThrow=r,t.getDocumentOrThrow=function(){return r("document")},t.getDocument=function(){return n("document")},t.getNavigatorOrThrow=function(){return r("navigator")},t.getNavigator=function(){return n("navigator")},t.getLocationOrThrow=function(){return r("location")},t.getLocation=function(){return n("location")},t.getCryptoOrThrow=function(){return r("crypto")},t.getCrypto=function(){return n("crypto")},t.getLocalStorageOrThrow=function(){return r("localStorage")},t.getLocalStorage=function(){return n("localStorage")}},68987:function(e,t,n){"use strict";n.r(t),n.d(t,{EthereumProvider:function(){return cs},OPTIONAL_EVENTS:function(){return Ka},OPTIONAL_METHODS:function(){return Ga},REQUIRED_EVENTS:function(){return Ya},REQUIRED_METHODS:function(){return Wa},default:function(){return us}});var r=n(29439),i=n(74165),o=n(15861),a=n(15671),s=n(43144),u=n(93433),c=n(4942),l=n(37762),f=n(68041),d=n.n(f),p=n(74533),h=n(81791),v=n(14701),m=n(49900),g=n(23539),y=n(45201),b=n(49324),w=n(74233),x=n(93659),k=n(38783),_=(n(36835),n(27964),n(7370),{waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}});function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];return Object.keys(e).forEach((function(r){if(!t.length||t.includes(r)){var i=e[r];n.push.apply(n,(0,u.Z)(i.accounts))}})),n}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var A={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}};function S(e,t){var n=A[e],r=n.message,i=n.code;return{message:t?"".concat(r," ").concat(t):r,code:i}}function O(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}var T=n(97326),P=n(60136),C=n(29388),I=n(1413),R=n(60074),j=n(1345),N=n(91451),M=n(23375),L=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e){var r;return(0,a.Z)(this,n),(r=t.call(this)).opts=e,r.protocol="wc",r.version=2,r}return(0,s.Z)(n)}(M.q),U=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var i;return(0,a.Z)(this,n),(i=t.call(this)).core=e,i.logger=r,i.records=new Map,i}return(0,s.Z)(n)}(M.q),D=(0,s.Z)((function e(t,n){(0,a.Z)(this,e),this.logger=t,this.core=n})),B=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var i;return(0,a.Z)(this,n),(i=t.call(this)).relayer=e,i.logger=r,i}return(0,s.Z)(n)}(M.q),F=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e){return(0,a.Z)(this,n),t.call(this)}return(0,s.Z)(n)}(M.q),Z=(0,s.Z)((function e(t,n,r,i){(0,a.Z)(this,e),this.core=t,this.logger=n,this.name=r})),z=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var i;return(0,a.Z)(this,n),(i=t.call(this)).relayer=e,i.logger=r,i}return(0,s.Z)(n)}(M.q),H=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var i;return(0,a.Z)(this,n),(i=t.call(this)).core=e,i.logger=r,i}return(0,s.Z)(n)}(M.q),q=(0,s.Z)((function e(t,n){(0,a.Z)(this,e),this.projectId=t,this.logger=n})),V=(0,s.Z)((function e(t){(0,a.Z)(this,e),this.opts=t,this.protocol="wc",this.version=2})),W=(0,s.Z)((function e(t){(0,a.Z)(this,e),this.client=t})),G=n(76090),Y=n(44519),K="EdDSA",J="JWT",Q=".",X="base64url",$="utf8",ee="utf8",te=":",ne="did",re="key",ie="base58btc",oe="z",ae="K36";function se(e){return(0,w.toString)((0,b.fromString)((0,G.u)(e),$),X)}function ue(e){var t=(0,b.fromString)(ae,ie),n=oe+(0,w.toString)((0,y.concat)([t,e]),ie);return[ne,re,n].join(te)}function ce(e){return[se(e.header),se(e.payload),(t=e.signature,(0,w.toString)(t,X))].join(Q);var t}function le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,v.randomBytes)(32);return Y._w(e)}function fe(e,t,n,r){return de.apply(this,arguments)}function de(){return de=(0,o.Z)((0,i.Z)().mark((function e(t,n,r,o){var a,s,u,c,l,f,d=arguments;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=d.length>4&&void 0!==d[4]?d[4]:(0,x.fromMiliseconds)(Date.now()),s={alg:K,typ:J},u=ue(o.publicKey),i={header:s,payload:c={iss:u,sub:t,aud:n,iat:a,exp:a+r}},l=(0,b.fromString)([se(i.header),se(i.payload)].join(Q),ee),f=Y.Xx(o.secretKey,l),e.abrupt("return",ce({header:s,payload:c,signature:f}));case 8:case"end":return e.stop()}var i}),e)}))),de.apply(this,arguments)}n(15139);var pe=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i"u")throw new Error("Missing sender public key for type 1 envelope");var n=typeof e.senderPublicKey<"u"?(0,b.fromString)(e.senderPublicKey,Ce):void 0,r=typeof e.iv<"u"?(0,b.fromString)(e.iv,Ce):(0,v.randomBytes)(Ue);return function(e){if(ze(e.type)===Ne){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return(0,w.toString)((0,y.concat)([e.type,e.senderPublicKey,e.iv,e.sealed]),Ie)}return(0,w.toString)((0,y.concat)([e.type,e.iv,e.sealed]),Ie)}({type:t,sealed:new p.OK((0,b.fromString)(e.symKey,Ce)).seal(r,(0,b.fromString)(e.message,Re)),iv:r,senderPublicKey:n})}function qe(e){var t=new p.OK((0,b.fromString)(e.symKey,Ce)),n=Ve(e.encoded),r=n.sealed,i=n.iv,o=t.open(i,r);if(null===o)throw new Error("Failed to decrypt");return(0,w.toString)(o,Re)}function Ve(e){var t=(0,b.fromString)(e,Ie),n=t.slice(Me,Le),r=Le;if(ze(n)===Ne){var i=r+De,o=i+Ue,a=t.slice(r,i),s=t.slice(i,o);return{type:n,sealed:t.slice(o),iv:s,senderPublicKey:a}}var u=r+Ue,c=t.slice(r,u);return{type:n,sealed:t.slice(u),iv:c}}function We(e,t){var n=Ve(e);return Ge({type:ze(n.type),senderPublicKey:typeof n.senderPublicKey<"u"?(0,w.toString)(n.senderPublicKey,Ce):void 0,receiverPublicKey:null===t||void 0===t?void 0:t.receiverPublicKey})}function Ge(e){var t=(null===e||void 0===e?void 0:e.type)||je;if(t===Ne){if(typeof(null===e||void 0===e?void 0:e.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(null===e||void 0===e?void 0:e.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:null===e||void 0===e?void 0:e.senderPublicKey,receiverPublicKey:null===e||void 0===e?void 0:e.receiverPublicKey}}function Ye(e){return e.type===Ne&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}var Ke=Object.defineProperty,Je=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,$e=function(e,t,n){return t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},et=function(e,t){for(var n in t||(t={}))Qe.call(t,n)&&$e(e,n,t[n]);if(Je){var r,i=(0,l.Z)(Je(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Xe.call(t,n)&&$e(e,n,t[n])}}catch(o){i.e(o)}finally{i.f()}}return e},tt="ReactNative",nt={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},rt="js";function it(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function ot(){return!(0,k.getDocument)()&&!!(0,k.getNavigator)()&&navigator.product===tt}function at(){return!it()&&!!(0,k.getNavigator)()}function st(){return ot()?nt.reactNative:it()?nt.node:at()?nt.browser:nt.unknown}function ut(e,t,r){var i=function(){if(st()===nt.reactNative&&typeof n.g<"u"&&typeof(null==n.g?void 0:n.g.Platform)<"u"){var e=n.g.Platform;return[e.OS,e.Version].join("-")}var t=_e();if(null===t)return"unknown";var r=t.os?t.os.replace(" ","").toLowerCase():"unknown";return"browser"===t.type?[r,t.name,t.version].join("-"):[r,t.version].join("-")}(),o=function(){var e,t=st();return t===nt.browser?[t,(null==(e=(0,k.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}();return[[e,t].join("-"),[rt,r].join("-"),i,o].join("/")}function ct(e){var t=e.protocol,n=e.version,r=e.relayUrl,i=e.sdkVersion,o=e.auth,a=e.projectId,s=e.useOnCloseEvent,u=r.split("?"),c={auth:o,ua:ut(t,n,i),projectId:a,useOnCloseEvent:s||void 0},l=function(e,t){var n=Oe.parse(e);return n=et(et({},n),t),Oe.stringify(n)}(u[1]||"",c);return u[0]+"?"+l}function lt(e,t){return e.filter((function(e){return t.includes(e)})).length===e.length}function ft(e){return Object.fromEntries(e.entries())}function dt(e){return new Map(Object.entries(e))}function pt(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x.FIVE_MINUTES,i=arguments.length>1?arguments[1]:void 0,o=(0,x.toMiliseconds)(r||x.FIVE_MINUTES);return{resolve:function(t){n&&e&&(clearTimeout(n),e(t))},reject:function(e){n&&t&&(clearTimeout(n),t(e))},done:function(){return new Promise((function(r,a){n=setTimeout((function(){a(new Error(i))}),o),e=r,t=a}))}}}function ht(e,t,n){return new Promise(function(){var r=(0,o.Z)((0,i.Z)().mark((function r(o,a){var s,u;return(0,i.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s=setTimeout((function(){return a(new Error(n))}),t),r.prev=1,r.next=4,e;case 4:u=r.sent,o(u),r.next=11;break;case 8:r.prev=8,r.t0=r.catch(1),a(r.t0);case 11:clearTimeout(s);case 12:case"end":return r.stop()}}),r,null,[[1,8]])})));return function(e,t){return r.apply(this,arguments)}}())}function vt(e,t){if("string"==typeof t&&t.startsWith("".concat(e,":")))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw new Error('Value must be "string" for expirer target type: topic');return"topic:".concat(t)}if("id"===e.toLowerCase()){if("number"!=typeof t)throw new Error('Value must be "number" for expirer target type: id');return"id:".concat(t)}throw new Error("Unknown expirer target type: ".concat(e))}function mt(e){var t=e.split(":"),n=(0,r.Z)(t,2),i=n[0],o=n[1],a={id:void 0,topic:void 0};if("topic"===i&&"string"==typeof o)a.topic=o;else{if("id"!==i||!Number.isInteger(Number(o)))throw new Error("Invalid target, expected id:number or topic:string, got ".concat(i,":").concat(o));a.id=Number(o)}return a}function gt(e,t){return(0,x.fromMiliseconds)((t||Date.now())+(0,x.toMiliseconds)(e))}function yt(e){return Date.now()>=(0,x.toMiliseconds)(e)}function bt(e,t){return"".concat(e).concat(t?":".concat(t):"")}function wt(e){return xt.apply(this,arguments)}function xt(){return xt=(0,o.Z)((0,i.Z)().mark((function e(t){var r,o,a,s,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.id,o=t.topic,a=t.wcDeepLink,e.prev=1,a){e.next=4;break}return e.abrupt("return");case 4:if(s="string"==typeof a?JSON.parse(a):a,"string"==typeof(u=null===s||void 0===s?void 0:s.href)){e.next=8;break}return e.abrupt("return");case 8:if(u.endsWith("/")&&(u=u.slice(0,-1)),c="".concat(u,"/wc?requestId=").concat(r,"&sessionTopic=").concat(o),(l=st())!==nt.browser){e.next=14;break}c.startsWith("https://")?window.open(c,"_blank","noreferrer noopener"):window.open(c,"_self","noreferrer noopener"),e.next=18;break;case 14:if(e.t0=l===nt.reactNative&&typeof(null==n.g?void 0:n.g.Linking)<"u",!e.t0){e.next=18;break}return e.next=18,n.g.Linking.openURL(c);case 18:e.next=23;break;case 20:e.prev=20,e.t1=e.catch(1),console.error(e.t1);case 23:case"end":return e.stop()}}),e,null,[[1,20]])}))),xt.apply(this,arguments)}function kt(e){return(null===e||void 0===e?void 0:e.relay)||{protocol:"irn"}}function _t(e){var t=_[e];if(typeof t>"u")throw new Error("Relay Protocol not supported: ".concat(e));return t}var Et=Object.defineProperty,At=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,Tt=function(e,t,n){return t in e?Et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n};function Pt(e){var t={},n="relay"+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-");return Object.keys(e).forEach((function(r){if(r.startsWith(n)){var i=r.replace(n,""),o=e[r];t[i]=o}})),t}function Ct(e){var t=e.indexOf(":"),n=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),i=e.substring(t+1,n).split("@"),o=typeof n<"u"?e.substring(n):"",a=Oe.parse(o);return{protocol:r,topic:It(i[0]),version:parseInt(i[1],10),symKey:a.symKey,relay:Pt(a)}}function It(e){return e.startsWith("//")?e.substring(2):e}function Rt(e){return"".concat(e.protocol,":").concat(e.topic,"@").concat(e.version,"?")+Oe.stringify(function(e,t){for(var n in t||(t={}))St.call(t,n)&&Tt(e,n,t[n]);if(At){var r,i=(0,l.Z)(At(t));try{for(i.s();!(r=i.n()).done;)n=r.value,Ot.call(t,n)&&Tt(e,n,t[n])}catch(o){i.e(o)}finally{i.f()}}return e}({symKey:e.symKey},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",n={};return Object.keys(e).forEach((function(r){var i="relay"+t+r;e[r]&&(n[i]=e[r])})),n}(e.relay)))}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function jt(e){var t=[];return e.forEach((function(e){var n=e.split(":"),i=(0,r.Z)(n,2),o=i[0],a=i[1];t.push("".concat(o,":").concat(a))})),t}function Nt(e,t){var n=Qt(e,t);if(n)throw new Error(n.message);for(var i={},o=0,a=Object.entries(e);o"u"}function zt(e,t){return!(!t||!Zt(e))||"string"==typeof e&&!!e.trim().length}function Ht(e,t){return!(!t||!Zt(e))||"number"==typeof e&&!isNaN(e)}function qt(e){return!(!zt(e,!1)||!e.includes(":"))&&2===e.split(":").length}function Vt(e){var t;return null==(t=null===e||void 0===e?void 0:e.proposer)?void 0:t.publicKey}function Wt(e){return null===e||void 0===e?void 0:e.topic}function Gt(e){var t=!0;return Bt(e)?e.length&&(t=e.every((function(e){return zt(e,!1)}))):t=!1,t}function Yt(e,t,n){var i=null;return Object.entries(e).forEach((function(e){var o=(0,r.Z)(e,2),a=o[0],s=o[1];if(!i){var u=function(e,t,n){var r=null;return Bt(t)&&t.length?t.forEach((function(e){r||qt(e)||(r=Dt("UNSUPPORTED_CHAINS","".concat(n,", chain ").concat(e,' should be a string and conform to "namespace:chainId" format')))})):qt(e)||(r=Dt("UNSUPPORTED_CHAINS","".concat(n,', chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }'))),r}(a,Te(a,s),"".concat(t," ").concat(n));u&&(i=u)}})),i}function Kt(e,t){var n=null;return Bt(e)?e.forEach((function(e){n||function(e){if(zt(e,!1)&&e.includes(":")){var t=e.split(":");if(3===t.length){var n=t[0]+":"+t[1];return!!t[2]&&qt(n)}}return!1}(e)||(n=Dt("UNSUPPORTED_ACCOUNTS","".concat(t,", account ").concat(e,' should be a string and conform to "namespace:chainId:address" format')))})):n=Dt("UNSUPPORTED_ACCOUNTS","".concat(t,', accounts should be an array of strings conforming to "namespace:chainId:address" format')),n}function Jt(e,t){var n=null;return Object.values(e).forEach((function(e){if(!n){var r=function(e,t){var n=null;return Gt(null===e||void 0===e?void 0:e.methods)?Gt(null===e||void 0===e?void 0:e.events)||(n=Dt("UNSUPPORTED_EVENTS","".concat(t,", events should be an array of strings or empty array for no events"))):n=Dt("UNSUPPORTED_METHODS","".concat(t,", methods should be an array of strings or empty array for no methods")),n}(e,"".concat(t,", namespace"));r&&(n=r)}})),n}function Qt(e,t){var n=null;if(e&&Ft(e)){var r=Jt(e,t);r&&(n=r);var i=function(e,t){var n=null;return Object.values(e).forEach((function(e){if(!n){var r=Kt(null===e||void 0===e?void 0:e.accounts,"".concat(t," namespace"));r&&(n=r)}})),n}(e,t);i&&(n=i)}else n=Ut("MISSING_OR_INVALID","".concat(t,", namespaces should be an object with data"));return n}function Xt(e){return zt(e.protocol,!0)}function $t(e,t){var n=!1;return t&&!e?n=!0:e&&Bt(e)&&e.length&&e.forEach((function(e){n=Xt(e)})),n}function en(e){return"number"==typeof e}function tn(e){return typeof e<"u"&&null!==typeof e}function nn(e){return!(!e||"object"!=typeof e||!e.code||!Ht(e.code,!1)||!e.message||!zt(e.message,!1))}function rn(e){return!(Zt(e)||!zt(e.method,!1))}function on(e){return!(Zt(e)||Zt(e.result)&&Zt(e.error)||!Ht(e.id,!1)||!zt(e.jsonrpc,!1))}function an(e){return!(Zt(e)||!zt(e.name,!1))}function sn(e,t){return!(!qt(t)||!function(e){var t=[];return Object.values(e).forEach((function(e){t.push.apply(t,(0,u.Z)(jt(e.accounts)))})),t}(e).includes(t))}function un(e,t,n){return!!zt(n,!1)&&function(e,t){var n=[];return Object.values(e).forEach((function(e){jt(e.accounts).includes(t)&&n.push.apply(n,(0,u.Z)(e.methods))})),n}(e,t).includes(n)}function cn(e,t,n){return!!zt(n,!1)&&function(e,t){var n=[];return Object.values(e).forEach((function(e){jt(e.accounts).includes(t)&&n.push.apply(n,(0,u.Z)(e.events))})),n}(e,t).includes(n)}function ln(e,t,n){var r=null,i=function(e){var t={};return Object.keys(e).forEach((function(n){var r;n.includes(":")?t[n]=e[n]:null==(r=e[n].chains)||r.forEach((function(r){t[r]={methods:e[n].methods,events:e[n].events}}))})),t}(e),o=function(e){var t={};return Object.keys(e).forEach((function(n){if(n.includes(":"))t[n]=e[n];else{var r=jt(e[n].accounts);null===r||void 0===r||r.forEach((function(r){t[r]={accounts:e[n].accounts.filter((function(e){return e.includes("".concat(r,":"))})),methods:e[n].methods,events:e[n].events}}))}})),t}(t),a=Object.keys(i),s=Object.keys(o),u=fn(Object.keys(e)),c=fn(Object.keys(t)),l=u.filter((function(e){return!c.includes(e)}));return l.length&&(r=Ut("NON_CONFORMING_NAMESPACES","".concat(n," namespaces keys don't satisfy requiredNamespaces.\n Required: ").concat(l.toString(),"\n Received: ").concat(Object.keys(t).toString()))),lt(a,s)||(r=Ut("NON_CONFORMING_NAMESPACES","".concat(n," namespaces chains don't satisfy required namespaces.\n Required: ").concat(a.toString(),"\n Approved: ").concat(s.toString()))),Object.keys(t).forEach((function(e){if(e.includes(":")&&!r){var i=jt(t[e].accounts);i.includes(e)||(r=Ut("NON_CONFORMING_NAMESPACES","".concat(n," namespaces accounts don't satisfy namespace accounts for ").concat(e,"\n Required: ").concat(e,"\n Approved: ").concat(i.toString())))}})),a.forEach((function(e){r||(lt(i[e].methods,o[e].methods)?lt(i[e].events,o[e].events)||(r=Ut("NON_CONFORMING_NAMESPACES","".concat(n," namespaces events don't satisfy namespace events for ").concat(e))):r=Ut("NON_CONFORMING_NAMESPACES","".concat(n," namespaces methods don't satisfy namespace methods for ").concat(e)))})),r}function fn(e){return(0,u.Z)(new Set(e.map((function(e){return e.includes(":")?e.split(":")[0]:e}))))}function dn(e,t){return Ht(e,!1)&&e<=t.max&&e>=t.min}var pn=n(13730),hn=n(31567),vn=function(e){return e.split("?")[0]},mn="undefined"!==typeof WebSocket?WebSocket:"undefined"!==typeof n.g&&"undefined"!==typeof n.g.WebSocket?n.g.WebSocket:"undefined"!==typeof window&&"undefined"!==typeof window.WebSocket?window.WebSocket:"undefined"!==typeof self&&"undefined"!==typeof self.WebSocket?self.WebSocket:n(78720),gn=function(){function e(t){if((0,a.Z)(this,e),this.url=t,this.events=new f.EventEmitter,this.registering=!1,!(0,hn.isWsUrl)(t))throw new Error("Provided URL is not compatible with WebSocket connection: ".concat(t));this.url=t}return(0,s.Z)(e,[{key:"connected",get:function(){return"undefined"!==typeof this.socket}},{key:"connecting",get:function(){return this.registering}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"open",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,n=arguments;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:this.url,e.next=3,this.register(t);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){"undefined"!==typeof t.socket?(t.socket.onclose=function(n){t.onClose(n),e()},t.socket.close()):n(new Error("Connection already closed"))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!==typeof this.socket){e.next=4;break}return e.next=3,this.register();case 3:this.socket=e.sent;case 4:try{this.socket.send((0,G.u)(t))}catch(n){this.onError(t.id,n)}case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"register",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.url;if(!(0,hn.isWsUrl)(t))throw new Error("Provided URL is not compatible with WebSocket connection: ".concat(t));if(this.registering){var r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((function(t,n){e.events.once("register_error",(function(t){e.resetMaxListeners(),n(t)})),e.events.once("open",(function(){if(e.resetMaxListeners(),"undefined"===typeof e.socket)return n(new Error("WebSocket connection is missing or invalid"));t(e.socket)}))}))}return this.url=t,this.registering=!0,new Promise((function(r,i){var o=(0,hn.isReactNative)()?void 0:{rejectUnauthorized:!(0,hn.isLocalhostUrl)(t)},a=new mn(t,[],o);"undefined"!==typeof WebSocket||"undefined"!==typeof n.g&&"undefined"!==typeof n.g.WebSocket||"undefined"!==typeof window&&"undefined"!==typeof window.WebSocket||"undefined"!==typeof self&&"undefined"!==typeof self.WebSocket?a.onerror=function(t){var n=t;i(e.emitError(n.error))}:a.on("error",(function(t){i(e.emitError(t))})),a.onopen=function(){e.onOpen(a),r(a)}}))}},{key:"onOpen",value:function(e){var t=this;e.onmessage=function(e){return t.onPayload(e)},e.onclose=function(e){return t.onClose(e)},this.socket=e,this.registering=!1,this.events.emit("open")}},{key:"onClose",value:function(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}},{key:"onPayload",value:function(e){if("undefined"!==typeof e.data){var t="string"===typeof e.data?(0,G.D)(e.data):e.data;this.events.emit("payload",t)}}},{key:"onError",value:function(e,t){var n=this.parseError(t),r=n.message||n.toString(),i=(0,hn.formatJsonRpcError)(e,r);this.events.emit("payload",i)}},{key:"parseError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return(0,hn.parseConnectionError)(e,vn(t),"WS")}},{key:"resetMaxListeners",value:function(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}},{key:"emitError",value:function(e){var t=this.parseError(new Error((null===e||void 0===e?void 0:e.message)||"WebSocket connection failed for host: ".concat(vn(this.url))));return this.events.emit("register_error",t),t}}]),e}(),yn=gn,bn=n(23108),wn=n.n(bn);var xn=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r>>0,a=new Uint8Array(o);e[t];){var l=n[e.charCodeAt(t)];if(255===l)return;for(var f=0,d=o-1;(0!==l||f>>0,a[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var p=o-i;p!==o&&0===a[p];)p++;for(var h=new Uint8Array(r+(o-p)),v=r;p!==o;)h[v++]=a[p++];return h}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var n=0,r=0,i=0,o=t.length;i!==o&&0===t[i];)i++,n++;for(var a=(o-i)*l+1>>>0,c=new Uint8Array(a);i!==o;){for(var f=t[i],d=0,p=a-1;(0!==f||d>>0,c[p]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");r=d,i++}for(var h=a-r;h!==a&&0===c[h];)h++;for(var v=u.repeat(n);hn;)o+=t[i&s>>(a-=n)];if(a&&(o+=t[i&s<=8&&(u-=8,s[l++]=255&c>>u)}if(u>=n||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return s}(e,i,r,t)}})},Rn=Pn({prefix:"\0",name:"identity",encode:function(e){return function(e){return(new TextDecoder).decode(e)}(e)},decode:function(e){return function(e){return(new TextEncoder).encode(e)}(e)}}),jn=Object.freeze({__proto__:null,identity:Rn}),Nn=In({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Mn=Object.freeze({__proto__:null,base2:Nn}),Ln=In({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Un=Object.freeze({__proto__:null,base8:Ln}),Dn=Cn({prefix:"9",name:"base10",alphabet:"0123456789"}),Bn=Object.freeze({__proto__:null,base10:Dn}),Fn=In({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Zn=In({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),zn=Object.freeze({__proto__:null,base16:Fn,base16upper:Zn}),Hn=In({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),qn=In({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vn=In({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Wn=In({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gn=In({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yn=In({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Kn=In({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Jn=In({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qn=In({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Xn=Object.freeze({__proto__:null,base32:Hn,base32upper:qn,base32pad:Vn,base32padupper:Wn,base32hex:Gn,base32hexupper:Yn,base32hexpad:Kn,base32hexpadupper:Jn,base32z:Qn}),$n=Cn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),er=Cn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),tr=Object.freeze({__proto__:null,base36:$n,base36upper:er}),nr=Cn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),rr=Cn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),ir=Object.freeze({__proto__:null,base58btc:nr,base58flickr:rr}),or=In({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ar=In({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),sr=In({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ur=In({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),cr=Object.freeze({__proto__:null,base64:or,base64pad:ar,base64url:sr,base64urlpad:ur}),lr=Array.from("\ud83d\ude80\ud83e\ude90\u2604\ud83d\udef0\ud83c\udf0c\ud83c\udf11\ud83c\udf12\ud83c\udf13\ud83c\udf14\ud83c\udf15\ud83c\udf16\ud83c\udf17\ud83c\udf18\ud83c\udf0d\ud83c\udf0f\ud83c\udf0e\ud83d\udc09\u2600\ud83d\udcbb\ud83d\udda5\ud83d\udcbe\ud83d\udcbf\ud83d\ude02\u2764\ud83d\ude0d\ud83e\udd23\ud83d\ude0a\ud83d\ude4f\ud83d\udc95\ud83d\ude2d\ud83d\ude18\ud83d\udc4d\ud83d\ude05\ud83d\udc4f\ud83d\ude01\ud83d\udd25\ud83e\udd70\ud83d\udc94\ud83d\udc96\ud83d\udc99\ud83d\ude22\ud83e\udd14\ud83d\ude06\ud83d\ude44\ud83d\udcaa\ud83d\ude09\u263a\ud83d\udc4c\ud83e\udd17\ud83d\udc9c\ud83d\ude14\ud83d\ude0e\ud83d\ude07\ud83c\udf39\ud83e\udd26\ud83c\udf89\ud83d\udc9e\u270c\u2728\ud83e\udd37\ud83d\ude31\ud83d\ude0c\ud83c\udf38\ud83d\ude4c\ud83d\ude0b\ud83d\udc97\ud83d\udc9a\ud83d\ude0f\ud83d\udc9b\ud83d\ude42\ud83d\udc93\ud83e\udd29\ud83d\ude04\ud83d\ude00\ud83d\udda4\ud83d\ude03\ud83d\udcaf\ud83d\ude48\ud83d\udc47\ud83c\udfb6\ud83d\ude12\ud83e\udd2d\u2763\ud83d\ude1c\ud83d\udc8b\ud83d\udc40\ud83d\ude2a\ud83d\ude11\ud83d\udca5\ud83d\ude4b\ud83d\ude1e\ud83d\ude29\ud83d\ude21\ud83e\udd2a\ud83d\udc4a\ud83e\udd73\ud83d\ude25\ud83e\udd24\ud83d\udc49\ud83d\udc83\ud83d\ude33\u270b\ud83d\ude1a\ud83d\ude1d\ud83d\ude34\ud83c\udf1f\ud83d\ude2c\ud83d\ude43\ud83c\udf40\ud83c\udf37\ud83d\ude3b\ud83d\ude13\u2b50\u2705\ud83e\udd7a\ud83c\udf08\ud83d\ude08\ud83e\udd18\ud83d\udca6\u2714\ud83d\ude23\ud83c\udfc3\ud83d\udc90\u2639\ud83c\udf8a\ud83d\udc98\ud83d\ude20\u261d\ud83d\ude15\ud83c\udf3a\ud83c\udf82\ud83c\udf3b\ud83d\ude10\ud83d\udd95\ud83d\udc9d\ud83d\ude4a\ud83d\ude39\ud83d\udde3\ud83d\udcab\ud83d\udc80\ud83d\udc51\ud83c\udfb5\ud83e\udd1e\ud83d\ude1b\ud83d\udd34\ud83d\ude24\ud83c\udf3c\ud83d\ude2b\u26bd\ud83e\udd19\u2615\ud83c\udfc6\ud83e\udd2b\ud83d\udc48\ud83d\ude2e\ud83d\ude46\ud83c\udf7b\ud83c\udf43\ud83d\udc36\ud83d\udc81\ud83d\ude32\ud83c\udf3f\ud83e\udde1\ud83c\udf81\u26a1\ud83c\udf1e\ud83c\udf88\u274c\u270a\ud83d\udc4b\ud83d\ude30\ud83e\udd28\ud83d\ude36\ud83e\udd1d\ud83d\udeb6\ud83d\udcb0\ud83c\udf53\ud83d\udca2\ud83e\udd1f\ud83d\ude41\ud83d\udea8\ud83d\udca8\ud83e\udd2c\u2708\ud83c\udf80\ud83c\udf7a\ud83e\udd13\ud83d\ude19\ud83d\udc9f\ud83c\udf31\ud83d\ude16\ud83d\udc76\ud83e\udd74\u25b6\u27a1\u2753\ud83d\udc8e\ud83d\udcb8\u2b07\ud83d\ude28\ud83c\udf1a\ud83e\udd8b\ud83d\ude37\ud83d\udd7a\u26a0\ud83d\ude45\ud83d\ude1f\ud83d\ude35\ud83d\udc4e\ud83e\udd32\ud83e\udd20\ud83e\udd27\ud83d\udccc\ud83d\udd35\ud83d\udc85\ud83e\uddd0\ud83d\udc3e\ud83c\udf52\ud83d\ude17\ud83e\udd11\ud83c\udf0a\ud83e\udd2f\ud83d\udc37\u260e\ud83d\udca7\ud83d\ude2f\ud83d\udc86\ud83d\udc46\ud83c\udfa4\ud83d\ude47\ud83c\udf51\u2744\ud83c\udf34\ud83d\udca3\ud83d\udc38\ud83d\udc8c\ud83d\udccd\ud83e\udd40\ud83e\udd22\ud83d\udc45\ud83d\udca1\ud83d\udca9\ud83d\udc50\ud83d\udcf8\ud83d\udc7b\ud83e\udd10\ud83e\udd2e\ud83c\udfbc\ud83e\udd75\ud83d\udea9\ud83c\udf4e\ud83c\udf4a\ud83d\udc7c\ud83d\udc8d\ud83d\udce3\ud83e\udd42"),fr=lr.reduce((function(e,t,n){return e[n]=t,e}),[]),dr=lr.reduce((function(e,t,n){return e[t.codePointAt(0)]=n,e}),[]);var pr=Pn({prefix:"\ud83d\ude80",name:"base256emoji",encode:function(e){return e.reduce((function(e,t){return e+=fr[t]}),"")},decode:function(e){var t,n=[],r=(0,l.Z)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=dr[i.codePointAt(0)];if(void 0===o)throw new Error("Non-base256emoji character: ".concat(i));n.push(o)}}catch(a){r.e(a)}finally{r.f()}return new Uint8Array(n)}}),hr=Object.freeze({__proto__:null,base256emoji:pr}),vr=function e(t,n,r){n=n||[];for(var i=r=r||0;t>=yr;)n[r++]=255&t|mr,t/=128;for(;t&gr;)n[r++]=255&t|mr,t>>>=7;return n[r]=0|t,e.bytes=r-i+1,n},mr=128,gr=-128,yr=Math.pow(2,31);var br=function e(t,n){var r,i=0,o=0,a=n=n||0,s=t.length;do{if(a>=s)throw e.bytes=0,new RangeError("Could not decode varint");r=t[a++],i+=o<28?(r&xr)<=wr);return e.bytes=a-n,i},wr=128,xr=127;var kr=Math.pow(2,7),_r=Math.pow(2,14),Er=Math.pow(2,21),Ar=Math.pow(2,28),Sr=Math.pow(2,35),Or=Math.pow(2,42),Tr=Math.pow(2,49),Pr=Math.pow(2,56),Cr=Math.pow(2,63),Ir={encode:vr,decode:br,encodingLength:function(e){return e2&&void 0!==arguments[2]?arguments[2]:0;return Ir.encode(e,t,n),t},jr=function(e){return Ir.encodingLength(e)},Nr=function(e,t){var n=t.byteLength,r=jr(e),i=r+jr(n),o=new Uint8Array(i+n);return Rr(e,o,0),Rr(n,o,r),o.set(t,i),new Mr(e,n,t,o)},Mr=(0,s.Z)((function e(t,n,r,i){(0,a.Z)(this,e),this.code=t,this.size=n,this.digest=r,this.bytes=i})),Lr=function(e){var t=e.name,n=e.code,r=e.encode;return new Ur(t,n,r)},Ur=function(){function e(t,n,r){(0,a.Z)(this,e),this.name=t,this.code=n,this.encode=r}return(0,s.Z)(e,[{key:"digest",value:function(e){var t=this;if(e instanceof Uint8Array){var n=this.encode(e);return n instanceof Uint8Array?Nr(this.code,n):n.then((function(e){return Nr(t.code,e)}))}throw Error("Unknown type, must be binary type")}}]),e}(),Dr=function(e){return function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,crypto.subtle.digest(e,n);case 3:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},Br=Lr({name:"sha2-256",code:18,encode:Dr("SHA-256")}),Fr=Lr({name:"sha2-512",code:19,encode:Dr("SHA-512")}),Zr=Object.freeze({__proto__:null,sha256:Br,sha512:Fr}),zr=_n,Hr={code:0,name:"identity",encode:zr,digest:function(e){return Nr(0,zr(e))}},qr=Object.freeze({__proto__:null,identity:Hr});new TextEncoder,new TextDecoder;var Vr=(0,I.Z)((0,I.Z)((0,I.Z)((0,I.Z)((0,I.Z)((0,I.Z)((0,I.Z)((0,I.Z)((0,I.Z)((0,I.Z)({},jn),Mn),Un),Bn),zn),Xn),tr),ir),cr),hr);function Wr(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Gr(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}(0,I.Z)((0,I.Z)({},Zr),qr);var Yr=Gr("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),Kr=Gr("ascii","a",(function(e){for(var t="a",n=0;n0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?Wr(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length),n=0;n1&&void 0!==arguments[1]?arguments[1]:"utf8",n=Jr[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?n.decoder.decode("".concat(n.prefix).concat(e)):Wr(globalThis.Buffer.from(e,"utf-8"))}var Xr="core",$r="".concat("wc","@2:").concat(Xr,":"),ei="error",ti={database:":memory:"},ni="client_ed25519_seed",ri=x.ONE_DAY,ii=x.SIX_HOURS,oi="wss://relay.walletconnect.com",ai="wss://relay.walletconnect.org",si="relayer_message",ui="relayer_message_ack",ci="relayer_connect",li="relayer_disconnect",fi="relayer_error",di="relayer_connection_stalled",pi="relayer_transport_closed",hi="relayer_publish",vi="payload",mi="connect",gi="disconnect",yi="error",bi=x.ONE_SECOND/2,wi="subscription_created",xi="subscription_deleted",ki="subscription_sync",_i="subscription_resubscribed",Ei=1e3*x.FIVE_SECONDS,Ai={wc_pairingDelete:{req:{ttl:x.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:x.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:x.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:x.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:x.ONE_DAY,prompt:!1,tag:0},res:{ttl:x.ONE_DAY,prompt:!1,tag:0}}},Si="history_created",Oi="history_updated",Ti="history_deleted",Pi="history_sync",Ci="expirer_created",Ii="expirer_deleted",Ri="expirer_expired",ji="expirer_sync",Ni="verify-api",Mi="https://verify.walletconnect.com",Li=function(){function e(t,n){var r=this;(0,a.Z)(this,e),this.core=t,this.logger=n,this.keychain=new Map,this.name="keychain",this.version="0.3",this.initialized=!1,this.storagePrefix=$r,this.init=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.initialized){e.next=5;break}return e.next=3,r.getKeyChain();case 3:typeof(t=e.sent)<"u"&&(r.keychain=t),r.initialized=!0;case 5:case"end":return e.stop()}}),e)}))),this.has=function(e){return r.isInitialized(),r.keychain.has(e)},this.set=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),r.keychain.set(t,n),e.next=4,r.persist();case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this.get=function(e){r.isInitialized();var t=r.keychain.get(e);if(typeof t>"u"){var n=Ut("NO_MATCHING_KEY","".concat(r.name,": ").concat(e)).message;throw new Error(n)}return t},this.del=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),r.keychain.delete(t),e.next=4,r.persist();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.core=t,this.logger=(0,N.generateChildLogger)(n,this.name)}return(0,s.Z)(e,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"setKeyChain",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,ft(t));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getKeyChain",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return t=e.sent,e.abrupt("return",typeof t<"u"?dt(t):void 0);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"persist",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setKeyChain(this.keychain);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),e}(),Ui=function(){function e(t,n,r){var s=this;(0,a.Z)(this,e),this.core=t,this.logger=n,this.name="crypto",this.initialized=!1,this.init=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=5;break}return e.next=4,s.keychain.init();case 4:s.initialized=!0;case 5:case"end":return e.stop()}}),e)}))),this.hasKeys=function(e){return s.isInitialized(),s.keychain.has(e)},this.getClientId=(0,o.Z)((0,i.Z)().mark((function e(){var t,n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),e.next=3,s.getClientSeed();case 3:return t=e.sent,n=le(t),e.abrupt("return",ue(n.publicKey));case 6:case"end":return e.stop()}}),e)}))),this.generateKeyPair=function(){s.isInitialized();var e=function(){var e=g.Au();return{privateKey:(0,w.toString)(e.secretKey,Ce),publicKey:(0,w.toString)(e.publicKey,Ce)}}();return s.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),e.next=3,s.getClientSeed();case 3:return n=e.sent,r=le(n),o=Be(),a=ri,e.next=9,fe(o,t,a,r);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.generateSharedKey=function(e,t,n){s.isInitialized();var r=function(e,t){var n=g.gi((0,b.fromString)(e,Ce),(0,b.fromString)(t,Ce)),r=new h.t(m.mE,n).expand(De);return(0,w.toString)(r,Ce)}(s.getPrivateKey(e),t);return s.setSymKey(r,n)},this.setSymKey=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),r=n||Fe(t),e.next=4,s.keychain.set(r,t);case 4:return e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this.deleteKeyPair=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),e.next=3,s.keychain.del(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.deleteSymKey=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),e.next=3,s.keychain.del(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.encode=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,r){var o,a,u,c,l,f,d;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),o=Ge(r),a=(0,G.u)(n),!Ye(o)){e.next=7;break}return u=o.senderPublicKey,c=o.receiverPublicKey,e.next=6,s.generateSharedKey(u,c);case 6:t=e.sent;case 7:return l=s.getSymKey(t),f=o.type,d=o.senderPublicKey,e.abrupt("return",He({type:f,symKey:l,message:a,senderPublicKey:d}));case 9:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.decode=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,r){var o,a,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),!Ye(o=We(n,r))){e.next=7;break}return a=o.receiverPublicKey,u=o.senderPublicKey,e.next=6,s.generateSharedKey(a,u);case 6:t=e.sent;case 7:return e.prev=7,c=s.getSymKey(t),l=qe({symKey:c,encoded:n}),e.abrupt("return",(0,G.D)(l));case 12:return e.prev=12,e.t0=e.catch(7),e.t1=s.logger,e.t2="Failed to decode message from topic: '".concat(t,"', clientId: '"),e.next=18,s.getClientId();case 18:e.t3=e.sent,e.t4=e.t2.concat.call(e.t2,e.t3,"'"),e.t1.error.call(e.t1,e.t4),s.logger.error(e.t0);case 22:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t,n,r){return e.apply(this,arguments)}}(),this.getPayloadType=function(e){return ze(Ve(e).type)},this.getPayloadSenderPublicKey=function(e){var t=Ve(e);return t.senderPublicKey?(0,w.toString)(t.senderPublicKey,Ce):void 0},this.core=t,this.logger=(0,N.generateChildLogger)(n,this.name),this.keychain=r||new Li(this.core,this.logger)}return(0,s.Z)(e,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"setPrivateKey",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.keychain.set(t,n);case 2:return e.abrupt("return",t);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getPrivateKey",value:function(e){return this.keychain.get(e)}},{key:"getClientSeed",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="",e.prev=1,t=this.keychain.get(ni),e.next=10;break;case 5:return e.prev=5,e.t0=e.catch(1),t=Be(),e.next=10,this.keychain.set(ni,t);case 10:return e.abrupt("return",Qr(t,"base16"));case 11:case"end":return e.stop()}}),e,this,[[1,5]])})));return function(){return e.apply(this,arguments)}}()},{key:"getSymKey",value:function(e){return this.keychain.get(e)}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),e}(),Di=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var s;return(0,a.Z)(this,n),(s=t.call(this,e,r)).logger=e,s.core=r,s.messages=new Map,s.name="messages",s.version="0.3",s.initialized=!1,s.storagePrefix=$r,s.init=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.initialized){e.next=15;break}return s.logger.trace("Initialized"),e.prev=2,e.next=5,s.getRelayerMessages();case 5:typeof(t=e.sent)<"u"&&(s.messages=t),s.logger.debug("Successfully Restored records for ".concat(s.name)),s.logger.trace({type:"method",method:"restore",size:s.messages.size}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),s.logger.debug("Failed to Restore records for ".concat(s.name)),s.logger.error(e.t0);case 12:return e.prev=12,s.initialized=!0,e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[2,9,12,15]])}))),s.set=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var r,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),r=Ze(n),typeof(o=s.messages.get(t))>"u"&&(o={}),e.t0=typeof o[r]<"u",e.t0){e.next=10;break}return o[r]=n,s.messages.set(t,o),e.next=10,s.persist();case 10:return e.abrupt("return",r);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.get=function(e){s.isInitialized();var t=s.messages.get(e);return typeof t>"u"&&(t={}),t},s.has=function(e,t){return s.isInitialized(),typeof s.get(e)[Ze(t)]<"u"},s.del=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),s.messages.delete(t),e.next=4,s.persist();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.logger=(0,N.generateChildLogger)(e,s.name),s.core=r,s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"setRelayerMessages",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,ft(t));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRelayerMessages",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return t=e.sent,e.abrupt("return",typeof t<"u"?dt(t):void 0);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"persist",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setRelayerMessages(this.messages);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),n}(D),Bi=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var s;return(0,a.Z)(this,n),(s=t.call(this,e,r)).relayer=e,s.logger=r,s.events=new f.EventEmitter,s.name="publisher",s.queue=new Map,s.publishTimeout=(0,x.toMiliseconds)(x.TEN_SECONDS),s.queueTimeout=(0,x.toMiliseconds)(x.FIVE_SECONDS),s.needsTransportRestart=!1,s.publish=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,r){var o,a,u,c,l,f,d;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.logger.debug("Publishing Payload"),s.logger.trace({type:"method",method:"publish",params:{topic:t,message:n,opts:r}}),e.prev=1,o=(null===r||void 0===r?void 0:r.ttl)||ii,a=kt(r),u=(null===r||void 0===r?void 0:r.prompt)||!1,c=(null===r||void 0===r?void 0:r.tag)||0,l=(null===r||void 0===r?void 0:r.id)||(0,hn.getBigIntRpcId)().toString(),f={topic:t,message:n,opts:{ttl:o,relay:a,prompt:u,tag:c,id:l}},d=setTimeout((function(){return s.queue.set(l,f)}),s.queueTimeout),e.prev=3,e.next=6,ht(s.rpcPublish(t,n,o,a,u,c,l),s.publishTimeout);case 6:return e.next=8,e.sent;case 8:clearTimeout(d),s.relayer.events.emit(hi,f),e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(3),s.logger.debug("Publishing Payload stalled"),s.needsTransportRestart=!0,e.abrupt("return");case 16:s.logger.debug("Successfully Published Payload"),s.logger.trace({type:"method",method:"publish",params:{topic:t,message:n,opts:r}}),e.next=22;break;case 19:throw e.prev=19,e.t1=e.catch(1),s.logger.debug("Failed to Publish Payload"),s.logger.error(e.t1),e.t1;case 22:case"end":return e.stop()}}),e,null,[[1,19],[3,12]])})));return function(t,n,r){return e.apply(this,arguments)}}(),s.on=function(e,t){s.events.on(e,t)},s.once=function(e,t){s.events.once(e,t)},s.off=function(e,t){s.events.off(e,t)},s.removeListener=function(e,t){s.events.removeListener(e,t)},s.relayer=e,s.logger=(0,N.generateChildLogger)(r,s.name),s.registerEventListeners(),s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"rpcPublish",value:function(e,t,n,r,i,o,a){var s,u,c,l,f={method:_t(r.protocol).publish,params:{topic:e,message:t,ttl:n,prompt:i,tag:o},id:a};return Zt(null==(s=f.params)?void 0:s.prompt)&&(null==(u=f.params)||delete u.prompt),Zt(null==(c=f.params)?void 0:c.tag)&&(null==(l=f.params)||delete l.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:f}),this.relayer.request(f)}},{key:"onPublish",value:function(e){this.queue.delete(e)}},{key:"checkQueue",value:function(){var e=this;this.queue.forEach(function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){var r,o,a;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.topic,o=n.message,a=n.opts,t.next=3,e.publish(r,o,a);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"registerEventListeners",value:function(){var e=this;this.relayer.core.heartbeat.on(j.HEARTBEAT_EVENTS.pulse,(function(){if(e.needsTransportRestart)return e.needsTransportRestart=!1,void e.relayer.events.emit(di);e.checkQueue()})),this.relayer.on(ui,(function(t){e.onPublish(t.id.toString())}))}}]),n}(B),Fi=function(){function e(){var t=this;(0,a.Z)(this,e),this.map=new Map,this.set=function(e,n){var r=t.get(e);t.exists(e,n)||t.map.set(e,[].concat((0,u.Z)(r),[n]))},this.get=function(e){return t.map.get(e)||[]},this.exists=function(e,n){return t.get(e).includes(n)},this.delete=function(e,n){if(typeof n>"u")t.map.delete(e);else if(t.map.has(e)){var r=t.get(e);if(t.exists(e,n)){var i=r.filter((function(e){return e!==n}));i.length?t.map.set(e,i):t.map.delete(e)}}},this.clear=function(){t.map.clear()}}return(0,s.Z)(e,[{key:"topics",get:function(){return Array.from(this.map.keys())}}]),e}(),Zi=Object.defineProperty,zi=Object.defineProperties,Hi=Object.getOwnPropertyDescriptors,qi=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Wi=Object.prototype.propertyIsEnumerable,Gi=function(e,t,n){return t in e?Zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Yi=function(e,t){for(var n in t||(t={}))Vi.call(t,n)&&Gi(e,n,t[n]);if(qi){var r,i=(0,l.Z)(qi(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Wi.call(t,n)&&Gi(e,n,t[n])}}catch(o){i.e(o)}finally{i.f()}}return e},Ki=function(e,t){return zi(e,Hi(t))},Ji=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var s;return(0,a.Z)(this,n),(s=t.call(this,e,r)).relayer=e,s.logger=r,s.subscriptions=new Map,s.topicMap=new Fi,s.events=new f.EventEmitter,s.name="subscription",s.version="0.3",s.pending=new Map,s.cached=[],s.initialized=!1,s.pendingSubscriptionWatchLabel="pending_sub_watch_label",s.pollingInterval=20,s.storagePrefix=$r,s.subscribeTimeout=1e4,s.restartInProgress=!1,s.batchSubscribeTopicsLimit=500,s.init=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=10;break}return s.logger.trace("Initialized"),e.next=5,s.restart();case 5:return s.registerEventListeners(),s.onEnable(),e.next=9,s.relayer.core.crypto.getClientId();case 9:s.clientId=e.sent;case 10:case"end":return e.stop()}}),e)}))),s.subscribe=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var r,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.restartToComplete();case 2:return s.isInitialized(),s.logger.debug("Subscribing Topic"),s.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:n}}),e.prev=5,r=kt(n),o={topic:t,relay:r},s.pending.set(t,o),e.next=10,s.rpcSubscribe(t,r);case 10:return a=e.sent,e.abrupt("return",(s.onSubscribe(a,o),s.logger.debug("Successfully Subscribed Topic"),s.logger.trace({type:"method",method:"subscribe",params:{topic:t,opts:n}}),a));case 14:throw e.prev=14,e.t0=e.catch(5),s.logger.debug("Failed to Subscribe Topic"),s.logger.error(e.t0),e.t0;case 17:case"end":return e.stop()}}),e,null,[[5,14]])})));return function(t,n){return e.apply(this,arguments)}}(),s.unsubscribe=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.restartToComplete();case 2:if(s.isInitialized(),!(typeof(null===n||void 0===n?void 0:n.id)<"u")){e.next=8;break}return e.next=6,s.unsubscribeById(t,n.id,n);case 6:e.next=10;break;case 8:return e.next=10,s.unsubscribeByTopic(t,n);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.isSubscribed=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s.topics.includes(t)){e.next=4;break}e.t0=!0,e.next=7;break;case 4:return e.next=6,new Promise((function(e,n){var r=new x.Watch;r.start(s.pendingSubscriptionWatchLabel);var i=setInterval((function(){!s.pending.has(t)&&s.topics.includes(t)&&(clearInterval(i),r.stop(s.pendingSubscriptionWatchLabel),e(!0)),r.elapsed(s.pendingSubscriptionWatchLabel)>=Ei&&(clearInterval(i),r.stop(s.pendingSubscriptionWatchLabel),n(new Error("Subscription resolution timeout")))}),s.pollingInterval)})).catch((function(){return!1}));case 6:e.t0=e.sent;case 7:return e.abrupt("return",e.t0);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.on=function(e,t){s.events.on(e,t)},s.once=function(e,t){s.events.once(e,t)},s.off=function(e,t){s.events.off(e,t)},s.removeListener=function(e,t){s.events.removeListener(e,t)},s.restart=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.restartInProgress=!0,e.next=3,s.restore();case 3:return e.next=5,s.reset();case 5:s.restartInProgress=!1;case 6:case"end":return e.stop()}}),e)}))),s.relayer=e,s.logger=(0,N.generateChildLogger)(r,s.name),s.clientId="",s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"length",get:function(){return this.subscriptions.size}},{key:"ids",get:function(){return Array.from(this.subscriptions.keys())}},{key:"values",get:function(){return Array.from(this.subscriptions.values())}},{key:"topics",get:function(){return this.topicMap.topics}},{key:"hasSubscription",value:function(e,t){var n=!1;try{n=this.getSubscription(e).topic===t}catch(r){}return n}},{key:"onEnable",value:function(){this.cached=[],this.initialized=!0}},{key:"onDisable",value:function(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}},{key:"unsubscribeByTopic",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var r,a=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.topicMap.get(t),e.next=3,Promise.all(r.map(function(){var e=(0,o.Z)((0,i.Z)().mark((function e(r){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.unsubscribeById(t,r,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"unsubscribeById",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,r){var o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:n,opts:r}}),e.prev=1,o=kt(r),e.next=5,this.rpcUnsubscribe(t,n,o);case 5:return a=Dt("USER_DISCONNECTED","".concat(this.name,", ").concat(t)),e.next=8,this.onUnsubscribe(t,n,a);case 8:this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:n,opts:r}}),e.next=15;break;case 12:throw e.prev=12,e.t0=e.catch(1),this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e.t0),e.t0;case 15:case"end":return e.stop()}}),e,this,[[1,12]])})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"rpcSubscribe",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={method:_t(n.protocol).subscribe,params:{topic:t}},this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),e.prev=2,e.next=5,ht(this.relayer.request(r),this.subscribeTimeout);case 5:return e.next=7,e.sent;case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(di);case 12:return e.abrupt("return",Ze(t+this.clientId));case 13:case"end":return e.stop()}}),e,this,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"rpcBatchSubscribe",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return");case 2:return n=t[0].relay,r={method:_t(n.protocol).batchSubscribe,params:{topics:t.map((function(e){return e.topic}))}},this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),e.prev=4,e.next=7,ht(this.relayer.request(r),this.subscribeTimeout);case 7:return e.next=9,e.sent;case 9:return e.abrupt("return",e.sent);case 12:e.prev=12,e.t0=e.catch(4),this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(di);case 15:case"end":return e.stop()}}),e,this,[[4,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"rpcUnsubscribe",value:function(e,t,n){var r={method:_t(n.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),this.relayer.request(r)}},{key:"onSubscribe",value:function(e,t){this.setSubscription(e,Ki(Yi({},t),{id:e})),this.pending.delete(t.topic)}},{key:"onBatchSubscribe",value:function(e){var t=this;e.length&&e.forEach((function(e){t.setSubscription(e.id,Yi({},e)),t.pending.delete(e.topic)}))}},{key:"onUnsubscribe",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,r){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.events.removeAllListeners(n),this.hasSubscription(n,t)&&this.deleteSubscription(n,r),e.next=4,this.relayer.messages.del(t);case 4:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"setRelayerSubscriptions",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.relayer.core.storage.setItem(this.storageKey,t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRelayerSubscriptions",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.relayer.core.storage.getItem(this.storageKey);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setSubscription",value:function(e,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}},{key:"addSubscription",value:function(e,t){this.subscriptions.set(e,Yi({},t)),this.topicMap.set(t.topic,e),this.events.emit(wi,t)}},{key:"getSubscription",value:function(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});var t=this.subscriptions.get(e);if(!t){var n=Ut("NO_MATCHING_KEY","".concat(this.name,": ").concat(e)).message;throw new Error(n)}return t}},{key:"deleteSubscription",value:function(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});var n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(xi,Ki(Yi({},n),{reason:t}))}},{key:"persist",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setRelayerSubscriptions(this.values);case 2:this.events.emit(ki);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"reset",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.cached.length){e.next=10;break}t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit),n=0;case 3:if(!(n"u")&&t.length){e.next=6;break}return e.abrupt("return");case 6:if(!this.subscriptions.size){e.next=9;break}throw n=Ut("RESTORE_WILL_OVERRIDE",this.name),r=n.message,this.logger.error(r),this.logger.error("".concat(this.name,": ").concat(JSON.stringify(this.values))),new Error(r);case 9:this.cached=t,this.logger.debug("Successfully Restored subscriptions for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",subscriptions:this.values}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.debug("Failed to Restore subscriptions for ".concat(this.name)),this.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"batchSubscribe",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.rpcBatchSubscribe(t);case 4:Bt(n=e.sent)&&this.onBatchSubscribe(n.map((function(e,n){return Ki(Yi({},t[n]),{id:e})})));case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onConnect",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.restartInProgress,e.t0){e.next=5;break}return e.next=4,this.restart();case 4:this.onEnable();case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onDisconnect",value:function(){this.onDisable()}},{key:"checkPending",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.relayer.transportExplicitlyClosed){e.next=2;break}return e.abrupt("return");case 2:return t=[],this.pending.forEach((function(e){t.push(e)})),e.next=6,this.batchSubscribe(t);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"registerEventListeners",value:function(){var e=this;this.relayer.core.heartbeat.on(j.HEARTBEAT_EVENTS.pulse,(0,o.Z)((0,i.Z)().mark((function t(){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.checkPending();case 2:case"end":return t.stop()}}),t)})))),this.relayer.on(ci,(0,o.Z)((0,i.Z)().mark((function t(){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.onConnect();case 2:case"end":return t.stop()}}),t)})))),this.relayer.on(li,(function(){e.onDisconnect()})),this.events.on(wi,function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){var r;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=wi,e.logger.info("Emitting ".concat(r)),e.logger.debug({type:"event",event:r,data:n}),t.next=5,e.persist();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.events.on(xi,function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){var r;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=xi,e.logger.info("Emitting ".concat(r)),e.logger.debug({type:"event",event:r,data:n}),t.next=5,e.persist();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}},{key:"restartToComplete",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.restartInProgress,!e.t0){e.next=4;break}return e.next=4,new Promise((function(e){var n=setInterval((function(){t.restartInProgress||(clearInterval(n),e())}),t.pollingInterval)}));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(z),Qi=Object.defineProperty,Xi=Object.getOwnPropertySymbols,$i=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable,to=function(e,t,n){return t in e?Qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},no=function(e,t){for(var n in t||(t={}))$i.call(t,n)&&to(e,n,t[n]);if(Xi){var r,i=(0,l.Z)(Xi(t));try{for(i.s();!(r=i.n()).done;){n=r.value;eo.call(t,n)&&to(e,n,t[n])}}catch(o){i.e(o)}finally{i.f()}}return e},ro=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e){var r;return(0,a.Z)(this,n),(r=t.call(this,e)).protocol="wc",r.version=2,r.events=new f.EventEmitter,r.name="relayer",r.transportExplicitlyClosed=!1,r.initialized=!1,r.reconnecting=!1,r.connectionStatusPollingInterval=20,r.staleConnectionErrors=["socket hang up","socket stalled"],r.request=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.logger.debug("Publishing Request Payload"),e.prev=1,e.next=4,r.toEstablishConnection();case 4:return e.next=6,r.provider.request(t);case 6:return e.abrupt("return",e.sent);case 9:throw e.prev=9,e.t0=e.catch(1),r.logger.debug("Failed to Publish Request"),r.logger.error(e.t0),e.t0;case 12:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(t){return e.apply(this,arguments)}}(),r.core=e.core,r.logger=typeof e.logger<"u"&&"string"!=typeof e.logger?(0,N.generateChildLogger)(e.logger,r.name):(0,N.pino)((0,N.getDefaultLoggerOptions)({level:e.logger||"error"})),r.messages=new Di(r.logger,e.core),r.subscriber=new Ji((0,T.Z)(r),r.logger),r.publisher=new Bi((0,T.Z)(r),r.logger),r.relayUrl=(null===e||void 0===e?void 0:e.relayUrl)||oi,r.projectId=e.projectId,r.provider={},r}return(0,s.Z)(n,[{key:"init",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.trace("Initialized"),e.next=3,this.createProvider();case 3:return e.next=5,Promise.all([this.messages.init(),this.subscriber.init()]);case 5:return e.prev=5,e.next=8,this.transportOpen();case 8:e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(5),this.logger.warn("Connection via ".concat(this.relayUrl," failed, attempting to connect via failover domain ").concat(ai,"...")),e.next=15,this.restartTransport(ai);case 15:this.registerEventListeners(),this.initialized=!0,setTimeout((0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=0===t.subscriber.topics.length,!e.t0){e.next=6;break}return t.logger.info("No topics subscribed to after init, closing transport"),e.next=5,t.transportClose();case 5:t.transportExplicitlyClosed=!1;case 6:case"end":return e.stop()}}),e)}))),1e4);case 16:case"end":return e.stop()}}),e,this,[[5,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"connected",get:function(){return this.provider.connection.connected}},{key:"connecting",get:function(){return this.provider.connection.connecting}},{key:"publish",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,r){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isInitialized(),e.next=3,this.publisher.publish(t,n,r);case 3:return e.next=5,this.recordMessageEvent({topic:t,message:n,publishedAt:Date.now()});case 5:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"subscribe",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var r,a,s=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isInitialized(),a=(null==(r=this.subscriber.topicMap.get(t))?void 0:r[0])||"",e.t0=a,e.t0){e.next=7;break}return e.next=6,Promise.all([new Promise((function(e){s.subscriber.once(wi,(function(n){n.topic===t&&e()}))})),new Promise(function(){var e=(0,o.Z)((0,i.Z)().mark((function e(r){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.subscriber.subscribe(t,n);case 2:a=e.sent,r();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())]);case 6:e.t0=a;case 7:return e.abrupt("return",e.t0);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"unsubscribe",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.isInitialized(),e.next=3,this.subscriber.unsubscribe(t,n);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"transportClose",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.transportExplicitlyClosed=!0,e.t0=this.connected,!e.t0){e.next=6;break}return e.next=5,this.provider.disconnect();case 5:this.events.emit(pi);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"transportOpen",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.transportExplicitlyClosed=!1,this.reconnecting){e.next=23;break}return this.relayUrl=t||this.relayUrl,this.reconnecting=!0,e.prev=2,e.t0=Promise,e.t1=new Promise((function(e){r.initialized||e(),r.subscriber.once(_i,(function(){e()}))})),e.next=7,Promise.race([new Promise(function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ht(r.provider.connect(),1e4,"Socket stalled when trying to connect to ".concat(r.relayUrl)).catch((function(e){return n(e)})).then((function(){return t()})).finally((function(){return r.removeListener(pi,r.rejectTransportOpen)}));case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),new Promise((function(e){return r.once(pi,r.rejectTransportOpen)}))]);case 7:return e.t2=e.sent,e.t3=[e.t1,e.t2],e.next=11,e.t0.all.call(e.t0,e.t3);case 11:e.next=20;break;case 13:if(e.prev=13,e.t4=e.catch(2),this.logger.error(e.t4),n=e.t4,this.isConnectionStalled(n.message)){e.next=19;break}throw e.t4;case 19:this.events.emit(pi);case 20:return e.prev=20,this.reconnecting=!1,e.finish(20);case 23:case"end":return e.stop()}}),e,this,[[2,13,20,23]])})));return function(t){return e.apply(this,arguments)}}()},{key:"restartTransport",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.transportExplicitlyClosed||this.reconnecting,e.t0){e.next=11;break}if(this.relayUrl=t||this.relayUrl,e.t1=this.connected,!e.t1){e.next=7;break}return e.next=7,Promise.all([new Promise((function(e){n.provider.once(gi,(function(){e()}))})),this.transportClose()]);case 7:return e.next=9,this.createProvider();case 9:return e.next=11,this.transportOpen();case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isConnectionStalled",value:function(e){return this.staleConnectionErrors.some((function(t){return e.includes(t)}))}},{key:"rejectTransportOpen",value:function(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}},{key:"createProvider",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.crypto.signJWT(this.relayUrl);case 2:t=e.sent,this.provider=new pn.JsonRpcProvider(new yn(ct({sdkVersion:"2.9.2",protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0}))),this.registerProviderListeners();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"recordMessageEvent",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,r=t.message,e.next=3,this.messages.set(n,r);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"shouldIgnoreMessageEvent",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.topic,(r=t.message)&&0!==r.length){e.next=3;break}return e.abrupt("return",(this.logger.debug("Ignoring invalid/empty message: ".concat(r)),!0));case 3:return e.next=5,this.subscriber.isSubscribed(n);case 5:if(e.sent){e.next=7;break}return e.abrupt("return",(this.logger.debug("Ignoring message for non-subscribed topic ".concat(n)),!0));case 7:return o=this.messages.has(n,r),e.abrupt("return",(o&&this.logger.debug("Ignoring duplicate message: ".concat(r)),o));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onProviderPayload",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,o,a,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),!(0,hn.isJsonRpcRequest)(t)){e.next=13;break}if(t.method.endsWith("_subscription")){e.next=3;break}return e.abrupt("return");case 3:return n=t.params,r=n.data,o=r.topic,a=r.message,s=r.publishedAt,u={topic:o,message:a,publishedAt:s},this.logger.debug("Emitting Relayer Payload"),this.logger.trace(no({type:"event",event:n.id},u)),this.events.emit(n.id,u),e.next=9,this.acknowledgePayload(t);case 9:return e.next=11,this.onMessageEvent(u);case 11:e.next=14;break;case 13:(0,hn.isJsonRpcResponse)(t)&&this.events.emit(ui,t);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onMessageEvent",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.shouldIgnoreMessageEvent(t);case 2:if(e.t0=e.sent,e.t0){e.next=7;break}return this.events.emit(si,t),e.next=7,this.recordMessageEvent(t);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"acknowledgePayload",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,hn.formatJsonRpcResult)(t.id,!0),e.next=3,this.provider.connection.send(n);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"registerProviderListeners",value:function(){var e=this;this.provider.on(vi,(function(t){return e.onProviderPayload(t)})),this.provider.on(mi,(function(){e.events.emit(ci)})),this.provider.on(gi,(function(){e.onProviderDisconnect()})),this.provider.on(yi,(function(t){e.logger.error(t),e.events.emit(fi,t)}))}},{key:"registerEventListeners",value:function(){var e=this;this.events.on(di,(0,o.Z)((0,i.Z)().mark((function t(){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.restartTransport();case 2:case"end":return t.stop()}}),t)}))))}},{key:"onProviderDisconnect",value:function(){this.events.emit(li),this.attemptToReconnect()}},{key:"attemptToReconnect",value:function(){var e=this;this.transportExplicitlyClosed||setTimeout((0,o.Z)((0,i.Z)().mark((function t(){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.restartTransport();case 2:case"end":return t.stop()}}),t)}))),(0,x.toMiliseconds)(bi))}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}},{key:"toEstablishConnection",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connected){e.next=7;break}if(!this.connecting){e.next=5;break}return e.next=4,new Promise((function(e){var n=setInterval((function(){t.connected&&(clearInterval(n),e())}),t.connectionStatusPollingInterval)}));case 4:return e.abrupt("return",e.sent);case 5:return e.next=7,this.restartTransport();case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(F),io=Object.defineProperty,oo=Object.getOwnPropertySymbols,ao=Object.prototype.hasOwnProperty,so=Object.prototype.propertyIsEnumerable,uo=function(e,t,n){return t in e?io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},co=function(e,t){for(var n in t||(t={}))ao.call(t,n)&&uo(e,n,t[n]);if(oo){var r,i=(0,l.Z)(oo(t));try{for(i.s();!(r=i.n()).done;){n=r.value;so.call(t,n)&&uo(e,n,t[n])}}catch(o){i.e(o)}finally{i.f()}}return e},lo=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r,s){var u,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$r,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return(0,a.Z)(this,n),(u=t.call(this,e,r,s,c)).core=e,u.logger=r,u.name=s,u.map=new Map,u.version="0.3",u.cached=[],u.initialized=!1,u.storagePrefix=$r,u.init=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=u.initialized,e.t0){e.next=8;break}return u.logger.trace("Initialized"),e.next=5,u.restore();case 5:u.cached.forEach((function(e){u.getKey&&null!==e&&!Zt(e)?u.map.set(u.getKey(e),e):Vt(e)?u.map.set(e.id,e):Wt(e)&&u.map.set(e.topic,e)})),u.cached=[],u.initialized=!0;case 8:case"end":return e.stop()}}),e)}))),u.set=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.isInitialized(),!u.map.has(t)){e.next=6;break}return e.next=4,u.update(t,n);case 4:e.next=11;break;case 6:return u.logger.debug("Setting value"),u.logger.trace({type:"method",method:"set",key:t,value:n}),u.map.set(t,n),e.next=11,u.persist();case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),u.get=function(e){return u.isInitialized(),u.logger.debug("Getting value"),u.logger.trace({type:"method",method:"get",key:e}),u.getData(e)},u.getAll=function(e){return u.isInitialized(),e?u.values.filter((function(t){return Object.keys(e).every((function(n){return wn()(t[n],e[n])}))})):u.values},u.update=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.isInitialized(),u.logger.debug("Updating value"),u.logger.trace({type:"method",method:"update",key:t,update:n}),r=co(co({},u.getData(t)),n),u.map.set(t,r),e.next=5,u.persist();case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),u.delete=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u.isInitialized(),e.t0=u.map.has(t),!e.t0){e.next=8;break}return u.logger.debug("Deleting value"),u.logger.trace({type:"method",method:"delete",key:t,reason:n}),u.map.delete(t),e.next=8,u.persist();case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),u.logger=(0,N.generateChildLogger)(r,u.name),u.storagePrefix=c,u.getKey=l,u}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"length",get:function(){return this.map.size}},{key:"keys",get:function(){return Array.from(this.map.keys())}},{key:"values",get:function(){return Array.from(this.map.values())}},{key:"setDataStore",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getDataStore",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getData",value:function(e){var t=this.map.get(e);if(!t){var n=Ut("NO_MATCHING_KEY","".concat(this.name,": ").concat(e)).message;throw this.logger.error(n),new Error(n)}return t}},{key:"persist",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setDataStore(this.values);case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restore",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getDataStore();case 3:if(!(typeof(t=e.sent)>"u")&&t.length){e.next=6;break}return e.abrupt("return");case 6:if(!this.map.size){e.next=9;break}throw n=Ut("RESTORE_WILL_OVERRIDE",this.name),r=n.message,this.logger.error(r),new Error(r);case 9:this.cached=t,this.logger.debug("Successfully Restored value for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",value:this.values}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.debug("Failed to Restore value for ".concat(this.name)),this.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),n}(Z),fo=function(){function e(t,n){var r=this;(0,a.Z)(this,e),this.core=t,this.logger=n,this.name="pairing",this.version="0.3",this.events=new(d()),this.initialized=!1,this.storagePrefix=$r,this.ignoredPayloadTypes=[Ne],this.registeredMethods=[],this.init=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=r.initialized,e.t0){e.next=10;break}return e.next=4,r.pairings.init();case 4:return e.next=6,r.cleanup();case 6:r.registerRelayerEvents(),r.registerExpirerEvents(),r.initialized=!0,r.logger.trace("Initialized");case 10:case"end":return e.stop()}}),e)}))),this.register=function(e){var t=e.methods;r.isInitialized(),r.registeredMethods=(0,u.Z)(new Set([].concat((0,u.Z)(r.registeredMethods),(0,u.Z)(t))))},this.create=(0,o.Z)((0,i.Z)().mark((function e(){var t,n,o,a,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),t=Be(),e.next=4,r.core.crypto.setSymKey(t);case 4:return n=e.sent,o=gt(x.FIVE_MINUTES),s={topic:n,expiry:o,relay:a={protocol:"irn"},active:!1},u=Rt({protocol:r.core.protocol,version:r.core.version,topic:n,symKey:t,relay:a}),e.next=11,r.pairings.set(n,s);case 11:return e.next=13,r.core.relayer.subscribe(n);case 13:return r.core.expirer.set(n,o),e.abrupt("return",{topic:n,uri:u});case 15:case"end":return e.stop()}}),e)}))),this.pair=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.isInitialized(),r.isValidPair(t),n=Ct(t.uri),o=n.topic,a=n.symKey,s=n.relay,!r.pairings.keys.includes(o)){e.next=4;break}throw new Error("Pairing already exists: ".concat(o));case 4:if(!r.core.crypto.hasKeys(o)){e.next=6;break}throw new Error("Keychain already exists: ".concat(o));case 6:return u=gt(x.FIVE_MINUTES),c={topic:o,relay:s,expiry:u,active:!1},e.next=9,r.pairings.set(o,c);case 9:return e.next=11,r.core.crypto.setSymKey(a,o);case 11:return e.next=13,r.core.relayer.subscribe(o,{relay:s});case 13:if(r.core.expirer.set(o,u),e.t0=t.activatePairing,!e.t0){e.next=18;break}return e.next=18,r.activate({topic:o});case 18:return e.abrupt("return",c);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.activate=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,r.isInitialized(),o=gt(x.THIRTY_DAYS),e.next=5,r.pairings.update(n,{active:!0,expiry:o});case 5:r.core.expirer.set(n,o);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.ping=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidPing(t);case 3:if(n=t.topic,!r.pairings.keys.includes(n)){e.next=15;break}return e.next=7,r.sendRequest(n,"wc_pairingPing",{});case 7:return o=e.sent,a=pt(),s=a.done,u=a.resolve,c=a.reject,r.events.once(bt("pairing_ping",o),(function(e){var t=e.error;t?c(t):u()})),e.next=15,s();case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.updateExpiry=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,o=t.expiry,r.isInitialized(),e.next=4,r.pairings.update(n,{expiry:o});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.updateMetadata=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,o=t.metadata,r.isInitialized(),e.next=4,r.pairings.update(n,{peerMetadata:o});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.getPairings=function(){return r.isInitialized(),r.pairings.values},this.disconnect=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidDisconnect(t);case 3:if(n=t.topic,e.t0=r.pairings.keys.includes(n),!e.t0){e.next=10;break}return e.next=8,r.sendRequest(n,"wc_pairingDelete",Dt("USER_DISCONNECTED"));case 8:return e.next=10,r.deletePairing(n);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.sendRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,o){var a,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(0,hn.formatJsonRpcRequest)(n,o),e.next=3,r.core.crypto.encode(t,a);case 3:return s=e.sent,u=Ai[n].req,e.abrupt("return",(r.core.history.set(t,a),r.core.relayer.publish(t,s,u),a.id));case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.sendResult=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,o){var a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(0,hn.formatJsonRpcResult)(t,o),e.next=3,r.core.crypto.encode(n,a);case 3:return s=e.sent,e.next=6,r.core.history.get(n,t);case 6:return u=e.sent,c=Ai[u.request.method].res,e.next=10,r.core.relayer.publish(n,s,c);case 10:return e.next=12,r.core.history.resolve(a);case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.sendError=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,o){var a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(0,hn.formatJsonRpcError)(t,o),e.next=3,r.core.crypto.encode(n,a);case 3:return s=e.sent,e.next=6,r.core.history.get(n,t);case 6:return u=e.sent,c=Ai[u.request.method]?Ai[u.request.method].res:Ai.unregistered_method.res,e.next=10,r.core.relayer.publish(n,s,c);case 10:return e.next=12,r.core.history.resolve(a);case 12:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.deletePairing=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.core.relayer.unsubscribe(t);case 2:return e.next=4,Promise.all([r.pairings.delete(t,Dt("USER_DISCONNECTED")),r.core.crypto.deleteSymKey(t),n?Promise.resolve():r.core.expirer.del(t)]);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this.cleanup=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.pairings.getAll().filter((function(e){return yt(e.expiry)})),e.next=3,Promise.all(t.map((function(e){return r.deletePairing(e.topic)})));case 3:case"end":return e.stop()}}),e)}))),this.onRelayEventRequest=function(e){var t=e.topic,n=e.payload;switch(n.method){case"wc_pairingPing":return r.onPairingPingRequest(t,n);case"wc_pairingDelete":return r.onPairingDeleteRequest(t,n);default:return r.onUnknownRpcMethodRequest(t,n)}},this.onRelayEventResponse=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,o=t.payload,e.next=4,r.core.history.get(n,o.id);case 4:a=e.sent.request.method,e.t0=a,e.next="wc_pairingPing"===e.t0?8:9;break;case 8:return e.abrupt("return",r.onPairingPingResponse(n,o));case 9:return e.abrupt("return",r.onUnknownRpcMethodResponse(a));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onPairingPingRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.id,e.prev=1,r.isValidPing({topic:t}),e.next=5,r.sendResult(o,t,!0);case 5:r.events.emit("pairing_ping",{id:o,topic:t}),e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(1),e.next=12,r.sendError(o,t,e.t0);case 12:r.logger.error(e.t0);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),this.onPairingPingResponse=function(e,t){var n=t.id;setTimeout((function(){(0,hn.isJsonRpcResult)(t)?r.events.emit(bt("pairing_ping",n),{}):(0,hn.isJsonRpcError)(t)&&r.events.emit(bt("pairing_ping",n),{error:t.error})}),500)},this.onPairingDeleteRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.id,e.prev=1,r.isValidDisconnect({topic:t}),e.next=5,r.deletePairing(t);case 5:r.events.emit("pairing_delete",{id:o,topic:t}),e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(1),e.next=12,r.sendError(o,t,e.t0);case 12:r.logger.error(e.t0);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),this.onUnknownRpcMethodRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a,s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.id,a=n.method,e.prev=1,!r.registeredMethods.includes(a)){e.next=4;break}return e.abrupt("return");case 4:return s=Dt("WC_METHOD_UNSUPPORTED",a),e.next=7,r.sendError(o,t,s);case 7:r.logger.error(s),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(o,t,e.t0);case 14:r.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),this.onUnknownRpcMethodResponse=function(e){r.registeredMethods.includes(e)||r.logger.error(Dt("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=function(e){if(!tn(e)){var t=Ut("MISSING_OR_INVALID","pair() params: ".concat(e)).message;throw new Error(t)}if(!function(e){if(zt(e,!1))try{return typeof new URL(e)<"u"}catch(t){return!1}return!1}(e.uri)){var n=Ut("MISSING_OR_INVALID","pair() uri: ".concat(e.uri)).message;throw new Error(n)}},this.isValidPing=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","ping() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.topic,e.next=6,r.isValidPairingTopic(a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.isValidDisconnect=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","disconnect() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.topic,e.next=6,r.isValidPairingTopic(a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.isValidPairingTopic=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(zt(t,!1)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","pairing topic should be a string: ".concat(t)),o=n.message,new Error(o);case 3:if(r.pairings.keys.includes(t)){e.next=6;break}throw a=Ut("NO_MATCHING_KEY","pairing topic doesn't exist: ".concat(t)),s=a.message,new Error(s);case 6:if(!yt(r.pairings.get(t).expiry)){e.next=11;break}return e.next=9,r.deletePairing(t);case 9:throw u=Ut("EXPIRED","pairing topic: ".concat(t)),c=u.message,new Error(c);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.core=t,this.logger=(0,N.generateChildLogger)(n,this.name),this.pairings=new lo(this.core,this.logger,this.name,this.storagePrefix)}return(0,s.Z)(e,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}},{key:"registerRelayerEvents",value:function(){var e=this;this.core.relayer.on(si,function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){var r,o,a;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.topic,o=n.message,e.pairings.keys.includes(r)&&!e.ignoredPayloadTypes.includes(e.core.crypto.getPayloadType(o))){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,e.core.crypto.decode(r,o);case 5:if(a=t.sent,t.prev=6,!(0,hn.isJsonRpcRequest)(a)){t.next=11;break}e.core.history.set(r,a),e.onRelayEventRequest({topic:r,payload:a}),t.next=18;break;case 11:if(t.t0=(0,hn.isJsonRpcResponse)(a),!t.t0){t.next=18;break}return t.next=15,e.core.history.resolve(a);case 15:return t.next=17,e.onRelayEventResponse({topic:r,payload:a});case 17:e.core.history.delete(r,a.id);case 18:t.next=23;break;case 20:t.prev=20,t.t1=t.catch(6),e.logger.error(t.t1);case 23:case"end":return t.stop()}}),t,null,[[6,20]])})));return function(e){return t.apply(this,arguments)}}())}},{key:"registerExpirerEvents",value:function(){var e=this;this.core.expirer.on(Ri,function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){var r,o;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=mt(n.target),o=r.topic,t.t0=o&&e.pairings.keys.includes(o),!t.t0){t.next=6;break}return t.next=5,e.deletePairing(o,!0);case 5:e.events.emit("pairing_expire",{topic:o});case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}]),e}(),po=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var s;return(0,a.Z)(this,n),(s=t.call(this,e,r)).core=e,s.logger=r,s.records=new Map,s.events=new f.EventEmitter,s.name="history",s.version="0.3",s.cached=[],s.initialized=!1,s.storagePrefix=$r,s.init=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=9;break}return s.logger.trace("Initialized"),e.next=5,s.restore();case 5:s.cached.forEach((function(e){return s.records.set(e.id,e)})),s.cached=[],s.registerEventListeners(),s.initialized=!0;case 9:case"end":return e.stop()}}),e)}))),s.set=function(e,t,n){if(s.isInitialized(),s.logger.debug("Setting JSON-RPC request history record"),s.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:n}),!s.records.has(t.id)){var r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:n,expiry:gt(x.THIRTY_DAYS)};s.records.set(r.id,r),s.events.emit(Si,r)}},s.resolve=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),s.logger.debug("Updating JSON-RPC response history record"),s.logger.trace({type:"method",method:"update",response:t}),s.records.has(t.id)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,s.getRecord(t.id);case 4:typeof(n=e.sent).response>"u"&&(n.response=(0,hn.isJsonRpcError)(t)?{error:t.error}:{result:t.result},s.records.set(n.id,n),s.events.emit(Oi,n));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.get=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.isInitialized(),s.logger.debug("Getting record"),s.logger.trace({type:"method",method:"get",topic:t,id:n}),e.next=5,s.getRecord(n);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.delete=function(e,t){s.isInitialized(),s.logger.debug("Deleting record"),s.logger.trace({type:"method",method:"delete",id:t}),s.values.forEach((function(n){if(n.topic===e){if(typeof t<"u"&&n.id!==t)return;s.records.delete(n.id),s.events.emit(Ti,n)}}))},s.exists=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.isInitialized(),!s.records.has(n)){e.next=9;break}return e.next=4,s.getRecord(n);case 4:e.t1=e.sent.topic,e.t2=t,e.t0=e.t1===e.t2,e.next=10;break;case 9:e.t0=!1;case 10:return e.abrupt("return",e.t0);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.on=function(e,t){s.events.on(e,t)},s.once=function(e,t){s.events.once(e,t)},s.off=function(e,t){s.events.off(e,t)},s.removeListener=function(e,t){s.events.removeListener(e,t)},s.logger=(0,N.generateChildLogger)(r,s.name),s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"size",get:function(){return this.records.size}},{key:"keys",get:function(){return Array.from(this.records.keys())}},{key:"values",get:function(){return Array.from(this.records.values())}},{key:"pending",get:function(){var e=[];return this.values.forEach((function(t){if(!(typeof t.response<"u")){var n={topic:t.topic,request:(0,hn.formatJsonRpcRequest)(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(n)}})),e}},{key:"setJsonRpcRecords",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getJsonRpcRecords",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRecord",value:function(e){this.isInitialized();var t=this.records.get(e);if(!t){var n=Ut("NO_MATCHING_KEY","".concat(this.name,": ").concat(e)).message;throw new Error(n)}return t}},{key:"persist",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setJsonRpcRecords(this.values);case 2:this.events.emit(Pi);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restore",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getJsonRpcRecords();case 3:if(!(typeof(t=e.sent)>"u")&&t.length){e.next=6;break}return e.abrupt("return");case 6:if(!this.records.size){e.next=9;break}throw n=Ut("RESTORE_WILL_OVERRIDE",this.name),r=n.message,this.logger.error(r),new Error(r);case 9:this.cached=t,this.logger.debug("Successfully Restored records for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",records:this.values}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.debug("Failed to Restore records for ".concat(this.name)),this.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"registerEventListeners",value:function(){var e=this;this.events.on(Si,(function(t){var n=Si;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,record:t}),e.persist()})),this.events.on(Oi,(function(t){var n=Oi;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,record:t}),e.persist()})),this.events.on(Ti,(function(t){var n=Ti;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,record:t}),e.persist()})),this.core.heartbeat.on(j.HEARTBEAT_EVENTS.pulse,(function(){e.cleanup()}))}},{key:"cleanup",value:function(){var e=this;try{this.records.forEach((function(t){(0,x.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(e.logger.info("Deleting expired history log: ".concat(t.id)),e.delete(t.topic,t.id))}))}catch(t){this.logger.warn(t)}}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),n}(U),ho=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var s;return(0,a.Z)(this,n),(s=t.call(this,e,r)).core=e,s.logger=r,s.expirations=new Map,s.events=new f.EventEmitter,s.name="expirer",s.version="0.3",s.cached=[],s.initialized=!1,s.storagePrefix=$r,s.init=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=9;break}return s.logger.trace("Initialized"),e.next=5,s.restore();case 5:s.cached.forEach((function(e){return s.expirations.set(e.target,e)})),s.cached=[],s.registerEventListeners(),s.initialized=!0;case 9:case"end":return e.stop()}}),e)}))),s.has=function(e){try{var t=s.formatTarget(e);return typeof s.getExpiration(t)<"u"}catch(n){return!1}},s.set=function(e,t){s.isInitialized();var n=s.formatTarget(e),r={target:n,expiry:t};s.expirations.set(n,r),s.checkExpiry(n,r),s.events.emit(Ci,{target:n,expiration:r})},s.get=function(e){s.isInitialized();var t=s.formatTarget(e);return s.getExpiration(t)},s.del=function(e){if(s.isInitialized(),s.has(e)){var t=s.formatTarget(e),n=s.getExpiration(t);s.expirations.delete(t),s.events.emit(Ii,{target:t,expiration:n})}},s.on=function(e,t){s.events.on(e,t)},s.once=function(e,t){s.events.once(e,t)},s.off=function(e,t){s.events.off(e,t)},s.removeListener=function(e,t){s.events.removeListener(e,t)},s.logger=(0,N.generateChildLogger)(r,s.name),s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"storageKey",get:function(){return this.storagePrefix+this.version+"//"+this.name}},{key:"length",get:function(){return this.expirations.size}},{key:"keys",get:function(){return Array.from(this.expirations.keys())}},{key:"values",get:function(){return Array.from(this.expirations.values())}},{key:"formatTarget",value:function(e){if("string"==typeof e)return function(e){return vt("topic",e)}(e);if("number"==typeof e)return function(e){return vt("id",e)}(e);var t=Ut("UNKNOWN_TYPE","Target type: ".concat(typeof e)).message;throw new Error(t)}},{key:"setExpirations",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.setItem(this.storageKey,t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getExpirations",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.core.storage.getItem(this.storageKey);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"persist",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setExpirations(this.values);case 2:this.events.emit(ji);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restore",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,n,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getExpirations();case 3:if(!(typeof(t=e.sent)>"u")&&t.length){e.next=6;break}return e.abrupt("return");case 6:if(!this.expirations.size){e.next=9;break}throw n=Ut("RESTORE_WILL_OVERRIDE",this.name),r=n.message,this.logger.error(r),new Error(r);case 9:this.cached=t,this.logger.debug("Successfully Restored expirations for ".concat(this.name)),this.logger.trace({type:"method",method:"restore",expirations:this.values}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.debug("Failed to Restore expirations for ".concat(this.name)),this.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"getExpiration",value:function(e){var t=this.expirations.get(e);if(!t){var n=Ut("NO_MATCHING_KEY","".concat(this.name,": ").concat(e)).message;throw this.logger.error(n),new Error(n)}return t}},{key:"checkExpiry",value:function(e,t){var n=t.expiry;(0,x.toMiliseconds)(n)-Date.now()<=0&&this.expire(e,t)}},{key:"expire",value:function(e,t){this.expirations.delete(e),this.events.emit(Ri,{target:e,expiration:t})}},{key:"checkExpirations",value:function(){var e=this;this.core.relayer.connected&&this.expirations.forEach((function(t,n){return e.checkExpiry(n,t)}))}},{key:"registerEventListeners",value:function(){var e=this;this.core.heartbeat.on(j.HEARTBEAT_EVENTS.pulse,(function(){return e.checkExpirations()})),this.events.on(Ci,(function(t){var n=Ci;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,data:t}),e.persist()})),this.events.on(Ri,(function(t){var n=Ri;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,data:t}),e.persist()})),this.events.on(Ii,(function(t){var n=Ii;e.logger.info("Emitting ".concat(n)),e.logger.debug({type:"event",event:n,data:t}),e.persist()}))}},{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}}]),n}(H),vo=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var s;return(0,a.Z)(this,n),(s=t.call(this,e,r)).projectId=e,s.logger=r,s.name=Ni,s.initialized=!1,s.init=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=ot()||!at(),e.t0){e.next=5;break}return s.verifyUrl=(null===t||void 0===t?void 0:t.verifyUrl)||Mi,e.next=5,s.createIframe();case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.register=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=s.initialized,e.t0){e.next=4;break}return e.next=4,s.init();case 4:if(!s.iframe){e.next=6;break}try{null==(n=s.iframe.contentWindow)||n.postMessage(t.attestationId,s.verifyUrl),s.logger.info("postMessage sent: ".concat(t.attestationId," ").concat(s.verifyUrl))}catch(r){}case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.resolve=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!s.isDevEnv){e.next=2;break}return e.abrupt("return","");case 2:return s.logger.info("resolving attestation: ".concat(t.attestationId)),r=s.startAbortTimer(x.FIVE_SECONDS),e.next=6,fetch("".concat(s.verifyUrl,"/attestation/").concat(t.attestationId),{signal:s.abortController.signal});case 6:if(o=e.sent,clearTimeout(r),200!==o.status){e.next=20;break}return e.next=11,o.json();case 11:if(e.t1=n=e.sent,null!=e.t1){e.next=16;break}e.t2=void 0,e.next=17;break;case 16:e.t2=n.origin;case 17:e.t0=e.t2,e.next=21;break;case 20:e.t0="";case 21:return e.abrupt("return",e.t0);case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.createIframe=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.race([new Promise((function(e,t){if(document.getElementById(Ni))return e();var n=document.createElement("iframe");n.setAttribute("id",Ni),n.setAttribute("src","".concat(s.verifyUrl,"/").concat(s.projectId)),n.style.display="none",n.addEventListener("load",(function(){s.initialized=!0,e()})),n.addEventListener("error",(function(e){t(e)})),document.body.append(n),s.iframe=n})),new Promise((function(e){setTimeout((function(){return e("iframe load timeout")}),(0,x.toMiliseconds)(x.ONE_SECOND/2))}))]);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),s.logger.error("Verify iframe failed to load: ".concat(s.verifyUrl)),s.logger.error(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])}))),s.logger=(0,N.generateChildLogger)(r,s.name),s.verifyUrl=Mi,s.abortController=new AbortController,s.isDevEnv=it()&&{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.IS_VITEST,s}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"startAbortTimer",value:function(e){var t=this;return setTimeout((function(){return t.abortController.abort()}),(0,x.toMiliseconds)(e))}}]),n}(q),mo=Object.defineProperty,go=Object.getOwnPropertySymbols,yo=Object.prototype.hasOwnProperty,bo=Object.prototype.propertyIsEnumerable,wo=function(e,t,n){return t in e?mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},xo=function(e,t){for(var n in t||(t={}))yo.call(t,n)&&wo(e,n,t[n]);if(go){var r,i=(0,l.Z)(go(t));try{for(i.s();!(r=i.n()).done;){n=r.value;bo.call(t,n)&&wo(e,n,t[n])}}catch(o){i.e(o)}finally{i.f()}}return e},ko=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e){var r;(0,a.Z)(this,n),(r=t.call(this,e)).protocol="wc",r.version=2,r.name=Xr,r.events=new f.EventEmitter,r.initialized=!1,r.on=function(e,t){return r.events.on(e,t)},r.once=function(e,t){return r.events.once(e,t)},r.off=function(e,t){return r.events.off(e,t)},r.removeListener=function(e,t){return r.events.removeListener(e,t)},r.projectId=null===e||void 0===e?void 0:e.projectId,r.relayUrl=(null===e||void 0===e?void 0:e.relayUrl)||oi;var i=typeof(null===e||void 0===e?void 0:e.logger)<"u"&&"string"!=typeof(null===e||void 0===e?void 0:e.logger)?e.logger:(0,N.pino)((0,N.getDefaultLoggerOptions)({level:(null===e||void 0===e?void 0:e.logger)||ei}));return r.logger=(0,N.generateChildLogger)(i,r.name),r.heartbeat=new j.HeartBeat,r.crypto=new Ui((0,T.Z)(r),r.logger,null===e||void 0===e?void 0:e.keychain),r.history=new po((0,T.Z)(r),r.logger),r.expirer=new ho((0,T.Z)(r),r.logger),r.storage=null!=e&&e.storage?e.storage:new R.ZP(xo(xo({},ti),null===e||void 0===e?void 0:e.storageOptions)),r.relayer=new ro({core:(0,T.Z)(r),logger:r.logger,relayUrl:r.relayUrl,projectId:r.projectId}),r.pairing=new fo((0,T.Z)(r),r.logger),r.verify=new vo(r.projectId||"",r.logger),r}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"start",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.initialized,e.t0){e.next=4;break}return e.next=4,this.initialize();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initialize",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.trace("Initialized"),e.prev=1,e.next=4,this.crypto.init();case 4:return e.next=6,this.history.init();case 6:return e.next=8,this.expirer.init();case 8:return e.next=10,this.relayer.init();case 10:return e.next=12,this.heartbeat.init();case 12:return e.next=14,this.pairing.init();case 14:this.initialized=!0,this.logger.info("Core Initialization Success"),e.next=21;break;case 18:throw e.prev=18,e.t0=e.catch(1),this.logger.warn("Core Initialization Failure at epoch ".concat(Date.now()),e.t0),this.logger.error(e.t0.message),e.t0;case 21:case"end":return e.stop()}}),e,this,[[1,18]])})));return function(){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var r,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new n(t),e.next=3,r.initialize();case 3:return e.next=5,r.crypto.getClientId();case 5:return o=e.sent,e.next=8,r.storage.setItem("WALLETCONNECT_CLIENT_ID",o);case 8:return e.abrupt("return",r);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(L),_o=ko,Eo="client",Ao="".concat("wc","@").concat(2,":").concat(Eo,":"),So=Eo,Oo="error",To="WALLETCONNECT_DEEPLINK_CHOICE",Po="Proposal expired",Co=x.SEVEN_DAYS,Io={wc_sessionPropose:{req:{ttl:x.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:x.ONE_DAY,prompt:!1,tag:1104},res:{ttl:x.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:x.ONE_DAY,prompt:!1,tag:1106},res:{ttl:x.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:x.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:x.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:x.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:x.ONE_DAY,prompt:!1,tag:1112},res:{ttl:x.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:x.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:x.THIRTY_SECONDS,prompt:!1,tag:1115}}},Ro={min:x.FIVE_MINUTES,max:x.SEVEN_DAYS},jo="idle",No="active",Mo=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"],Lo=Object.defineProperty,Uo=Object.defineProperties,Do=Object.getOwnPropertyDescriptors,Bo=Object.getOwnPropertySymbols,Fo=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable,zo=function(e,t,n){return t in e?Lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ho=function(e,t){for(var n in t||(t={}))Fo.call(t,n)&&zo(e,n,t[n]);if(Bo){var r,i=(0,l.Z)(Bo(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Zo.call(t,n)&&zo(e,n,t[n])}}catch(o){i.e(o)}finally{i.f()}}return e},qo=function(e,t){return Uo(e,Do(t))},Vo=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e){var r;return(0,a.Z)(this,n),(r=t.call(this,e)).name="engine",r.events=new(d()),r.initialized=!1,r.ignoredPayloadTypes=[Ne],r.requestQueue={state:jo,requests:[]},r.requestQueueDelay=x.ONE_SECOND,r.init=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=r.initialized,e.t0){e.next=9;break}return e.next=4,r.cleanup();case 4:r.registerRelayerEvents(),r.registerExpirerEvents(),r.client.core.pairing.register({methods:Object.keys(Io)}),r.initialized=!0,setTimeout((function(){r.requestQueue.requests=r.getPendingSessionRequests(),r.processRequestQueue()}),(0,x.toMiliseconds)(r.requestQueueDelay));case 9:case"end":return e.stop()}}),e)}))),r.connect=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,a,s,u,c,l,f,d,p,h,v,m,g,y,b,w,k,_,E,A,S,O;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),n=qo(Ho({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}}),e.next=4,r.isValidConnect(n);case 4:if(a=n.pairingTopic,s=n.requiredNamespaces,u=n.optionalNamespaces,c=n.sessionProperties,l=n.relays,p=!1,(f=a)&&(p=r.client.core.pairing.pairings.get(f).active),f&&p){e.next=13;break}return e.next=9,r.client.core.pairing.create();case 9:h=e.sent,v=h.topic,m=h.uri,f=v,d=m;case 13:return e.next=15,r.client.core.crypto.generateKeyPair();case 15:if(g=e.sent,y=Ho({requiredNamespaces:s,optionalNamespaces:u,relays:null!==l&&void 0!==l?l:[{protocol:"irn"}],proposer:{publicKey:g,metadata:r.client.metadata}},c&&{sessionProperties:c}),b=pt(x.FIVE_MINUTES,Po),w=b.reject,k=b.resolve,_=b.done,r.events.once(bt("session_connect"),function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.error,o=t.session,!n){e.next=5;break}w(n),e.next=17;break;case 5:if(!o){e.next=17;break}return o.self.publicKey=g,a=qo(Ho({},o),{requiredNamespaces:o.requiredNamespaces,optionalNamespaces:o.optionalNamespaces}),e.next=10,r.client.session.set(o.topic,a);case 10:return e.next=12,r.setExpiry(o.topic,o.expiry);case 12:if(e.t0=f,!e.t0){e.next=16;break}return e.next=16,r.client.core.pairing.updateMetadata({topic:f,metadata:o.peer.metadata});case 16:k(a);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),f){e.next=24;break}throw E=Ut("NO_MATCHING_KEY","connect() pairing topic: ".concat(f)),A=E.message,new Error(A);case 24:return e.next=26,r.sendRequest(f,"wc_sessionPropose",y);case 26:return S=e.sent,O=gt(x.FIVE_MINUTES),e.next=30,r.setProposal(S,Ho({id:S,expiry:O},y));case 30:return e.abrupt("return",{uri:d,approval:_});case 31:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.pair=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.client.core.pairing.pair(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.approve=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c,l,f,d,p,h,v,m,g;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidApprove(t);case 3:return n=t.id,o=t.relayProtocol,a=t.namespaces,s=t.sessionProperties,u=r.client.proposal.get(n),c=u.pairingTopic,l=u.proposer,f=u.requiredNamespaces,d=u.optionalNamespaces,c=c||"",Ft(f)||(f=Nt(a,"approve()")),e.next=8,r.client.core.crypto.generateKeyPair();case 8:return p=e.sent,h=l.publicKey,e.next=12,r.client.core.crypto.generateSharedKey(p,h);case 12:if(v=e.sent,e.t0=c&&n,!e.t0){e.next=23;break}return e.next=17,r.client.core.pairing.updateMetadata({topic:c,metadata:l.metadata});case 17:return e.next=19,r.sendResult(n,c,{relay:{protocol:null!==o&&void 0!==o?o:"irn"},responderPublicKey:p});case 19:return e.next=21,r.client.proposal.delete(n,Dt("USER_DISCONNECTED"));case 21:return e.next=23,r.client.core.pairing.activate({topic:c});case 23:return m=Ho({relay:{protocol:null!==o&&void 0!==o?o:"irn"},namespaces:a,requiredNamespaces:f,optionalNamespaces:d,pairingTopic:c,controller:{publicKey:p,metadata:r.client.metadata},expiry:gt(Co)},s&&{sessionProperties:s}),e.next=26,r.client.core.relayer.subscribe(v);case 26:return e.next=28,r.sendRequest(v,"wc_sessionSettle",m);case 28:return g=qo(Ho({},m),{topic:v,pairingTopic:c,acknowledged:!1,self:m.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:p}),e.next=31,r.client.session.set(v,g);case 31:return e.next=33,r.setExpiry(v,gt(Co));case 33:return e.abrupt("return",{topic:v,acknowledged:function(){return new Promise((function(e){return setTimeout((function(){return e(r.client.session.get(v))}),500)}))}});case 34:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.reject=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidReject(t);case 3:if(n=t.id,o=t.reason,a=r.client.proposal.get(n),s=a.pairingTopic,e.t0=s,!e.t0){e.next=10;break}return e.next=8,r.sendError(n,s,o);case 8:return e.next=10,r.client.proposal.delete(n,Dt("USER_DISCONNECTED"));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.update=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidUpdate(t);case 3:return n=t.topic,o=t.namespaces,e.next=7,r.sendRequest(n,"wc_sessionUpdate",{namespaces:o});case 7:return a=e.sent,s=pt(),u=s.done,c=s.resolve,l=s.reject,r.events.once(bt("session_update",a),(function(e){var t=e.error;t?l(t):c()})),e.next=15,r.client.session.update(n,{namespaces:o});case 15:return e.abrupt("return",{acknowledged:u});case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.extend=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidExtend(t);case 3:return n=t.topic,e.next=6,r.sendRequest(n,"wc_sessionExtend",{});case 6:return o=e.sent,a=pt(),s=a.done,u=a.resolve,c=a.reject,r.events.once(bt("session_extend",o),(function(e){var t=e.error;t?c(t):u()})),e.next=14,r.setExpiry(n,gt(Co));case 14:return e.abrupt("return",{acknowledged:s});case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.request=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c,l,f,d,p;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidRequest(t);case 3:return n=t.chainId,o=t.request,a=t.topic,s=t.expiry,e.next=9,r.sendRequest(a,"wc_sessionRequest",{request:o,chainId:n},s);case 9:return u=e.sent,c=pt(s),l=c.done,f=c.resolve,d=c.reject,r.events.once(bt("session_request",u),(function(e){var t=e.error,n=e.result;t?d(t):f(n)})),r.client.events.emit("session_request_sent",{topic:a,request:o,chainId:n,id:u}),e.next=17,r.client.core.storage.getItem(To);case 17:return p=e.sent,wt({id:u,topic:a,wcDeepLink:p}),e.next=21,l();case 21:return e.abrupt("return",e.sent);case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.respond=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidRespond(t);case 3:if(n=t.topic,o=t.response,a=o.id,!(0,hn.isJsonRpcResult)(o)){e.next=9;break}return e.next=7,r.sendResult(a,n,o.result);case 7:e.next=13;break;case 9:if(e.t0=(0,hn.isJsonRpcError)(o),!e.t0){e.next=13;break}return e.next=13,r.sendError(a,n,o.error);case 13:r.cleanupAfterResponse(t);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.ping=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidPing(t);case 3:if(n=t.topic,!r.client.session.keys.includes(n)){e.next=17;break}return e.next=7,r.sendRequest(n,"wc_sessionPing",{});case 7:return o=e.sent,a=pt(),s=a.done,u=a.resolve,c=a.reject,r.events.once(bt("session_ping",o),(function(e){var t=e.error;t?c(t):u()})),e.next=15,s();case 15:e.next=21;break;case 17:if(e.t0=r.client.core.pairing.pairings.keys.includes(n),!e.t0){e.next=21;break}return e.next=21,r.client.core.pairing.ping({topic:n});case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.emit=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidEmit(t);case 3:return n=t.topic,o=t.event,a=t.chainId,e.next=6,r.sendRequest(n,"wc_sessionEvent",{event:o,chainId:a});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.disconnect=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r.isInitialized(),e.next=3,r.isValidDisconnect(t);case 3:if(n=t.topic,!r.client.session.keys.includes(n)){e.next=13;break}return o=(0,hn.getBigIntRpcId)().toString(),s=function e(t){(null===t||void 0===t?void 0:t.id.toString())===o&&(r.client.core.relayer.events.removeListener(ui,e),a())},e.next=9,Promise.all([new Promise((function(e){a=e,r.client.core.relayer.on(ui,s)})),r.sendRequest(n,"wc_sessionDelete",Dt("USER_DISCONNECTED"),void 0,o)]);case 9:return e.next=11,r.deleteSession(n);case 11:e.next=15;break;case 13:return e.next=15,r.client.core.pairing.disconnect({topic:n});case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.find=function(e){return r.isInitialized(),r.client.session.getAll().filter((function(t){return function(e,t){var n=t.requiredNamespaces,r=Object.keys(e.namespaces),i=Object.keys(n),o=!0;return!!lt(i,r)&&(r.forEach((function(t){var r=e.namespaces[t],i=r.accounts,a=r.methods,s=r.events,u=jt(i),c=n[t];(!lt(Te(t,c),u)||!lt(c.methods,a)||!lt(c.events,s))&&(o=!1)})),o)}(t,e)}))},r.getPendingSessionRequests=function(){return r.isInitialized(),r.client.pendingRequest.getAll()},r.cleanupDuplicatePairings=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.pairingTopic){e.next=14;break}if(e.prev=1,n=r.client.core.pairing.pairings.get(t.pairingTopic),o=r.client.core.pairing.pairings.getAll().filter((function(e){var r,i;return(null==(r=e.peerMetadata)?void 0:r.url)&&(null==(i=e.peerMetadata)?void 0:i.url)===t.peer.metadata.url&&e.topic&&e.topic!==n.topic})),0!==o.length){e.next=5;break}return e.abrupt("return");case 5:return r.client.logger.info("Cleaning up ".concat(o.length," duplicate pairing(s)")),e.next=8,Promise.all(o.map((function(e){return r.client.core.pairing.disconnect({topic:e.topic})})));case 8:r.client.logger.info("Duplicate pairings clean up finished"),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),r.client.logger.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}(),r.deleteSession=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.client.session.get(t),a=o.self,e.next=3,r.client.core.relayer.unsubscribe(t);case 3:if(r.client.session.delete(t,Dt("USER_DISCONNECTED")),e.t0=r.client.core.crypto.keychain.has(a.publicKey),!e.t0){e.next=8;break}return e.next=8,r.client.core.crypto.deleteKeyPair(a.publicKey);case 8:if(e.t1=r.client.core.crypto.keychain.has(t),!e.t1){e.next=12;break}return e.next=12,r.client.core.crypto.deleteSymKey(t);case 12:n||r.client.core.expirer.del(t),r.client.core.storage.removeItem(To).catch((function(e){return r.client.logger.warn(e)}));case 14:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.deleteProposal=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([r.client.proposal.delete(t,Dt("USER_DISCONNECTED")),n?Promise.resolve():r.client.core.expirer.del(t)]);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.deletePendingSessionRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a=arguments;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.length>2&&void 0!==a[2]&&a[2],e.next=3,Promise.all([r.client.pendingRequest.delete(t,n),o?Promise.resolve():r.client.core.expirer.del(t)]);case 3:r.requestQueue.requests=r.requestQueue.requests.filter((function(e){return e.id!==t})),o&&(r.requestQueue.state=jo);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.setExpiry=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=r.client.session.keys.includes(t),!e.t0){e.next=4;break}return e.next=4,r.client.session.update(t,{expiry:n});case 4:r.client.core.expirer.set(t,n);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.setProposal=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.client.proposal.set(t,n);case 2:r.client.core.expirer.set(t,n.expiry);case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.setPendingSessionRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Io.wc_sessionRequest.req.ttl,o=t.id,a=t.topic,s=t.params,e.next=3,r.client.pendingRequest.set(o,{id:o,topic:a,params:s});case 3:n&&r.client.core.expirer.set(o,gt(n));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.sendRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,o,a,s){var u,c,l,f;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=(0,hn.formatJsonRpcRequest)(n,o),!at()||!Mo.includes(n)){e.next=5;break}return c=Ze(JSON.stringify(u)),e.next=5,r.client.core.verify.register({attestationId:c});case 5:return e.next=7,r.client.core.crypto.encode(t,u);case 7:return l=e.sent,f=Io[n].req,e.abrupt("return",(a&&(f.ttl=a),s&&(f.id=s),r.client.core.history.set(t,u),r.client.core.relayer.publish(t,l,f),u.id));case 10:case"end":return e.stop()}}),e)})));return function(t,n,r,i,o){return e.apply(this,arguments)}}(),r.sendResult=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,o){var a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(0,hn.formatJsonRpcResult)(t,o),e.next=3,r.client.core.crypto.encode(n,a);case 3:return s=e.sent,e.next=6,r.client.core.history.get(n,t);case 6:return u=e.sent,c=Io[u.request.method].res,r.client.core.relayer.publish(n,s,c),e.next=11,r.client.core.history.resolve(a);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),r.sendError=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n,o){var a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(0,hn.formatJsonRpcError)(t,o),e.next=3,r.client.core.crypto.encode(n,a);case 3:return s=e.sent,e.next=6,r.client.core.history.get(n,t);case 6:return u=e.sent,c=Io[u.request.method].res,r.client.core.relayer.publish(n,s,c),e.next=11,r.client.core.history.resolve(a);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),r.cleanup=(0,o.Z)((0,i.Z)().mark((function e(){var t,n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],n=[],r.client.session.getAll().forEach((function(e){yt(e.expiry)&&t.push(e.topic)})),r.client.proposal.getAll().forEach((function(e){yt(e.expiry)&&n.push(e.id)})),e.next=5,Promise.all([].concat((0,u.Z)(t.map((function(e){return r.deleteSession(e)}))),(0,u.Z)(n.map((function(e){return r.deleteProposal(e)})))));case 5:case"end":return e.stop()}}),e)}))),r.onRelayEventRequest=function(e){var t=e.topic,n=e.payload,i=n.method;switch(i){case"wc_sessionPropose":return r.onSessionProposeRequest(t,n);case"wc_sessionSettle":return r.onSessionSettleRequest(t,n);case"wc_sessionUpdate":return r.onSessionUpdateRequest(t,n);case"wc_sessionExtend":return r.onSessionExtendRequest(t,n);case"wc_sessionPing":return r.onSessionPingRequest(t,n);case"wc_sessionDelete":return r.onSessionDeleteRequest(t,n);case"wc_sessionRequest":return r.onSessionRequest(t,n);case"wc_sessionEvent":return r.onSessionEventRequest(t,n);default:return r.client.logger.info("Unsupported request method ".concat(i))}},r.onRelayEventResponse=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.topic,o=t.payload,e.next=4,r.client.core.history.get(n,o.id);case 4:a=e.sent.request.method,e.t0=a,e.next="wc_sessionPropose"===e.t0?8:"wc_sessionSettle"===e.t0?9:"wc_sessionUpdate"===e.t0?10:"wc_sessionExtend"===e.t0?11:"wc_sessionPing"===e.t0?12:"wc_sessionRequest"===e.t0?13:14;break;case 8:return e.abrupt("return",r.onSessionProposeResponse(n,o));case 9:return e.abrupt("return",r.onSessionSettleResponse(n,o));case 10:return e.abrupt("return",r.onSessionUpdateResponse(n,o));case 11:return e.abrupt("return",r.onSessionExtendResponse(n,o));case 12:return e.abrupt("return",r.onSessionPingResponse(n,o));case 13:return e.abrupt("return",r.onSessionRequestResponse(n,o));case 14:return e.abrupt("return",r.client.logger.info("Unsupported response method ".concat(a)));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.onRelayEventUnknownPayload=function(e){var t=e.topic,n=Ut("MISSING_OR_INVALID","Decoded payload on topic ".concat(t," is not identifiable as a JSON-RPC request or a response.")).message;throw new Error(n)},r.onSessionProposeRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a,s,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.params,a=n.id,e.prev=1,r.isValidConnect(Ho({},n.params)),s=gt(x.FIVE_MINUTES),u=Ho({id:a,pairingTopic:t,expiry:s},o),e.next=6,r.setProposal(a,u);case 6:return c=Ze(JSON.stringify(n)),e.next=9,r.getVerifyContext(c,u.proposer.metadata);case 9:l=e.sent,r.client.events.emit("session_proposal",{id:a,params:u,verifyContext:l}),e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(1),e.next=17,r.sendError(a,t,e.t0);case 17:r.client.logger.error(e.t0);case 18:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionProposeResponse=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a,s,u,c,l,f;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.id,!(0,hn.isJsonRpcResult)(n)){e.next=22;break}return a=n.result,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a}),s=r.client.proposal.get(o),r.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s}),u=s.proposer.publicKey,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u}),c=a.responderPublicKey,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c}),e.next=12,r.client.core.crypto.generateSharedKey(u,c);case 12:return l=e.sent,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:l}),e.next=16,r.client.core.relayer.subscribe(l);case 16:return f=e.sent,r.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),e.next=20,r.client.core.pairing.activate({topic:t});case 20:e.next=27;break;case 22:if(e.t0=(0,hn.isJsonRpcError)(n),!e.t0){e.next=27;break}return e.next=26,r.client.proposal.delete(o,Dt("USER_DISCONNECTED"));case 26:r.events.emit(bt("session_connect"),{error:n.error});case 27:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionSettleRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a,s,u,c,l,f,d,p,h,v,m;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.id,a=n.params,e.prev=1,r.isValidSessionSettleRequest(a),s=n.params,u=s.relay,c=s.controller,l=s.expiry,f=s.namespaces,d=s.requiredNamespaces,p=s.optionalNamespaces,h=s.sessionProperties,v=s.pairingTopic,m=Ho({topic:t,relay:u,expiry:l,namespaces:f,acknowledged:!0,pairingTopic:v,requiredNamespaces:d,optionalNamespaces:p,controller:c.publicKey,self:{publicKey:"",metadata:r.client.metadata},peer:{publicKey:c.publicKey,metadata:c.metadata}},h&&{sessionProperties:h}),e.next=6,r.sendResult(n.id,t,!0);case 6:r.events.emit(bt("session_connect"),{session:m}),r.cleanupDuplicatePairings(m),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(o,t,e.t0);case 14:r.client.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionSettleResponse=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.id,!(0,hn.isJsonRpcResult)(n)){e.next=7;break}return e.next=4,r.client.session.update(t,{acknowledged:!0});case 4:r.events.emit(bt("session_approve",o),{}),e.next=12;break;case 7:if(e.t0=(0,hn.isJsonRpcError)(n),!e.t0){e.next=12;break}return e.next=11,r.client.session.delete(t,Dt("USER_DISCONNECTED"));case 11:r.events.emit(bt("session_approve",o),{error:n.error});case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionUpdateRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.params,a=n.id,e.prev=1,r.isValidUpdate(Ho({topic:t},o)),e.next=5,r.client.session.update(t,{namespaces:o.namespaces});case 5:return e.next=7,r.sendResult(a,t,!0);case 7:r.client.events.emit("session_update",{id:a,topic:t,params:o}),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(a,t,e.t0);case 14:r.client.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionUpdateResponse=function(e,t){var n=t.id;(0,hn.isJsonRpcResult)(t)?r.events.emit(bt("session_update",n),{}):(0,hn.isJsonRpcError)(t)&&r.events.emit(bt("session_update",n),{error:t.error})},r.onSessionExtendRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.id,e.prev=1,r.isValidExtend({topic:t}),e.next=5,r.setExpiry(t,gt(Co));case 5:return e.next=7,r.sendResult(o,t,!0);case 7:r.client.events.emit("session_extend",{id:o,topic:t}),e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(o,t,e.t0);case 14:r.client.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionExtendResponse=function(e,t){var n=t.id;(0,hn.isJsonRpcResult)(t)?r.events.emit(bt("session_extend",n),{}):(0,hn.isJsonRpcError)(t)&&r.events.emit(bt("session_extend",n),{error:t.error})},r.onSessionPingRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.id,e.prev=1,r.isValidPing({topic:t}),e.next=5,r.sendResult(o,t,!0);case 5:r.client.events.emit("session_ping",{id:o,topic:t}),e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(1),e.next=12,r.sendError(o,t,e.t0);case 12:r.client.logger.error(e.t0);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionPingResponse=function(e,t){var n=t.id;setTimeout((function(){(0,hn.isJsonRpcResult)(t)?r.events.emit(bt("session_ping",n),{}):(0,hn.isJsonRpcError)(t)&&r.events.emit(bt("session_ping",n),{error:t.error})}),500)},r.onSessionDeleteRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.id,e.prev=1,r.isValidDisconnect({topic:t,reason:n.params}),e.next=5,Promise.all([new Promise((function(e){r.client.core.relayer.once(hi,(0,o.Z)((0,i.Z)().mark((function n(){return(0,i.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=e,n.next=3,r.deleteSession(t);case 3:n.t1=n.sent,(0,n.t0)(n.t1);case 5:case"end":return n.stop()}}),n)}))))})),r.sendResult(a,t,!0)]);case 5:r.client.events.emit("session_delete",{id:a,topic:t}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),r.client.logger.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.id,a=n.params,e.prev=1,r.isValidRequest(Ho({topic:t},a)),e.next=5,r.setPendingSessionRequest({id:o,topic:t,params:a});case 5:return r.addRequestToQueue({id:o,topic:t,params:a}),e.next=8,r.processRequestQueue();case 8:e.next=15;break;case 10:return e.prev=10,e.t0=e.catch(1),e.next=14,r.sendError(o,t,e.t0);case 14:r.client.logger.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,10]])})));return function(t,n){return e.apply(this,arguments)}}(),r.onSessionRequestResponse=function(e,t){var n=t.id;(0,hn.isJsonRpcResult)(t)?r.events.emit(bt("session_request",n),{result:t.result}):(0,hn.isJsonRpcError)(t)&&r.events.emit(bt("session_request",n),{error:t.error})},r.onSessionEventRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=n.id,a=n.params,e.prev=1,r.isValidEmit(Ho({topic:t},a)),r.client.events.emit("session_event",{id:o,topic:t,params:a}),e.next=10;break;case 5:return e.prev=5,e.t0=e.catch(1),e.next=9,r.sendError(o,t,e.t0);case 9:r.client.logger.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[1,5]])})));return function(t,n){return e.apply(this,arguments)}}(),r.addRequestToQueue=function(e){r.requestQueue.requests.push(e)},r.cleanupAfterResponse=function(e){r.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout((function(){r.requestQueue.state=jo,r.processRequestQueue()}),(0,x.toMiliseconds)(r.requestQueueDelay))},r.processRequestQueue=(0,o.Z)((0,i.Z)().mark((function e(){var t,n,o,a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.requestQueue.state!==No){e.next=3;break}return r.client.logger.info("session request queue is already active."),e.abrupt("return");case 3:if(t=r.requestQueue.requests[0]){e.next=7;break}return r.client.logger.info("session request queue is empty."),e.abrupt("return");case 7:return e.prev=7,n=t.id,o=t.topic,a=t.params,s=Ze(JSON.stringify({id:n,params:a})),u=r.client.session.get(o),e.next=15,r.getVerifyContext(s,u.peer.metadata);case 15:c=e.sent,r.requestQueue.state=No,r.client.events.emit("session_request",{id:n,topic:o,params:a,verifyContext:c}),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(7),r.client.logger.error(e.t0);case 22:case"end":return e.stop()}}),e,null,[[7,19]])}))),r.isValidConnect=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c,l,f,d;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","connect() params: ".concat(JSON.stringify(t))),o=n.message,new Error(o);case 3:if(a=t.pairingTopic,s=t.requiredNamespaces,u=t.optionalNamespaces,c=t.sessionProperties,l=t.relays,e.t0=Zt(a),e.t0){e.next=8;break}return e.next=8,r.isValidPairingTopic(a);case 8:if($t(l,!0)){e.next=11;break}throw f=Ut("MISSING_OR_INVALID","connect() relays: ".concat(l)),d=f.message,new Error(d);case 11:!Zt(s)&&0!==Ft(s)&&r.validateNamespaces(s,"requiredNamespaces"),!Zt(u)&&0!==Ft(u)&&r.validateNamespaces(u,"optionalNamespaces"),Zt(c)||r.validateSessionProps(c,"sessionProperties");case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.validateNamespaces=function(e,t){var n=function(e,t,n){var r=null;if(e&&Ft(e)){var i=Jt(e,t);i&&(r=i);var o=Yt(e,t,n);o&&(r=o)}else r=Ut("MISSING_OR_INVALID","".concat(t,", ").concat(n," should be an object with data"));return r}(e,"connect()",t);if(n)throw new Error(n.message)},r.isValidApprove=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c,l,f,d;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=2;break}throw new Error(Ut("MISSING_OR_INVALID","approve() params: ".concat(t)).message);case 2:return n=t.id,o=t.namespaces,a=t.relayProtocol,s=t.sessionProperties,e.next=5,r.isValidProposalId(n);case 5:if(u=r.client.proposal.get(n),!(c=Qt(o,"approve()"))){e.next=8;break}throw new Error(c.message);case 8:if(!(l=ln(u.requiredNamespaces,o,"approve()"))){e.next=11;break}throw new Error(l.message);case 11:if(zt(a,!0)){e.next=14;break}throw f=Ut("MISSING_OR_INVALID","approve() relayProtocol: ".concat(a)),d=f.message,new Error(d);case 14:Zt(s)||r.validateSessionProps(s,"sessionProperties");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidReject=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","reject() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.id,s=t.reason,e.next=6,r.isValidProposalId(a);case 6:if(nn(s)){e.next=9;break}throw u=Ut("MISSING_OR_INVALID","reject() reason: ".concat(JSON.stringify(s))),c=u.message,new Error(c);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidSessionSettleRequest=function(e){if(!tn(e)){var t=Ut("MISSING_OR_INVALID","onSessionSettleRequest() params: ".concat(e)).message;throw new Error(t)}var n=e.relay,r=e.controller,i=e.namespaces,o=e.expiry;if(!Xt(n)){var a=Ut("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string").message;throw new Error(a)}var s=function(e,t){var n=null;return zt(null===e||void 0===e?void 0:e.publicKey,!1)||(n=Ut("MISSING_OR_INVALID","".concat(t," controller public key should be a string"))),n}(r,"onSessionSettleRequest()");if(s)throw new Error(s.message);var u=Qt(i,"onSessionSettleRequest()");if(u)throw new Error(u.message);if(yt(o)){var c=Ut("EXPIRED","onSessionSettleRequest()").message;throw new Error(c)}},r.isValidUpdate=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c,l;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","update() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.topic,s=t.namespaces,e.next=6,r.isValidSessionTopic(a);case 6:if(u=r.client.session.get(a),!(c=Qt(s,"update()"))){e.next=9;break}throw new Error(c.message);case 9:if(!(l=ln(u.requiredNamespaces,s,"update()"))){e.next=12;break}throw new Error(l.message);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidExtend=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","extend() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.topic,e.next=6,r.isValidSessionTopic(a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidRequest=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c,l,f,d,p,h,v,m,g,y,b;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","request() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.topic,s=t.request,u=t.chainId,c=t.expiry,e.next=6,r.isValidSessionTopic(a);case 6:if(l=r.client.session.get(a),sn(f=l.namespaces,u)){e.next=10;break}throw d=Ut("MISSING_OR_INVALID","request() chainId: ".concat(u)),p=d.message,new Error(p);case 10:if(rn(s)){e.next=13;break}throw h=Ut("MISSING_OR_INVALID","request() ".concat(JSON.stringify(s))),v=h.message,new Error(v);case 13:if(un(f,u,s.method)){e.next=16;break}throw m=Ut("MISSING_OR_INVALID","request() method: ".concat(s.method)),g=m.message,new Error(g);case 16:if(!c||dn(c,Ro)){e.next=19;break}throw y=Ut("MISSING_OR_INVALID","request() expiry: ".concat(c,". Expiry must be a number (in seconds) between ").concat(Ro.min," and ").concat(Ro.max)),b=y.message,new Error(b);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidRespond=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","respond() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.topic,s=t.response,e.next=6,r.isValidSessionTopic(a);case 6:if(on(s)){e.next=9;break}throw u=Ut("MISSING_OR_INVALID","respond() response: ".concat(JSON.stringify(s))),c=u.message,new Error(c);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidPing=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","ping() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.topic,e.next=6,r.isValidSessionOrPairingTopic(a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidEmit=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a,s,u,c,l,f,d,p,h,v,m;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","emit() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.topic,s=t.event,u=t.chainId,e.next=6,r.isValidSessionTopic(a);case 6:if(c=r.client.session.get(a),sn(l=c.namespaces,u)){e.next=10;break}throw f=Ut("MISSING_OR_INVALID","emit() chainId: ".concat(u)),d=f.message,new Error(d);case 10:if(an(s)){e.next=13;break}throw p=Ut("MISSING_OR_INVALID","emit() event: ".concat(JSON.stringify(s))),h=p.message,new Error(h);case 13:if(cn(l,u,s.name)){e.next=16;break}throw v=Ut("MISSING_OR_INVALID","emit() event: ".concat(JSON.stringify(s))),m=v.message,new Error(m);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.isValidDisconnect=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(tn(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","disconnect() params: ".concat(t)),o=n.message,new Error(o);case 3:return a=t.topic,e.next=6,r.isValidSessionOrPairingTopic(a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r.getVerifyContext=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}},e.prev=1,e.next=4,r.client.core.verify.resolve({attestationId:t,verifyUrl:n.verifyUrl});case 4:(a=e.sent)&&(o.verified.origin=a,o.verified.validation=a===n.url?"VALID":"INVALID"),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),r.client.logger.error(e.t0);case 11:return e.abrupt("return",(r.client.logger.info("Verify context: ".concat(JSON.stringify(o))),o));case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),r.validateSessionProps=function(e,t){Object.values(e).forEach((function(e){if(!zt(e,!1)){var n=Ut("MISSING_OR_INVALID","".concat(t," must be in Record format. Received: ").concat(JSON.stringify(e))).message;throw new Error(n)}}))},r}return(0,s.Z)(n,[{key:"isInitialized",value:function(){if(!this.initialized){var e=Ut("NOT_INITIALIZED",this.name).message;throw new Error(e)}}},{key:"registerRelayerEvents",value:function(){var e=this;this.client.core.relayer.on(si,function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){var r,o,a;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.topic,o=n.message,!e.ignoredPayloadTypes.includes(e.client.core.crypto.getPayloadType(o))){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,e.client.core.crypto.decode(r,o);case 5:if(a=t.sent,t.prev=6,!(0,hn.isJsonRpcRequest)(a)){t.next=11;break}e.client.core.history.set(r,a),e.onRelayEventRequest({topic:r,payload:a}),t.next=20;break;case 11:if(!(0,hn.isJsonRpcResponse)(a)){t.next=19;break}return t.next=14,e.client.core.history.resolve(a);case 14:return t.next=16,e.onRelayEventResponse({topic:r,payload:a});case 16:e.client.core.history.delete(r,a.id),t.next=20;break;case 19:e.onRelayEventUnknownPayload({topic:r,payload:a});case 20:t.next=25;break;case 22:t.prev=22,t.t0=t.catch(6),e.client.logger.error(t.t0);case 25:case"end":return t.stop()}}),t,null,[[6,22]])})));return function(e){return t.apply(this,arguments)}}())}},{key:"registerExpirerEvents",value:function(){var e=this;this.client.core.expirer.on(Ri,function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){var r,o,a;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=mt(n.target),o=r.topic,!(a=r.id)||!e.client.pendingRequest.keys.includes(a)){t.next=5;break}return t.next=4,e.deletePendingSessionRequest(a,Ut("EXPIRED"),!0);case 4:return t.abrupt("return",t.sent);case 5:if(!o){t.next=13;break}if(t.t0=e.client.session.keys.includes(o),!t.t0){t.next=11;break}return t.next=10,e.deleteSession(o,!0);case 10:e.client.events.emit("session_expire",{topic:o});case 11:t.next=18;break;case 13:if(t.t1=a,!t.t1){t.next=18;break}return t.next=17,e.deleteProposal(a,!0);case 17:e.client.events.emit("proposal_expire",{id:a});case 18:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}},{key:"isValidPairingTopic",value:function(e){if(!zt(e,!1)){var t=Ut("MISSING_OR_INVALID","pairing topic should be a string: ".concat(e)).message;throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){var n=Ut("NO_MATCHING_KEY","pairing topic doesn't exist: ".concat(e)).message;throw new Error(n)}if(yt(this.client.core.pairing.pairings.get(e).expiry)){var r=Ut("EXPIRED","pairing topic: ".concat(e)).message;throw new Error(r)}}},{key:"isValidSessionTopic",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,o,a,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(zt(t,!1)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","session topic should be a string: ".concat(t)),r=n.message,new Error(r);case 3:if(this.client.session.keys.includes(t)){e.next=6;break}throw o=Ut("NO_MATCHING_KEY","session topic doesn't exist: ".concat(t)),a=o.message,new Error(a);case 6:if(!yt(this.client.session.get(t).expiry)){e.next=11;break}return e.next=9,this.deleteSession(t);case 9:throw s=Ut("EXPIRED","session topic: ".concat(t)),u=s.message,new Error(u);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isValidSessionOrPairingTopic",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.client.session.keys.includes(t)){e.next=5;break}return e.next=3,this.isValidSessionTopic(t);case 3:e.next=16;break;case 5:if(!this.client.core.pairing.pairings.keys.includes(t)){e.next=9;break}this.isValidPairingTopic(t),e.next=16;break;case 9:if(!zt(t,!1)){e.next=14;break}throw n=Ut("NO_MATCHING_KEY","session or pairing topic doesn't exist: ".concat(t)),r=n.message,new Error(r);case 14:throw o=Ut("MISSING_OR_INVALID","session or pairing topic should be a string: ".concat(t)),a=o.message,new Error(a);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isValidProposalId",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,o,a,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(en(t)){e.next=3;break}throw n=Ut("MISSING_OR_INVALID","proposal id should be a number: ".concat(t)),r=n.message,new Error(r);case 3:if(this.client.proposal.keys.includes(t)){e.next=6;break}throw o=Ut("NO_MATCHING_KEY","proposal id doesn't exist: ".concat(t)),a=o.message,new Error(a);case 6:if(!yt(this.client.proposal.get(t).expiry)){e.next=11;break}return e.next=9,this.deleteProposal(t);case 9:throw s=Ut("EXPIRED","proposal id: ".concat(t)),u=s.message,new Error(u);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(W),Wo=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var i;return(0,a.Z)(this,n),(i=t.call(this,e,r,"proposal",Ao)).core=e,i.logger=r,i}return(0,s.Z)(n)}(lo),Go=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var i;return(0,a.Z)(this,n),(i=t.call(this,e,r,"session",Ao)).core=e,i.logger=r,i}return(0,s.Z)(n)}(lo),Yo=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e,r){var i;return(0,a.Z)(this,n),(i=t.call(this,e,r,"request",Ao,(function(e){return e.id}))).core=e,i.logger=r,i}return(0,s.Z)(n)}(lo),Ko=function(e){(0,P.Z)(n,e);var t=(0,C.Z)(n);function n(e){var r;(0,a.Z)(this,n),(r=t.call(this,e)).protocol="wc",r.version=2,r.name=So,r.events=new f.EventEmitter,r.on=function(e,t){return r.events.on(e,t)},r.once=function(e,t){return r.events.once(e,t)},r.off=function(e,t){return r.events.off(e,t)},r.removeListener=function(e,t){return r.events.removeListener(e,t)},r.removeAllListeners=function(e){return r.events.removeAllListeners(e)},r.connect=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.connect(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.pair=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.pair(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.approve=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.approve(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.reject=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.reject(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.update=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.update(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.extend=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.extend(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.request=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.request(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.respond=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.respond(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.ping=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.ping(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.emit=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.emit(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.disconnect=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.engine.disconnect(t);case 3:return e.abrupt("return",e.sent);case 6:throw e.prev=6,e.t0=e.catch(0),r.logger.error(e.t0.message),e.t0;case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),r.find=function(e){try{return r.engine.find(e)}catch(t){throw r.logger.error(t.message),t}},r.getPendingSessionRequests=function(){try{return r.engine.getPendingSessionRequests()}catch(e){throw r.logger.error(e.message),e}},r.name=(null===e||void 0===e?void 0:e.name)||So,r.metadata=(null===e||void 0===e?void 0:e.metadata)||(0,Se.D)()||{name:"",description:"",url:"",icons:[""]};var s=typeof(null===e||void 0===e?void 0:e.logger)<"u"&&"string"!=typeof(null===e||void 0===e?void 0:e.logger)?e.logger:(0,N.pino)((0,N.getDefaultLoggerOptions)({level:(null===e||void 0===e?void 0:e.logger)||Oo}));return r.core=(null===e||void 0===e?void 0:e.core)||new _o(e),r.logger=(0,N.generateChildLogger)(s,r.name),r.session=new Go(r.core,r.logger),r.proposal=new Wo(r.core,r.logger),r.pendingRequest=new Yo(r.core,r.logger),r.engine=new Vo((0,T.Z)(r)),r}return(0,s.Z)(n,[{key:"context",get:function(){return(0,N.getLoggerContext)(this.logger)}},{key:"pairing",get:function(){return this.core.pairing.pairings}},{key:"initialize",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.trace("Initialized"),e.prev=1,e.next=4,this.core.start();case 4:return e.next=6,this.session.init();case 6:return e.next=8,this.proposal.init();case 8:return e.next=10,this.pendingRequest.init();case 10:return e.next=12,this.engine.init();case 12:this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success"),e.next=19;break;case 16:throw e.prev=16,e.t0=e.catch(1),this.logger.info("SignClient Initialization Failure"),this.logger.error(e.t0.message),e.t0;case 19:case"end":return e.stop()}}),e,this,[[1,16]])})));return function(){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new n(t),e.next=3,r.initialize();case 3:return e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(V);n(88283),n(7289);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Jo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(0,u.Z)(new Set([].concat((0,u.Z)(e),(0,u.Z)(t))))}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Qo(e){return e.includes(":")}function Xo(e){return Qo(e)?e.split(":")[0]:e}var $o={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}};function ea(e,t){var n=$o[e],r=n.message,i=n.code;return{message:t?"".concat(r," ").concat(t):r,code:i}}function ta(e,t){return!!Array.isArray(e)&&(!(typeof t<"u"&&e.length)||e.every(t))}function na(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}var ra=n(17507),ia="error",oa="".concat("wc","@2:").concat("universal_provider",":"),aa="default_chain_changed",sa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof n.g<"u"?n.g:typeof self<"u"?self:{},ua={exports:{}};!function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,u=64,c=128,l=256,f=1/0,d=9007199254740991,p=NaN,h=4294967295,v=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",u],["rearg",l]],m="[object Arguments]",g="[object Array]",y="[object Boolean]",b="[object Date]",w="[object Error]",x="[object Function]",k="[object GeneratorFunction]",_="[object Map]",E="[object Number]",A="[object Object]",S="[object Promise]",O="[object RegExp]",T="[object Set]",P="[object String]",C="[object Symbol]",I="[object WeakMap]",R="[object ArrayBuffer]",j="[object DataView]",N="[object Float32Array]",M="[object Float64Array]",L="[object Int8Array]",U="[object Int16Array]",D="[object Int32Array]",B="[object Uint8Array]",F="[object Uint8ClampedArray]",Z="[object Uint16Array]",z="[object Uint32Array]",H=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,Y=RegExp(W.source),K=RegExp(G.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ee=/^\w*$/,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,re=RegExp(ne.source),ie=/^\s+/,oe=/\s/,ae=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,ke="\\ud800-\\udfff",_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Ae="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Oe="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="['\u2019]",Ce="["+ke+"]",Ie="["+Te+"]",Re="["+_e+"]",je="\\d+",Ne="["+Ee+"]",Me="["+Ae+"]",Le="[^"+ke+Te+je+Ee+Ae+Se+"]",Ue="\\ud83c[\\udffb-\\udfff]",De="[^"+ke+"]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ze="["+Se+"]",ze="\\u200d",He="(?:"+Me+"|"+Le+")",qe="(?:"+Ze+"|"+Le+")",Ve="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",We="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Re+"|"+Ue+")"+"?",Ye="["+Oe+"]?",Ke=Ye+Ge+("(?:"+ze+"(?:"+[De,Be,Fe].join("|")+")"+Ye+Ge+")*"),Je="(?:"+[Ne,Be,Fe].join("|")+")"+Ke,Qe="(?:"+[De+Re+"?",Re,Be,Fe,Ce].join("|")+")",Xe=RegExp(Pe,"g"),$e=RegExp(Re,"g"),et=RegExp(Ue+"(?="+Ue+")|"+Qe+Ke,"g"),tt=RegExp([Ze+"?"+Me+"+"+Ve+"(?="+[Ie,Ze,"$"].join("|")+")",qe+"+"+We+"(?="+[Ie,Ze+He,"$"].join("|")+")",Ze+"?"+He+"+"+Ve,Ze+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",je,Je].join("|"),"g"),nt=RegExp("["+ze+ke+_e+Oe+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,at={};at[N]=at[M]=at[L]=at[U]=at[D]=at[B]=at[F]=at[Z]=at[z]=!0,at[m]=at[g]=at[R]=at[y]=at[j]=at[b]=at[w]=at[x]=at[_]=at[E]=at[A]=at[O]=at[T]=at[P]=at[I]=!1;var st={};st[m]=st[g]=st[R]=st[j]=st[y]=st[b]=st[N]=st[M]=st[L]=st[U]=st[D]=st[_]=st[E]=st[A]=st[O]=st[T]=st[P]=st[C]=st[B]=st[F]=st[Z]=st[z]=!0,st[w]=st[x]=st[I]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,lt=parseInt,ft="object"==typeof sa&&sa&&sa.Object===Object&&sa,dt="object"==typeof self&&self&&self.Object===Object&&self,pt=ft||dt||Function("return this")(),ht=t&&!t.nodeType&&t,vt=ht&&e&&!e.nodeType&&e,mt=vt&&vt.exports===ht,gt=mt&&ft.process,yt=function(){try{return vt&&vt.require&&vt.require("util").types||gt&>.binding&>.binding("util")}catch(e){}}(),bt=yt&&yt.isArrayBuffer,wt=yt&&yt.isDate,xt=yt&&yt.isMap,kt=yt&&yt.isRegExp,_t=yt&&yt.isSet,Et=yt&&yt.isTypedArray;function At(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function St(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Rt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function tn(e,t){for(var n=e.length;n--&&Zt(t,e[n],0)>-1;);return n}var nn=Wt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),rn=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function on(e){return"\\"+ut[e]}function an(e){return nt.test(e)}function sn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function cn(e,t){for(var n=-1,r=e.length,i=0,a=[];++n",""":'"',"'":"'"});var vn=function e(t){var oe=(t=null==t?pt:vn.defaults(pt.Object(),t,vn.pick(pt,it))).Array,ke=t.Date,_e=t.Error,Ee=t.Function,Ae=t.Math,Se=t.Object,Oe=t.RegExp,Te=t.String,Pe=t.TypeError,Ce=oe.prototype,Ie=Ee.prototype,Re=Se.prototype,je=t["__core-js_shared__"],Ne=Ie.toString,Me=Re.hasOwnProperty,Le=0,Ue=function(){var e=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),De=Re.toString,Be=Ne.call(Se),Fe=pt._,Ze=Oe("^"+Ne.call(Me).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=mt?t.Buffer:n,He=t.Symbol,qe=t.Uint8Array,Ve=ze?ze.allocUnsafe:n,We=un(Se.getPrototypeOf,Se),Ge=Se.create,Ye=Re.propertyIsEnumerable,Ke=Ce.splice,Je=He?He.isConcatSpreadable:n,Qe=He?He.iterator:n,et=He?He.toStringTag:n,nt=function(){try{var e=lo(Se,"defineProperty");return e({},"",{}),e}catch(t){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ft=ke&&ke.now!==pt.Date.now&&ke.now,dt=t.setTimeout!==pt.setTimeout&&t.setTimeout,ht=Ae.ceil,vt=Ae.floor,gt=Se.getOwnPropertySymbols,yt=ze?ze.isBuffer:n,Dt=t.isFinite,Wt=Ce.join,mn=un(Se.keys,Se),gn=Ae.max,yn=Ae.min,bn=ke.now,wn=t.parseInt,xn=Ae.random,kn=Ce.reverse,_n=lo(t,"DataView"),En=lo(t,"Map"),An=lo(t,"Promise"),Sn=lo(t,"Set"),On=lo(t,"WeakMap"),Tn=lo(Se,"create"),Pn=On&&new On,Cn={},In=Uo(_n),Rn=Uo(En),jn=Uo(An),Nn=Uo(Sn),Mn=Uo(On),Ln=He?He.prototype:n,Un=Ln?Ln.valueOf:n,Dn=Ln?Ln.toString:n;function Bn(e){if(es(e)&&!Ha(e)&&!(e instanceof Hn)){if(e instanceof zn)return e;if(Me.call(e,"__wrapped__"))return Do(e)}return new zn(e)}var Fn=function(){function e(){}return function(t){if(!$a(t))return{};if(Ge)return Ge(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Zn(){}function zn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Hn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,r,i,o,a){var s,u=1&t,c=2&t,l=4&t;if(r&&(s=o?r(e,i,o,a):r(e)),s!==n)return s;if(!$a(e))return e;var f=Ha(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!u)return Ti(e,s)}else{var d=ho(e),p=d==x||d==k;if(Ga(e))return ki(e,u);if(d==A||d==m||p&&!o){if(s=c||p?{}:mo(e),!u)return c?function(e,t){return Pi(e,po(e),t)}(e,function(e,t){return e&&Pi(t,Is(t),e)}(s,e)):function(e,t){return Pi(e,fo(e),t)}(e,rr(s,e))}else{if(!st[d])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case R:return _i(e);case y:case b:return new r(+e);case j:return function(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case M:case L:case U:case D:case B:case F:case Z:case z:return Ei(e,n);case _:return new r;case E:case P:return new r(e);case O:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new r;case C:return function(e){return Un?Se(Un.call(e)):{}}(e)}}(e,d,u)}}a||(a=new Yn);var h=a.get(e);if(h)return h;a.set(e,s),os(e)?e.forEach((function(n){s.add(sr(n,t,r,n,e,a))})):ts(e)&&e.forEach((function(n,i){s.set(i,sr(n,t,r,i,e,a))}));var v=f?n:(l?c?ro:no:c?Is:Cs)(e);return Ot(v||e,(function(n,i){v&&(n=e[i=n]),er(s,i,sr(n,t,r,i,e,a))})),s}function ur(e,t,r){var i=r.length;if(null==e)return!i;for(e=Se(e);i--;){var o=r[i],a=t[o],s=e[o];if(s===n&&!(o in e)||!a(s))return!1}return!0}function cr(e,t,i){if("function"!=typeof e)throw new Pe(r);return Co((function(){e.apply(n,i)}),t)}function lr(e,t,n,r){var i=-1,o=It,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=jt(t,Qt(n))),r?(o=Rt,a=!1):t.length>=200&&(o=$t,a=!1,t=new Gn(t));e:for(;++i-1},Vn.prototype.set=function(e,t){var n=this.__data__,r=tr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(En||Vn),string:new qn}},Wn.prototype.delete=function(e){var t=uo(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return uo(this,e).get(e)},Wn.prototype.has=function(e){return uo(this,e).has(e)},Wn.prototype.set=function(e,t){var n=uo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Gn.prototype.add=Gn.prototype.push=function(e){return this.__data__.set(e,i),this},Gn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new Vn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Vn){var r=n.__data__;if(!En||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this};var fr=Ri(br),dr=Ri(wr,!0);function pr(e,t){var n=!0;return fr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function hr(e,t,r){for(var i=-1,o=e.length;++i0&&n(s)?t>1?mr(s,t-1,n,r,i):Nt(i,s):r||(i[i.length]=s)}return i}var gr=ji(),yr=ji(!0);function br(e,t){return e&&gr(e,t,Cs)}function wr(e,t){return e&&yr(e,t,Cs)}function xr(e,t){return Ct(t,(function(t){return Ja(e[t])}))}function kr(e,t){for(var r=0,i=(t=yi(t,e)).length;null!=e&&rt}function Sr(e,t){return null!=e&&Me.call(e,t)}function Or(e,t){return null!=e&&t in Se(e)}function Tr(e,t,r){for(var i=r?Rt:It,o=e[0].length,a=e.length,s=a,u=oe(a),c=1/0,l=[];s--;){var f=e[s];s&&t&&(f=jt(f,Qt(t))),c=yn(f.length,c),u[s]=!r&&(t||o>=120&&f.length>=120)?new Gn(s&&f):n}f=e[0];var d=-1,p=u[0];e:for(;++d=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function qr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Ke.call(s,u,1),Ke.call(e,u,1);return e}function Wr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;yo(i)?Ke.call(e,i,1):li(e,i)}}return e}function Gr(e,t){return e+vt(xn()*(t-e+1))}function Yr(e,t){var n="";if(!e||t<1||t>d)return n;do{t%2&&(n+=e),(t=vt(t/2))&&(e+=e)}while(t);return n}function Kr(e,t){return Io(So(e,t,nu),e+"")}function Jr(e){return Jn(Bs(e))}function Qr(e,t){var n=Bs(e);return No(n,ar(t,0,n.length))}function Xr(e,t,r,i){if(!$a(e))return e;for(var o=-1,a=(t=yi(t,e)).length,s=a-1,u=e;null!=u&&++oi?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=oe(i);++r>>1,a=e[o];null!==a&&!ss(a)&&(n?a<=t:a=200){var c=t?null:Yi(e);if(c)return ln(c);a=!1,i=$t,u=new Gn}else u=t?[]:s;e:for(;++r=i?e:ni(e,t,r)}var xi=ut||function(e){return pt.clearTimeout(e)};function ki(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function _i(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function Ei(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ai(e,t){if(e!==t){var r=e!==n,i=null===e,o=e===e,a=ss(e),s=t!==n,u=null===t,c=t===t,l=ss(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||i&&s&&c||!r&&c||!o)return 1;if(!i&&!a&&!l&&e1?r[o-1]:n,s=o>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(o--,a):n,s&&bo(r[0],r[1],s)&&(a=o<3?n:a,o=1),t=Se(t);++i-1?o[a?t[s]:s]:n}}function Di(e){return to((function(t){var i=t.length,o=i,a=zn.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Pe(r);if(a&&!u&&"wrapper"==oo(s))var u=new zn([],!0)}for(o=u?o:i;++o1&&b.reverse(),d&&lu))return!1;var l=a.get(e),f=a.get(t);if(l&&f)return l==t&&f==e;var d=-1,p=!0,h=2&r?new Gn:n;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ae,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ot(v,(function(n){var r="_."+n[0];t&n[1]&&!It(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ue):[]}(r),n)))}function jo(e){var t=0,r=0;return function(){var i=bn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function No(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ia(e,r)}));function fa(e){var t=Bn(e);return t.__chain__=!0,t}function da(e,t){return t(e)}var pa=to((function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hn&&yo(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:da,args:[o],thisArg:n}),new zn(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(o)}));var ha=Ci((function(e,t,n){Me.call(e,n)?++e[n]:ir(e,n,1)}));var va=Ui(zo),ma=Ui(Ho);function ga(e,t){return(Ha(e)?Ot:fr)(e,so(t,3))}function ya(e,t){return(Ha(e)?Tt:dr)(e,so(t,3))}var ba=Ci((function(e,t,n){Me.call(e,n)?e[n].push(t):ir(e,n,[t])}));var wa=Kr((function(e,t,n){var r=-1,i="function"==typeof t,o=Va(e)?oe(e.length):[];return fr(e,(function(e){o[++r]=i?At(t,e,n):Pr(e,t,n)})),o})),xa=Ci((function(e,t,n){ir(e,n,t)}));function ka(e,t){return(Ha(e)?jt:Dr)(e,so(t,3))}var _a=Ci((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ea=Kr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&bo(e,t[0],t[1])?t=[]:n>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Hr(e,mr(t,1),[])})),Aa=ft||function(){return pt.Date.now()};function Sa(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ji(e,c,n,n,n,n,t)}function Oa(e,t){var i;if("function"!=typeof t)throw new Pe(r);return e=ps(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Ta=Kr((function(e,t,n){var r=1;if(n.length){var i=cn(n,ao(Ta));r|=s}return Ji(e,r,t,n,i)})),Pa=Kr((function(e,t,n){var r=3;if(n.length){var i=cn(n,ao(Pa));r|=s}return Ji(t,r,e,n,i)}));function Ca(e,t,i){var o,a,s,u,c,l,f=0,d=!1,p=!1,h=!0;if("function"!=typeof e)throw new Pe(r);function v(t){var r=o,i=a;return o=a=n,f=t,u=e.apply(i,r)}function m(e){var r=e-l;return l===n||r>=t||r<0||p&&e-f>=s}function g(){var e=Aa();if(m(e))return y(e);c=Co(g,function(e){var n=t-(e-l);return p?yn(n,s-(e-f)):n}(e))}function y(e){return c=n,h&&o?v(e):(o=a=n,u)}function b(){var e=Aa(),r=m(e);if(o=arguments,a=this,l=e,r){if(c===n)return function(e){return f=e,c=Co(g,t),d?v(e):u}(l);if(p)return xi(c),c=Co(g,t),v(l)}return c===n&&(c=Co(g,t)),u}return t=vs(t)||0,$a(i)&&(d=!!i.leading,s=(p="maxWait"in i)?gn(vs(i.maxWait)||0,t):s,h="trailing"in i?!!i.trailing:h),b.cancel=function(){c!==n&&xi(c),f=0,o=l=a=c=n},b.flush=function(){return c===n?u:y(Aa())},b}var Ia=Kr((function(e,t){return cr(e,1,t)})),Ra=Kr((function(e,t,n){return cr(e,vs(t)||0,n)}));function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Pe(r);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ja.Cache||Wn),n}function Na(e){if("function"!=typeof e)throw new Pe(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ja.Cache=Wn;var Ma=bi((function(e,t){var n=(t=1==t.length&&Ha(t[0])?jt(t[0],Qt(so())):jt(mr(t,1),Qt(so()))).length;return Kr((function(r){for(var i=-1,o=yn(r.length,n);++i=t})),za=Cr(function(){return arguments}())?Cr:function(e){return es(e)&&Me.call(e,"callee")&&!Ye.call(e,"callee")},Ha=oe.isArray,qa=bt?Qt(bt):function(e){return es(e)&&Er(e)==R};function Va(e){return null!=e&&Xa(e.length)&&!Ja(e)}function Wa(e){return es(e)&&Va(e)}var Ga=yt||vu,Ya=wt?Qt(wt):function(e){return es(e)&&Er(e)==b};function Ka(e){if(!es(e))return!1;var t=Er(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!rs(e)}function Ja(e){if(!$a(e))return!1;var t=Er(e);return t==x||t==k||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qa(e){return"number"==typeof e&&e==ps(e)}function Xa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function $a(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=xt?Qt(xt):function(e){return es(e)&&ho(e)==_};function ns(e){return"number"==typeof e||es(e)&&Er(e)==E}function rs(e){if(!es(e)||Er(e)!=A)return!1;var t=We(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Be}var is=kt?Qt(kt):function(e){return es(e)&&Er(e)==O};var os=_t?Qt(_t):function(e){return es(e)&&ho(e)==T};function as(e){return"string"==typeof e||!Ha(e)&&es(e)&&Er(e)==P}function ss(e){return"symbol"==typeof e||es(e)&&Er(e)==C}var us=Et?Qt(Et):function(e){return es(e)&&Xa(e.length)&&!!at[Er(e)]};var cs=Vi(Ur),ls=Vi((function(e,t){return e<=t}));function fs(e){if(!e)return[];if(Va(e))return as(e)?dn(e):Ti(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=ho(e);return(t==_?sn:t==T?ln:Bs)(e)}function ds(e){return e?(e=vs(e))===f||e===-f?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function ps(e){var t=ds(e),n=t%1;return t===t?n?t-n:t:0}function hs(e){return e?ar(ps(e),0,h):0}function vs(e){if("number"==typeof e)return e;if(ss(e))return p;if($a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=ve.test(e);return n||ge.test(e)?lt(e.slice(2),n?2:8):he.test(e)?p:+e}function ms(e){return Pi(e,Is(e))}function gs(e){return null==e?"":ui(e)}var ys=Ii((function(e,t){if(_o(t)||Va(t))Pi(t,Cs(t),e);else for(var n in t)Me.call(t,n)&&er(e,n,t[n])})),bs=Ii((function(e,t){Pi(t,Is(t),e)})),ws=Ii((function(e,t,n,r){Pi(t,Is(t),e,r)})),xs=Ii((function(e,t,n,r){Pi(t,Cs(t),e,r)})),ks=to(or);var _s=Kr((function(e,t){e=Se(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&bo(t[0],t[1],o)&&(i=1);++r1),t})),Pi(e,ro(e),n),r&&(n=sr(n,7,$i));for(var i=t.length;i--;)li(n,t[i]);return n}));var Ms=to((function(e,t){return null==e?{}:function(e,t){return qr(e,t,(function(t,n){return Ss(e,n)}))}(e,t)}));function Ls(e,t){if(null==e)return{};var n=jt(ro(e),(function(e){return[e]}));return t=so(t),qr(e,n,(function(e,n){return t(e,n[0])}))}var Us=Ki(Cs),Ds=Ki(Is);function Bs(e){return null==e?[]:Xt(e,Cs(e))}var Fs=Mi((function(e,t,n){return t=t.toLowerCase(),e+(n?Zs(t):t)}));function Zs(e){return Ks(gs(e).toLowerCase())}function zs(e){return(e=gs(e))&&e.replace(be,nn).replace($e,"")}var Hs=Mi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),qs=Mi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Vs=Ni("toLowerCase");var Ws=Mi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Gs=Mi((function(e,t,n){return e+(n?" ":"")+Ks(t)}));var Ys=Mi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ks=Ni("toUpperCase");function Js(e,t,r){return e=gs(e),(t=r?n:t)===n?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Qs=Kr((function(e,t){try{return At(e,n,t)}catch(r){return Ka(r)?r:new _e(r)}})),Xs=to((function(e,t){return Ot(t,(function(t){t=Lo(t),ir(e,t,Ta(e[t],e))})),e}));function $s(e){return function(){return e}}var eu=Di(),tu=Di(!0);function nu(e){return e}function ru(e){return Nr("function"==typeof e?e:sr(e,1))}var iu=Kr((function(e,t){return function(n){return Pr(n,e,t)}})),ou=Kr((function(e,t){return function(n){return Pr(e,n,t)}}));function au(e,t,n){var r=Cs(t),i=xr(t,r);null==n&&(!$a(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=xr(t,Cs(t)));var o=!($a(n)&&"chain"in n)||!!n.chain,a=Ja(e);return Ot(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ti(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Nt([this.value()],arguments))})})),e}function su(){}var uu=zi(jt),cu=zi(Pt),lu=zi(Ut);function fu(e){return wo(e)?Vt(Lo(e)):function(e){return function(t){return kr(t,e)}}(e)}var du=qi(),pu=qi(!0);function hu(){return[]}function vu(){return!1}var mu=Zi((function(e,t){return e+t}),0),gu=Gi("ceil"),yu=Zi((function(e,t){return e/t}),1),bu=Gi("floor");var wu=Zi((function(e,t){return e*t}),1),xu=Gi("round"),ku=Zi((function(e,t){return e-t}),0);return Bn.after=function(e,t){if("function"!=typeof t)throw new Pe(r);return e=ps(e),function(){if(--e<1)return t.apply(this,arguments)}},Bn.ary=Sa,Bn.assign=ys,Bn.assignIn=bs,Bn.assignInWith=ws,Bn.assignWith=xs,Bn.at=ks,Bn.before=Oa,Bn.bind=Ta,Bn.bindAll=Xs,Bn.bindKey=Pa,Bn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},Bn.chain=fa,Bn.chunk=function(e,t,r){t=(r?bo(e,t,r):t===n)?1:gn(ps(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=oe(ht(i/t));oo?0:o+r),(i=i===n||i>o?o:ps(i))<0&&(i+=o),i=r>i?0:hs(i);r>>0)?(e=gs(e))&&("string"==typeof t||null!=t&&!is(t))&&(!(t=ui(t))&&an(e))?wi(dn(e),0,r):e.split(t,r):[]},Bn.spread=function(e,t){if("function"!=typeof e)throw new Pe(r);return t=null==t?0:gn(ps(t),0),Kr((function(n){var r=n[t],i=wi(n,0,t);return r&&Nt(i,r),At(e,this,i)}))},Bn.tail=function(e){var t=null==e?0:e.length;return t?ni(e,1,t):[]},Bn.take=function(e,t,r){return e&&e.length?ni(e,0,(t=r||t===n?1:ps(t))<0?0:t):[]},Bn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?ni(e,(t=i-(t=r||t===n?1:ps(t)))<0?0:t,i):[]},Bn.takeRightWhile=function(e,t){return e&&e.length?di(e,so(t,3),!1,!0):[]},Bn.takeWhile=function(e,t){return e&&e.length?di(e,so(t,3)):[]},Bn.tap=function(e,t){return t(e),e},Bn.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new Pe(r);return $a(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Ca(e,t,{leading:i,maxWait:t,trailing:o})},Bn.thru=da,Bn.toArray=fs,Bn.toPairs=Us,Bn.toPairsIn=Ds,Bn.toPath=function(e){return Ha(e)?jt(e,Lo):ss(e)?[e]:Ti(Mo(gs(e)))},Bn.toPlainObject=ms,Bn.transform=function(e,t,n){var r=Ha(e),i=r||Ga(e)||us(e);if(t=so(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:$a(e)&&Ja(o)?Fn(We(e)):{}}return(i?Ot:br)(e,(function(e,r,i){return t(n,e,r,i)})),n},Bn.unary=function(e){return Sa(e,1)},Bn.union=ea,Bn.unionBy=ta,Bn.unionWith=na,Bn.uniq=function(e){return e&&e.length?ci(e):[]},Bn.uniqBy=function(e,t){return e&&e.length?ci(e,so(t,2)):[]},Bn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ci(e,n,t):[]},Bn.unset=function(e,t){return null==e||li(e,t)},Bn.unzip=ra,Bn.unzipWith=ia,Bn.update=function(e,t,n){return null==e?e:fi(e,t,gi(n))},Bn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:fi(e,t,gi(r),i)},Bn.values=Bs,Bn.valuesIn=function(e){return null==e?[]:Xt(e,Is(e))},Bn.without=oa,Bn.words=Js,Bn.wrap=function(e,t){return La(gi(t),e)},Bn.xor=aa,Bn.xorBy=sa,Bn.xorWith=ua,Bn.zip=ca,Bn.zipObject=function(e,t){return vi(e||[],t||[],er)},Bn.zipObjectDeep=function(e,t){return vi(e||[],t||[],Xr)},Bn.zipWith=la,Bn.entries=Us,Bn.entriesIn=Ds,Bn.extend=bs,Bn.extendWith=ws,au(Bn,Bn),Bn.add=mu,Bn.attempt=Qs,Bn.camelCase=Fs,Bn.capitalize=Zs,Bn.ceil=gu,Bn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=vs(r))===r?r:0),t!==n&&(t=(t=vs(t))===t?t:0),ar(vs(e),t,r)},Bn.clone=function(e){return sr(e,4)},Bn.cloneDeep=function(e){return sr(e,5)},Bn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:n)},Bn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:n)},Bn.conformsTo=function(e,t){return null==t||ur(e,t,Cs(t))},Bn.deburr=zs,Bn.defaultTo=function(e,t){return null==e||e!==e?t:e},Bn.divide=yu,Bn.endsWith=function(e,t,r){e=gs(e),t=ui(t);var i=e.length,o=r=r===n?i:ar(ps(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},Bn.eq=Ba,Bn.escape=function(e){return(e=gs(e))&&K.test(e)?e.replace(G,rn):e},Bn.escapeRegExp=function(e){return(e=gs(e))&&re.test(e)?e.replace(ne,"\\$&"):e},Bn.every=function(e,t,r){var i=Ha(e)?Pt:pr;return r&&bo(e,t,r)&&(t=n),i(e,so(t,3))},Bn.find=va,Bn.findIndex=zo,Bn.findKey=function(e,t){return Bt(e,so(t,3),br)},Bn.findLast=ma,Bn.findLastIndex=Ho,Bn.findLastKey=function(e,t){return Bt(e,so(t,3),wr)},Bn.floor=bu,Bn.forEach=ga,Bn.forEachRight=ya,Bn.forIn=function(e,t){return null==e?e:gr(e,so(t,3),Is)},Bn.forInRight=function(e,t){return null==e?e:yr(e,so(t,3),Is)},Bn.forOwn=function(e,t){return e&&br(e,so(t,3))},Bn.forOwnRight=function(e,t){return e&&wr(e,so(t,3))},Bn.get=As,Bn.gt=Fa,Bn.gte=Za,Bn.has=function(e,t){return null!=e&&vo(e,t,Sr)},Bn.hasIn=Ss,Bn.head=Vo,Bn.identity=nu,Bn.includes=function(e,t,n,r){e=Va(e)?e:Bs(e),n=n&&!r?ps(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),as(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Zt(e,t,n)>-1},Bn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ps(n);return i<0&&(i=gn(r+i,0)),Zt(e,t,i)},Bn.inRange=function(e,t,r){return t=ds(t),r===n?(r=t,t=0):r=ds(r),function(e,t,n){return e>=yn(t,n)&&e=-d&&e<=d},Bn.isSet=os,Bn.isString=as,Bn.isSymbol=ss,Bn.isTypedArray=us,Bn.isUndefined=function(e){return e===n},Bn.isWeakMap=function(e){return es(e)&&ho(e)==I},Bn.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Er(e)},Bn.join=function(e,t){return null==e?"":Wt.call(e,t)},Bn.kebabCase=Hs,Bn.last=Ko,Bn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=ps(r))<0?gn(i+o,0):yn(o,i-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Ft(e,Ht,o,!0)},Bn.lowerCase=qs,Bn.lowerFirst=Vs,Bn.lt=cs,Bn.lte=ls,Bn.max=function(e){return e&&e.length?hr(e,nu,Ar):n},Bn.maxBy=function(e,t){return e&&e.length?hr(e,so(t,2),Ar):n},Bn.mean=function(e){return qt(e,nu)},Bn.meanBy=function(e,t){return qt(e,so(t,2))},Bn.min=function(e){return e&&e.length?hr(e,nu,Ur):n},Bn.minBy=function(e,t){return e&&e.length?hr(e,so(t,2),Ur):n},Bn.stubArray=hu,Bn.stubFalse=vu,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=wu,Bn.nth=function(e,t){return e&&e.length?zr(e,ps(t)):n},Bn.noConflict=function(){return pt._===this&&(pt._=Fe),this},Bn.noop=su,Bn.now=Aa,Bn.pad=function(e,t,n){e=gs(e);var r=(t=ps(t))?fn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Hi(vt(i),n)+e+Hi(ht(i),n)},Bn.padEnd=function(e,t,n){e=gs(e);var r=(t=ps(t))?fn(e):0;return t&&rt){var i=e;e=t,t=i}if(r||e%1||t%1){var o=xn();return yn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return Gr(e,t)},Bn.reduce=function(e,t,n){var r=Ha(e)?Mt:Gt,i=arguments.length<3;return r(e,so(t,4),n,i,fr)},Bn.reduceRight=function(e,t,n){var r=Ha(e)?Lt:Gt,i=arguments.length<3;return r(e,so(t,4),n,i,dr)},Bn.repeat=function(e,t,r){return t=(r?bo(e,t,r):t===n)?1:ps(t),Yr(gs(e),t)},Bn.replace=function(){var e=arguments,t=gs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Bn.result=function(e,t,r){var i=-1,o=(t=yi(t,e)).length;for(o||(o=1,e=n);++id)return[];var n=h,r=yn(e,h);t=so(t),e-=h;for(var i=Kt(r,t);++n=a)return e;var u=r-fn(i);if(u<1)return i;var c=s?wi(s,0,u).join(""):e.slice(0,u);if(o===n)return c+i;if(s&&(u+=c.length-u),is(o)){if(e.slice(u).search(o)){var l,f=c;for(o.global||(o=Oe(o.source,gs(pe.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var d=l.index;c=c.slice(0,d===n?u:d)}}else if(e.indexOf(ui(o),u)!=u){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+i},Bn.unescape=function(e){return(e=gs(e))&&Y.test(e)?e.replace(W,hn):e},Bn.uniqueId=function(e){var t=++Le;return gs(e)+t},Bn.upperCase=Ys,Bn.upperFirst=Ks,Bn.each=ga,Bn.eachRight=ya,Bn.first=Vo,au(Bn,function(){var e={};return br(Bn,(function(t,n){Me.call(Bn.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Bn.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Bn[e].placeholder=Bn})),Ot(["drop","take"],(function(e,t){Hn.prototype[e]=function(r){r=r===n?1:gn(ps(r),0);var i=this.__filtered__&&!t?new Hn(this):this.clone();return i.__filtered__?i.__takeCount__=yn(r,i.__takeCount__):i.__views__.push({size:yn(r,h),type:e+(i.__dir__<0?"Right":"")}),i},Hn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Hn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:so(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ot(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Hn.prototype[e]=function(){return this[n](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Hn.prototype[e]=function(){return this.__filtered__?new Hn(this):this[n](1)}})),Hn.prototype.compact=function(){return this.filter(nu)},Hn.prototype.find=function(e){return this.filter(e).head()},Hn.prototype.findLast=function(e){return this.reverse().find(e)},Hn.prototype.invokeMap=Kr((function(e,t){return"function"==typeof e?new Hn(this):this.map((function(n){return Pr(n,e,t)}))})),Hn.prototype.reject=function(e){return this.filter(Na(so(e)))},Hn.prototype.slice=function(e,t){e=ps(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Hn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ps(t))<0?r.dropRight(-t):r.take(t-e)),r)},Hn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hn.prototype.toArray=function(){return this.take(h)},br(Hn.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Bn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Bn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,u=t instanceof Hn,c=s[0],l=u||Ha(t),f=function(e){var t=o.apply(Bn,Nt([e],s));return i&&d?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var d=this.__chain__,p=!!this.__actions__.length,h=a&&!d,v=u&&!p;if(!a&&l){t=v?t:new Hn(this);var m=e.apply(t,s);return m.__actions__.push({func:da,args:[f],thisArg:n}),new zn(m,d)}return h&&v?e.apply(this,s):(m=this.thru(f),h?i?m.value()[0]:m.value():m)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ce[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Bn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ha(i)?i:[],e)}return this[n]((function(n){return t.apply(Ha(n)?n:[],e)}))}})),br(Hn.prototype,(function(e,t){var n=Bn[t];if(n){var r=n.name+"";Me.call(Cn,r)||(Cn[r]=[]),Cn[r].push({name:t,func:n})}})),Cn[Bi(n,2).name]=[{name:"wrapper",func:n}],Hn.prototype.clone=function(){var e=new Hn(this.__wrapped__);return e.__actions__=Ti(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ti(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ti(this.__views__),e},Hn.prototype.reverse=function(){if(this.__filtered__){var e=new Hn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ha(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Bn.prototype.plant=function(e){for(var t,r=this;r instanceof Zn;){var i=Do(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},Bn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hn){var t=e;return this.__actions__.length&&(t=new Hn(this)),(t=t.reverse()).__actions__.push({func:da,args:[$o],thisArg:n}),new zn(t,this.__chain__)}return this.thru($o)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,Qe&&(Bn.prototype[Qe]=function(){return this}),Bn}();vt?((vt.exports=vn)._=vn,ht._=vn):pt._=vn}).call(sa)}(ua,ua.exports);var ca=Object.defineProperty,la=Object.defineProperties,fa=Object.getOwnPropertyDescriptors,da=Object.getOwnPropertySymbols,pa=Object.prototype.hasOwnProperty,ha=Object.prototype.propertyIsEnumerable,va=function(e,t,n){return t in e?ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ma=function(e,t){for(var n in t||(t={}))pa.call(t,n)&&va(e,n,t[n]);if(da){var r,i=(0,l.Z)(da(t));try{for(i.s();!(r=i.n()).done;){n=r.value;ha.call(t,n)&&va(e,n,t[n])}}catch(o){i.e(o)}finally{i.f()}}return e},ga=function(e,t){return la(e,fa(t))};function ya(e,t,n){var r,i=ba(e);return t.rpcMap&&(r=t.rpcMap[i]),r||(r="".concat("https://rpc.walletconnect.com/v1","?chainId=eip155:").concat(i,"&projectId=").concat(n)),r}function ba(e){return e.includes("eip155")?Number(e.split(":")[1]):Number(e)}function wa(e){return e.map((function(e){return"".concat(e.split(":")[0],":").concat(e.split(":")[1])}))}function xa(e){var t,n,i,o,a={};if(!na(e))return a;for(var s=0,u=Object.entries(e);s"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||ya(e,this.namespace);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new ra.default(n,Aa("disableProviderPing")))}}]),e}(),Ta=function(){function e(t){(0,a.Z)(this,e),this.name="eip155",this.namespace=t.namespace,this.events=Aa("events"),this.client=Aa("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}return(0,s.Z)(e,[{key:"request",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.request.method,e.next="eth_requestAccounts"===e.t0?3:"eth_accounts"===e.t0?4:"wallet_switchEthereumChain"===e.t0?5:"eth_chainId"===e.t0?8:9;break;case 3:case 4:return e.abrupt("return",this.getAccounts());case 5:return e.next=7,this.handleSwitchChain(t);case 7:return e.abrupt("return",e.sent);case 8:return e.abrupt("return",parseInt(this.getDefaultChain()));case 9:if(!this.namespace.methods.includes(t.request.method)){e.next=15;break}return e.next=12,this.client.request(t);case 12:e.t1=e.sent,e.next=16;break;case 15:e.t1=this.getHttpProvider().request(t.request);case 16:return e.abrupt("return",e.t1);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"setDefaultChain",value:function(e,t){var n=ba(e);if(!this.httpProviders[n]){var r=t||ya("".concat(this.name,":").concat(n),this.namespace,this.client.core.projectId);if(!r)throw new Error("No RPC url provided for chainId: ".concat(n));this.setHttpProvider(n,r)}this.chainId=n,this.events.emit(aa,"".concat(this.name,":").concat(n))}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"createHttpProvider",value:function(e,t){var n=t||ya("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new ra.HttpConnection(n,Aa("disableProviderPing")))}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r,i=ba(n);t[i]=e.createHttpProvider(i,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"getHttpProvider",value:function(){var e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"handleSwitchChain",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(o=t.request.params?null==(n=t.request.params[0])?void 0:n.chainId:"0x0").startsWith("0x")?o:"0x".concat(o),a=parseInt(o,16),!this.isChainApproved(a)){e.next=7;break}this.setDefaultChain("".concat(a)),e.next=14;break;case 7:if(!this.namespace.methods.includes("wallet_switchEthereumChain")){e.next=13;break}return e.next=10,this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:o}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]});case 10:this.setDefaultChain("".concat(a)),e.next=14;break;case 13:throw new Error("Failed to switch to chain 'eip155:".concat(a,"'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method."));case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isChainApproved",value:function(e){return this.namespace.chains.includes("".concat(this.name,":").concat(e))}}]),e}(),Pa=function(){function e(t){(0,a.Z)(this,e),this.name="solana",this.namespace=t.namespace,this.events=Aa("events"),this.client=Aa("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(!this.httpProviders[e]){var n=t||ya("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(aa,"".concat(this.name,":").concat(this.chainId))}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r;t[n]=e.createHttpProvider(n,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||ya(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new ra.default(n,Aa("disableProviderPing")))}}]),e}(),Ca=function(){function e(t){(0,a.Z)(this,e),this.name="cosmos",this.namespace=t.namespace,this.events=Aa("events"),this.client=Aa("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(this.chainId=e,!this.httpProviders[e]){var n=t||ya("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.events.emit(aa,"".concat(this.name,":").concat(this.chainId))}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r;t[n]=e.createHttpProvider(n,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||ya(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new ra.default(n,Aa("disableProviderPing")))}}]),e}(),Ia=function(){function e(t){(0,a.Z)(this,e),this.name="cip34",this.namespace=t.namespace,this.events=Aa("events"),this.client=Aa("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(this.chainId=e,!this.httpProviders[e]){var n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.events.emit(aa,"".concat(this.name,":").concat(this.chainId))}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r=e.getCardanoRPCUrl(n);t[n]=e.createHttpProvider(n,r)})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"getCardanoRPCUrl",value:function(e){var t=this.namespace.rpcMap;if(t)return t[e]}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||this.getCardanoRPCUrl(e);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new ra.default(n,Aa("disableProviderPing")))}}]),e}(),Ra=function(){function e(t){(0,a.Z)(this,e),this.name="elrond",this.namespace=t.namespace,this.events=Aa("events"),this.client=Aa("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(!this.httpProviders[e]){var n=t||ya("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(aa,"".concat(this.name,":").concat(this.chainId))}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r;t[n]=e.createHttpProvider(n,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||ya(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new ra.default(n,Aa("disableProviderPing")))}}]),e}(),ja=function(){function e(t){(0,a.Z)(this,e),this.name="multiversx",this.namespace=t.namespace,this.events=Aa("events"),this.client=Aa("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}return(0,s.Z)(e,[{key:"updateNamespace",value:function(e){this.namespace=Object.assign(this.namespace,e)}},{key:"requestAccounts",value:function(){return this.getAccounts()}},{key:"request",value:function(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}},{key:"setDefaultChain",value:function(e,t){if(!this.httpProviders[e]){var n=t||ya("".concat(this.name,":").concat(e),this.namespace,this.client.core.projectId);if(!n)throw new Error("No RPC url provided for chainId: ".concat(e));this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(aa,"".concat(this.name,":").concat(this.chainId))}},{key:"getDefaultChain",value:function(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;var e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}},{key:"getAccounts",value:function(){var e=this,t=this.namespace.accounts;return t?(0,u.Z)(new Set(t.filter((function(t){return t.split(":")[1]===e.chainId.toString()})).map((function(e){return e.split(":")[2]})))):[]}},{key:"createHttpProviders",value:function(){var e=this,t={};return this.namespace.chains.forEach((function(n){var r;t[n]=e.createHttpProvider(n,null==(r=e.namespace.rpcMap)?void 0:r[n])})),t}},{key:"getHttpProvider",value:function(){var e="".concat(this.name,":").concat(this.chainId),t=this.httpProviders[e];if(typeof t>"u")throw new Error("JSON-RPC provider for ".concat(e," not found"));return t}},{key:"setHttpProvider",value:function(e,t){var n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}},{key:"createHttpProvider",value:function(e,t){var n=t||ya(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new pn.JsonRpcProvider(new ra.default(n,Aa("disableProviderPing")))}}]),e}(),Na=Object.defineProperty,Ma=Object.defineProperties,La=Object.getOwnPropertyDescriptors,Ua=Object.getOwnPropertySymbols,Da=Object.prototype.hasOwnProperty,Ba=Object.prototype.propertyIsEnumerable,Fa=function(e,t,n){return t in e?Na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Za=function(e,t){for(var n in t||(t={}))Da.call(t,n)&&Fa(e,n,t[n]);if(Ua){var r,i=(0,l.Z)(Ua(t));try{for(i.s();!(r=i.n()).done;){n=r.value;Ba.call(t,n)&&Fa(e,n,t[n])}}catch(o){i.e(o)}finally{i.f()}}return e},za=function(e,t){return Ma(e,La(t))},Ha=function(){function e(t){(0,a.Z)(this,e),this.events=new(d()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(null===t||void 0===t?void 0:t.logger)<"u"&&"string"!=typeof(null===t||void 0===t?void 0:t.logger)?t.logger:(0,N.pino)((0,N.getDefaultLoggerOptions)({level:(null===t||void 0===t?void 0:t.logger)||ia})),this.disableProviderPing=(null===t||void 0===t?void 0:t.disableProviderPing)||!1}return(0,s.Z)(e,[{key:"request",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t,n){var o,a,s,u;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.validateChain(n),a=(0,r.Z)(o,2),s=a[0],u=a[1],this.session){e.next=3;break}throw new Error("Please call connect() before request()");case 3:return e.next=5,this.getProvider(s).request({request:Za({},t),chainId:"".concat(s,":").concat(u),topic:this.session.topic});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"sendAsync",value:function(e,t,n){this.request(e,n).then((function(e){return t(null,e)})).catch((function(e){return t(e,void 0)}))}},{key:"enable",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.client){e.next=2;break}throw new Error("Sign Client not initialized");case 2:if(e.t0=this.session,e.t0){e.next=6;break}return e.next=6,this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});case 6:return e.next=8,this.requestAccounts();case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.session){e.next=2;break}throw new Error("Please call connect() before enable()");case 2:return e.next=4,this.client.disconnect({topic:null==(t=this.session)?void 0:t.topic,reason:ea("USER_DISCONNECTED")});case 4:return e.next=6,this.cleanup();case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"connect",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.client){e.next=2;break}throw new Error("Sign Client not initialized");case 2:return this.setNamespaces(t),e.next=5,this.cleanupPendingPairings();case 5:if(t.skipPairing){e.next=9;break}return e.next=8,this.pair(t.pairingTopic);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"once",value:function(e,t){this.events.once(e,t)}},{key:"removeListener",value:function(e,t){this.events.removeListener(e,t)}},{key:"off",value:function(e,t){this.events.off(e,t)}},{key:"isWalletConnect",get:function(){return!0}},{key:"pair",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,o,a,s=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.shouldAbortPairingAttempt=!1,n=0;case 2:if(!this.shouldAbortPairingAttempt){e.next=4;break}throw new Error("Pairing aborted");case 4:if(!(n>=this.maxPairingAttempts)){e.next=6;break}throw new Error("Max auto pairing attempts reached");case 6:return e.next=8,this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});case 8:return r=e.sent,o=r.uri,a=r.approval,o&&(this.uri=o,this.events.emit("display_uri",o)),e.next=14,a().then((function(e){s.session=e,s.namespaces||(s.namespaces=_a(e.namespaces),s.persist("namespaces",s.namespaces))})).catch((function(e){if(e.message!==Po)throw e;n++}));case 14:if(!this.session){e.next=2;break}case 15:return e.abrupt("return",(this.onConnect(),this.session));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setDefaultChain",value:function(e,t){try{if(!this.session)return;var n=this.validateChain(e),i=(0,r.Z)(n,2),o=i[0],a=i[1];this.getProvider(o).setDefaultChain(a,t)}catch(o){if(!/Please call connect/.test(o.message))throw o}}},{key:"cleanupPendingPairings",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,n,r,o,a,s=arguments;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:{},this.logger.info("Cleaning up inactive pairings..."),!ta(n=this.client.pairing.getAll())){e.next=26;break}r=(0,l.Z)(n),e.prev=5,r.s();case 7:if((o=r.n()).done){e.next=17;break}if(a=o.value,!t.deletePairings){e.next=13;break}this.client.core.expirer.set(a.topic,0),e.next=15;break;case 13:return e.next=15,this.client.core.relayer.subscriber.unsubscribe(a.topic);case 15:e.next=7;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(5),r.e(e.t0);case 22:return e.prev=22,r.f(),e.finish(22);case 25:this.logger.info("Inactive pairings cleared: ".concat(n.length));case 26:case"end":return e.stop()}}),e,this,[[5,19,22,25]])})));return function(){return e.apply(this,arguments)}}()},{key:"abortPairingAttempt",value:function(){this.shouldAbortPairingAttempt=!0}},{key:"checkStorage",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFromStore("namespaces");case 2:return this.namespaces=e.sent,e.next=5,this.getFromStore("optionalNamespaces");case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0={};case 8:if(this.optionalNamespaces=e.t0,!this.client.session.length){e.next=12;break}t=this.client.session.keys.length-1,this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders();case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"initialize",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.trace("Initialized"),e.next=3,this.createClient();case 3:return e.next=5,this.checkStorage();case 5:this.registerEventListeners();case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"createClient",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.providerOpts.client,e.t0){e.next=5;break}return e.next=4,Ko.init({logger:this.providerOpts.logger||ia,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.com",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name});case 4:e.t0=e.sent;case 5:this.client=e.t0,this.logger.trace("SignClient Initialized");case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"createProviders",value:function(){var e=this;if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");var t=(0,u.Z)(new Set(Object.keys(this.session.namespaces).map((function(e){return Xo(e)}))));Sa("client",this.client),Sa("events",this.events),Sa("disableProviderPing",this.disableProviderPing),t.forEach((function(t){if(e.session){var n=function(e,t){var n=Object.keys(t.namespaces).filter((function(t){return t.includes(e)}));if(!n.length)return[];var r=[];return n.forEach((function(e){var n=t.namespaces[e].accounts;r.push.apply(r,(0,u.Z)(n))})),r}(t,e.session),r=wa(n),i=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=xa(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),n=xa(e);return ua.exports.merge(t,n)}(e.namespaces,e.optionalNamespaces),o=za(Za({},i[t]),{accounts:n,chains:r});switch(t){case"eip155":e.rpcProviders[t]=new Ta({namespace:o});break;case"solana":e.rpcProviders[t]=new Pa({namespace:o});break;case"cosmos":e.rpcProviders[t]=new Ca({namespace:o});break;case"polkadot":e.rpcProviders[t]=new Oa({namespace:o});break;case"cip34":e.rpcProviders[t]=new Ia({namespace:o});break;case"elrond":e.rpcProviders[t]=new Ra({namespace:o});break;case"multiversx":e.rpcProviders[t]=new ja({namespace:o})}}}))}},{key:"registerEventListeners",value:function(){var e=this;if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",(function(t){e.events.emit("session_ping",t)})),this.client.on("session_event",(function(t){var n=t.params,r=n.event;if("accountsChanged"===r.name){var i=r.data;i&&ta(i)&&e.events.emit("accountsChanged",i.map(ka))}else"chainChanged"===r.name?e.onChainChanged(n.chainId):e.events.emit(r.name,r.data);e.events.emit("session_event",t)})),this.client.on("session_update",(function(t){var n,r=t.topic,i=t.params,o=i.namespaces,a=null==(n=e.client)?void 0:n.session.get(r);e.session=za(Za({},a),{namespaces:o}),e.onSessionUpdate(),e.events.emit("session_update",{topic:r,params:i})})),this.client.on("session_delete",function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.cleanup();case 2:e.events.emit("session_delete",n),e.events.emit("disconnect",za(Za({},ea("USER_DISCONNECTED")),{data:n.topic}));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.on(aa,(function(t){e.onChainChanged(t,!0)}))}},{key:"getProvider",value:function(e){if(!this.rpcProviders[e])throw new Error("Provider not found: ".concat(e));return this.rpcProviders[e]}},{key:"onSessionUpdate",value:function(){var e=this;Object.keys(this.rpcProviders).forEach((function(t){var n;e.getProvider(t).updateNamespace(null==(n=e.session)?void 0:n.namespaces[t])}))}},{key:"setNamespaces",value:function(e){var t=e.namespaces,n=e.optionalNamespaces,r=e.sessionProperties;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=r,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}},{key:"validateChain",value:function(e){var t=(null===e||void 0===e?void 0:e.split(":"))||["",""],n=(0,r.Z)(t,2),i=n[0],o=n[1];if(!this.namespaces||!Object.keys(this.namespaces).length)return[i,o];if(i&&!Object.keys(this.namespaces||{}).map((function(e){return Xo(e)})).includes(i))throw new Error("Namespace '".concat(i,"' is not configured. Please call connect() first with namespace config."));if(i&&o)return[i,o];var a=Xo(Object.keys(this.namespaces)[0]);return[a,this.rpcProviders[a].getDefaultChain()]}},{key:"requestAccounts",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,n,o;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.validateChain(),n=(0,r.Z)(t,1),o=n[0],e.next=3,this.getProvider(o).requestAccounts();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onChainChanged",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.namespaces){var i=this.validateChain(e),o=(0,r.Z)(i,2),a=o[0],s=o[1];n||this.getProvider(a).setDefaultChain(s),(null!=(t=this.namespaces[a])?t:this.namespaces["".concat(a,":").concat(s)]).defaultChain=s,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s)}}},{key:"onConnect",value:function(){this.createProviders(),this.events.emit("connect",{session:this.session})}},{key:"cleanup",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),e.next=9,this.cleanupPendingPairings({deletePairings:!0});case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"persist",value:function(e,t){this.client.core.storage.setItem("".concat(oa,"/").concat(e),t)}},{key:"getFromStore",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.core.storage.getItem("".concat(oa,"/").concat(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}],[{key:"init",value:function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){var r;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new e(n),t.next=3,r.initialize();case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}]),e}(),qa=Ha,Va="".concat("wc","@2:").concat("ethereum_provider",":"),Wa=["eth_sendTransaction","personal_sign"],Ga=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Ya=["chainChanged","accountsChanged"],Ka=["message","disconnect","connect"],Ja=Object.defineProperty,Qa=Object.defineProperties,Xa=Object.getOwnPropertyDescriptors,$a=Object.getOwnPropertySymbols,es=Object.prototype.hasOwnProperty,ts=Object.prototype.propertyIsEnumerable,ns=function(e,t,n){return t in e?Ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},rs=function(e,t){for(var n in t||(t={}))es.call(t,n)&&ns(e,n,t[n]);if($a){var r,i=(0,l.Z)($a(t));try{for(i.s();!(r=i.n()).done;){n=r.value;ts.call(t,n)&&ns(e,n,t[n])}}catch(o){i.e(o)}finally{i.f()}}return e},is=function(e,t){return Qa(e,Xa(t))};function os(e){return Number(e[0].split(":")[1])}function as(e){return"0x".concat(e.toString(16))}function ss(e){var t=e.chains,n=e.optionalChains,r=e.methods,i=e.optionalMethods,o=e.events,a=e.optionalEvents,s=e.rpcMap;if(!O(t))throw new Error("Invalid chains");var l={chains:t,methods:r||Wa,events:o||Ya,rpcMap:rs({},t.length?(0,c.Z)({},os(t),s[os(t)]):{})},f=null===o||void 0===o?void 0:o.filter((function(e){return!Ya.includes(e)})),d=null===r||void 0===r?void 0:r.filter((function(e){return!Wa.includes(e)}));if(!n&&!a&&!i&&(null==f||!f.length)&&(null==d||!d.length))return{required:t.length?l:void 0};var p=(null===f||void 0===f?void 0:f.length)&&(null===d||void 0===d?void 0:d.length)||!n,h={chains:(0,u.Z)(new Set(p?l.chains.concat(n||[]):n)),methods:(0,u.Z)(new Set(l.methods.concat(null!=i&&i.length?i:Ga))),events:(0,u.Z)(new Set(l.events.concat(a||Ka))),rpcMap:s};return{required:t.length?l:void 0,optional:n.length?h:void 0}}var us=function(){function e(){var t=this;(0,a.Z)(this,e),this.events=new f.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Va,this.on=function(e,n){return t.events.on(e,n),t},this.once=function(e,n){return t.events.once(e,n),t},this.removeListener=function(e,n){return t.events.removeListener(e,n),t},this.off=function(e,n){return t.events.off(e,n),t},this.parseAccount=function(e){return t.isCompatibleChainId(e)?t.parseAccountId(e).address:e},this.signer={},this.rpc={}}return(0,s.Z)(e,[{key:"request",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.signer.request(t,this.formatChainId(this.chainId));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendAsync",value:function(e,t){this.signer.sendAsync(e,t,this.formatChainId(this.chainId))}},{key:"connected",get:function(){return!!this.signer.client&&this.signer.client.core.relayer.connected}},{key:"connecting",get:function(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}},{key:"enable",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.session,e.t0){e.next=4;break}return e.next=4,this.connect();case 4:return e.next=6,this.request({method:"eth_requestAccounts"});case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"connect",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var n,r,a,s,u,l=this;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.signer.client){e.next=2;break}throw new Error("Provider not initialized. Call init() first");case 2:return this.loadConnectOpts(t),n=ss(this.rpc),r=n.required,a=n.optional,e.prev=4,e.next=7,new Promise(function(){var e=(0,o.Z)((0,i.Z)().mark((function e(n,o){var s;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l.rpc.showQrModal&&(null==(s=l.modal)||s.subscribeModal((function(e){!e.open&&!l.signer.session&&(l.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))}))),e.next=3,l.signer.connect(is(rs({namespaces:rs({},r&&(0,c.Z)({},l.namespace,r))},a&&{optionalNamespaces:(0,c.Z)({},l.namespace,a)}),{pairingTopic:null===t||void 0===t?void 0:t.pairingTopic})).then((function(e){n(e)})).catch((function(e){o(new Error(e.message))}));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}());case 7:if(s=e.sent){e.next=10;break}return e.abrupt("return");case 10:this.setChainIds(this.rpc.chains),u=E(s.namespaces,[this.namespace]),this.setAccounts(u),this.events.emit("connect",{chainId:as(this.chainId)}),e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(4),this.signer.logger.error(e.t0),e.t0;case 18:return e.prev=18,this.modal&&this.modal.closeModal(),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[4,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.session,!e.t0){e.next=4;break}return e.next=4,this.signer.disconnect();case 4:this.reset();case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"isWalletConnect",get:function(){return!0}},{key:"session",get:function(){return this.signer.session}},{key:"registerEventListeners",value:function(){var e=this;this.signer.on("session_event",(function(t){var n=t.params.event;"accountsChanged"===n.name?(e.accounts=e.parseAccounts(n.data),e.events.emit("accountsChanged",e.accounts)):"chainChanged"===n.name?e.setChainId(e.formatChainId(n.data)):e.events.emit(n.name,n.data),e.events.emit("session_event",t)})),this.signer.on("chainChanged",(function(t){var n=parseInt(t);e.chainId=n,e.events.emit("chainChanged",as(e.chainId)),e.persist()})),this.signer.on("session_update",(function(t){e.events.emit("session_update",t)})),this.signer.on("session_delete",(function(t){e.reset(),e.events.emit("session_delete",t),e.events.emit("disconnect",is(rs({},S("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))})),this.signer.on("display_uri",(function(t){var n,r;e.rpc.showQrModal&&(null==(n=e.modal)||n.closeModal(),null==(r=e.modal)||r.openModal({uri:t})),e.events.emit("display_uri",t)}))}},{key:"switchEthereumChain",value:function(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}},{key:"isCompatibleChainId",value:function(e){return"string"==typeof e&&e.startsWith("".concat(this.namespace,":"))}},{key:"formatChainId",value:function(e){return"".concat(this.namespace,":").concat(e)}},{key:"parseChainId",value:function(e){return Number(e.split(":")[1])}},{key:"setChainIds",value:function(e){var t=this,n=e.filter((function(e){return t.isCompatibleChainId(e)})).map((function(e){return t.parseChainId(e)}));n.length&&(this.chainId=n[0],this.events.emit("chainChanged",as(this.chainId)),this.persist())}},{key:"setChainId",value:function(e){if(this.isCompatibleChainId(e)){var t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}},{key:"parseAccountId",value:function(e){var t=e.split(":"),n=(0,r.Z)(t,3),i=n[0],o=n[1],a=n[2];return{chainId:"".concat(i,":").concat(o),address:a}}},{key:"setAccounts",value:function(e){var t=this;this.accounts=e.filter((function(e){return t.parseChainId(t.parseAccountId(e).chainId)===t.chainId})).map((function(e){return t.parseAccountId(e).address})),this.events.emit("accountsChanged",this.accounts)}},{key:"getRpcConfig",value:function(e){var t,n,r=this,i=null!=(t=null===e||void 0===e?void 0:e.chains)?t:[],o=null!=(n=null===e||void 0===e?void 0:e.optionalChains)?n:[],a=i.concat(o);if(!a.length)throw new Error("No chains specified in either `chains` or `optionalChains`");var s=i.length?(null===e||void 0===e?void 0:e.methods)||Wa:[],u=i.length?(null===e||void 0===e?void 0:e.events)||Ya:[],c=(null===e||void 0===e?void 0:e.optionalMethods)||[],l=(null===e||void 0===e?void 0:e.optionalEvents)||[],f=(null===e||void 0===e?void 0:e.rpcMap)||this.buildRpcMap(a,e.projectId),d=(null===e||void 0===e?void 0:e.qrModalOptions)||void 0;return{chains:null===i||void 0===i?void 0:i.map((function(e){return r.formatChainId(e)})),optionalChains:o.map((function(e){return r.formatChainId(e)})),methods:s,events:u,optionalMethods:c,optionalEvents:l,rpcMap:f,showQrModal:!(null==e||!e.showQrModal),qrModalOptions:d,projectId:e.projectId,metadata:e.metadata}}},{key:"buildRpcMap",value:function(e,t){var n=this,r={};return e.forEach((function(e){r[e]=n.getRpcUrl(e,t)})),r}},{key:"initialize",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(t){var r,o,a;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?os(this.rpc.chains):os(this.rpc.optionalChains),e.next=4,qa.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions});case 4:return this.signer=e.sent,this.registerEventListeners(),e.next=8,this.loadPersistedSession();case 8:if(!this.rpc.showQrModal){e.next=28;break}return e.prev=9,e.next=12,n.e(199).then(n.bind(n,41199));case 12:o=e.sent,a=o.WalletConnectModal,r=a,e.next=20;break;case 17:throw e.prev=17,e.t0=e.catch(9),new Error("To use QR modal, please install @walletconnect/modal package");case 20:if(!r){e.next=28;break}e.prev=21,this.modal=new r(rs({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions)),e.next=28;break;case 25:throw e.prev=25,e.t1=e.catch(21),this.signer.logger.error(e.t1),new Error("Could not generate WalletConnectModal Instance");case 28:case"end":return e.stop()}}),e,this,[[9,17],[21,25]])})));return function(t){return e.apply(this,arguments)}}()},{key:"loadConnectOpts",value:function(e){var t=this;if(e){var n=e.chains,r=e.optionalChains,i=e.rpcMap;n&&O(n)&&(this.rpc.chains=n.map((function(e){return t.formatChainId(e)})),n.forEach((function(e){t.rpc.rpcMap[e]=(null===i||void 0===i?void 0:i[e])||t.getRpcUrl(e)}))),r&&O(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=null===r||void 0===r?void 0:r.map((function(e){return t.formatChainId(e)})),r.forEach((function(e){t.rpc.rpcMap[e]=(null===i||void 0===i?void 0:i[e])||t.getRpcUrl(e)})))}}},{key:"getRpcUrl",value:function(e,t){var n;return(null==(n=this.rpc.rpcMap)?void 0:n[e])||"".concat("https://rpc.walletconnect.com/v1/","?chainId=eip155:").concat(e,"&projectId=").concat(t||this.rpc.projectId)}},{key:"loadPersistedSession",value:function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var t,n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.session){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.signer.client.core.storage.getItem("".concat(this.STORAGE_KEY,"/chainId"));case 4:t=e.sent,n=this.session.namespaces["".concat(this.namespace,":").concat(t)]?this.session.namespaces["".concat(this.namespace,":").concat(t)]:this.session.namespaces[this.namespace],this.setChainIds(t?[this.formatChainId(t)]:null===n||void 0===n?void 0:n.accounts),this.setAccounts(null===n||void 0===n?void 0:n.accounts);case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"reset",value:function(){this.chainId=1,this.accounts=[]}},{key:"persist",value:function(){this.session&&this.signer.client.core.storage.setItem("".concat(this.STORAGE_KEY,"/chainId"),this.chainId)}},{key:"parseAccounts",value:function(e){var t=this;return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map((function(e){return t.parseAccount(e)}))}}],[{key:"init",value:function(){var t=(0,o.Z)((0,i.Z)().mark((function t(n){var r;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new e,t.next=3,r.initialize(n);case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}]),e}(),cs=us},36835:function(e,t,n){"use strict";var r=n(38783)},27964:function(e,t,n){"use strict";var r=n(38416).default,i=n(27424).default,o=n(74704).default,a=n(861).default,s=n(82376),u=n(8271),c=n(94266),l=n(2214),f=Symbol("encodeFragmentIdentifier");function d(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function p(e,t){return t.encode?t.strict?s(e):encodeURIComponent(e):e}function h(e,t){return t.decode?u(e):e}function v(e){return Array.isArray(e)?e.sort():"object"===typeof e?v(Object.keys(e)).sort((function(e,t){return Number(e)-Number(t)})).map((function(t){return e[t]})):e}function m(e){var t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function g(e){var t=(e=m(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function y(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function b(e,t){d((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);var n=function(e){var t;switch(e.arrayFormat){case"index":return function(e,n,r){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return function(e,n,r){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return function(e,n,r){t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return function(t,n,r){var i="string"===typeof n&&n.includes(e.arrayFormatSeparator),o="string"===typeof n&&!i&&h(n,e).includes(e.arrayFormatSeparator);n=o?h(n,e):n;var a=i||o?n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)})):null===n?n:h(n,e);r[t]=a};case"bracket-separator":return function(t,n,r){var i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),i){var o=null===n?[]:n.split(e.arrayFormatSeparator).map((function(t){return h(t,e)}));void 0!==r[t]?r[t]=[].concat(r[t],o):r[t]=o}else r[t]=n?h(n,e):n};default:return function(e,t,n){void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!==typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;var a,s=o(e.split("&"));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(""!==u){var l=c(t.decode?u.replace(/\+/g," "):u,"="),f=i(l,2),p=f[0],m=f[1];m=void 0===m?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?m:h(m,t),n(h(p,t),m,r)}}}catch(A){s.e(A)}finally{s.f()}for(var g=0,b=Object.keys(r);g0})).join("&")},t.parseUrl=function(e,t){t=Object.assign({decode:!0},t);var n=c(e,"#"),r=i(n,2),o=r[0],a=r[1];return Object.assign({url:o.split("?")[0]||"",query:b(g(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:h(a,t)}:{})},t.stringifyUrl=function(e,n){n=Object.assign(r({encode:!0,strict:!0},f,!0),n);var i=m(e.url).split("?")[0]||"",o=t.extract(e.url),a=t.parse(o,{sort:!1}),s=Object.assign(a,e.query),u=t.stringify(s,n);u&&(u="?".concat(u));var c=function(e){var t="",n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(c="#".concat(n[f]?p(e.fragmentIdentifier,n):e.fragmentIdentifier)),"".concat(i).concat(u).concat(c)},t.pick=function(e,n,i){i=Object.assign(r({parseFragmentIdentifier:!0},f,!1),i);var o=t.parseUrl(e,i),a=o.url,s=o.query,u=o.fragmentIdentifier;return t.stringifyUrl({url:a,query:l(s,n),fragmentIdentifier:u},i)},t.exclude=function(e,n,r){var i=Array.isArray(n)?function(e){return!n.includes(e)}:function(e,t){return!n(e,t)};return t.pick(e,i,r)}},60450:function(e,t,n){"use strict";var r=n(76374),i=n(28639),o=n(50235),a=n(24403),s=n(8461),u=n(68718),c=n(49145),l=n(70650),f=n(43863);e.exports=g,g.prototype.validate=function(e,t){var n;if("string"==typeof e){if(!(n=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var r=this._addSchema(e);n=r.validate||this._compile(r)}var i=n(t);!0!==n.$async&&(this.errors=n.errors);return i},g.prototype.compile=function(e,t){var n=this._addSchema(e,void 0,t);return n.validate||this._compile(n)},g.prototype.addSchema=function(e,t,n,r){if(Array.isArray(e)){for(var o=0;o%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,l=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,h=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function v(e){return e="full"==e?"full":"fast",r.copy(v[e])}function m(e){var t=e.match(i);if(!t)return!1;var n=+t[1],r=+t[2],a=+t[3];return r>=1&&r<=12&&a>=1&&a<=(2==r&&function(e){return e%4===0&&(e%100!==0||e%400===0)}(n)?29:o[r])}function g(e,t){var n=e.match(a);if(!n)return!1;var r=n[1],i=n[2],o=n[3],s=n[5];return(r<=23&&i<=59&&o<=59||23==r&&59==i&&60==o)&&(!t||s)}e.exports=v,v.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:l,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":h},v.full={date:m,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&m(t[0])&&g(t[1],!0)},uri:function(e){return b.test(e)&&u.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":c,url:l,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":h};var y=/t|\s/i;var b=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}},76374:function(e,t,n){"use strict";var r=n(28639),i=n(43863),o=n(31692),a=n(8461),s=n(23073),u=i.ucs2length,c=n(89806),l=o.Validation;function f(e,t,n){var r=p.call(this,e,t,n);return r>=0?{index:r,compiling:!0}:(r=this._compilations.length,this._compilations[r]={schema:e,root:t,baseId:n},{index:r,compiling:!1})}function d(e,t,n){var r=p.call(this,e,t,n);r>=0&&this._compilations.splice(r,1)}function p(e,t,n){for(var r=0;r=55296&&t<=56319&&i=t)throw new Error("Cannot access property/index "+r+" levels up, current level is "+t);return n[t-r]}if(r>t)throw new Error("Cannot access data "+r+" levels up, current level is "+t);if(o="data"+(t-r||""),!i)return o}for(var s=o,c=i.split("/"),l=0;l",y=p?">":"<",b=void 0;if(!d&&"number"!=typeof s&&void 0!==s)throw new Error(t+" must be number");if(!m&&void 0!==v&&"number"!=typeof v&&"boolean"!=typeof v)throw new Error(h+" must be number or boolean");if(m){var w=e.util.getData(v.$data,a,e.dataPathArr),x="exclusive"+o,k="exclType"+o,_="exclIsNumber"+o,E="' + "+(O="op"+o)+" + '";i+=" var schemaExcl"+o+" = "+w+"; ",i+=" var "+x+"; var "+k+" = typeof "+(w="schemaExcl"+o)+"; if ("+k+" != 'boolean' && "+k+" != 'undefined' && "+k+" != 'number') { ";var A;b=h;(A=A||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: '"+h+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var S=i;i=A.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+k+" == 'number' ? ( ("+x+" = "+r+" === undefined || "+w+" "+g+"= "+r+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+r+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+y+"= "+r+" : "+f+" "+y+" "+r+" ) || "+f+" !== "+f+") { var op"+o+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===s&&(b=h,c=e.errSchemaPath+"/"+h,r=w,d=m)}else{E=g;if((_="number"==typeof v)&&d){var O="'"+E+"'";i+=" if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" ( "+r+" === undefined || "+v+" "+g+"= "+r+" ? "+f+" "+y+"= "+v+" : "+f+" "+y+" "+r+" ) || "+f+" !== "+f+") { "}else{_&&void 0===s?(x=!0,b=h,c=e.errSchemaPath+"/"+h,r=v,y+="="):(_&&(r=Math[p?"min":"max"](v,s)),v===(!_||r)?(x=!0,b=h,c=e.errSchemaPath+"/"+h,y+="="):(x=!1,E+="="));O="'"+E+"'";i+=" if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+f+" "+y+" "+r+" || "+f+" !== "+f+") { "}}b=b||t,(A=A||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+O+", limit: "+r+", exclusive: "+x+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be "+E+" ",i+=d?"' + "+r:r+"'"),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";S=i;return i=A.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { "),i}},16982:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),d=e.opts.$data&&s&&s.$data;if(d?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",r="schema"+o):r=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");i+="if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" "+f+".length "+("maxItems"==t?">":"<")+" "+r+") { ";var p=t,h=h||[];h.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(p||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxItems"==t?"more":"fewer",i+=" than ",i+=d?"' + "+r+" + '":""+s,i+=" items' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;return i=h.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},9429:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),d=e.opts.$data&&s&&s.$data;if(d?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",r="schema"+o):r=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");var p="maxLength"==t?">":"<";i+="if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),!1===e.opts.unicode?i+=" "+f+".length ":i+=" ucs2length("+f+") ",i+=" "+p+" "+r+") { ";var h=t,v=v||[];v.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(h||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be ",i+="maxLength"==t?"longer":"shorter",i+=" than ",i+=d?"' + "+r+" + '":""+s,i+=" characters' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;return i=v.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},68447:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),d=e.opts.$data&&s&&s.$data;if(d?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",r="schema"+o):r=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");i+="if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'number') || "),i+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+r+") { ";var p=t,h=h||[];h.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(p||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have ",i+="maxProperties"==t?"more":"fewer",i+=" than ",i+=d?"' + "+r+" + '":""+s,i+=" properties' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var v=i;return i=h.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},51389:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.schema[t],o=e.schemaPath+e.util.getProperty(t),a=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,u=e.util.copy(e),c="";u.level++;var l="valid"+u.level,f=u.baseId,d=!0,p=i;if(p)for(var h,v=-1,m=p.length-1;v0||!1===h:e.util.schemaHasRules(h,e.RULES.all))&&(d=!1,u.schema=h,u.schemaPath=o+"["+v+"]",u.errSchemaPath=a+"/"+v,r+=" "+e.validate(u)+" ",u.baseId=f,s&&(r+=" if ("+l+") { ",c+="}"));return s&&(r+=d?" if (true) { ":" "+c.slice(0,-1)+" "),r}},32746:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d="errs__"+i,p=e.util.copy(e),h="";p.level++;var v="valid"+p.level,m=a.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)}));if(m){var g=p.baseId;r+=" var "+d+" = errors; var "+f+" = false; ";var y=e.compositeRule;e.compositeRule=p.compositeRule=!0;var b=a;if(b)for(var w,x=-1,k=b.length-1;x0||!1===a:e.util.schemaHasRules(a,e.RULES.all);if(r+="var "+d+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=a,p.schemaPath=s,p.errSchemaPath=u,r+=" var "+h+" = false; for (var "+v+" = 0; "+v+" < "+l+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var x=l+"["+v+"]";p.dataPathArr[m]=v;var k=e.validate(p);p.baseId=y,e.util.varOccurences(k,g)<2?r+=" "+e.util.varReplace(k,g,x)+" ":r+=" var "+g+" = "+x+"; "+k+" ",r+=" if ("+h+") break; } ",e.compositeRule=p.compositeRule=w,r+=" if (!"+h+") {"}else r+=" if ("+l+".length == 0) {";var _=_||[];_.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should contain a valid item' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var E=r;return r=_.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { ",b&&(r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(r+=" } "),r}},87688:function(e){"use strict";e.exports=function(e,t,n){var r,i,o=" ",a=e.level,s=e.dataLevel,u=e.schema[t],c=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,f=!e.opts.allErrors,d="data"+(s||""),p="valid"+a,h="errs__"+a,v=e.opts.$data&&u&&u.$data;v?(o+=" var schema"+a+" = "+e.util.getData(u.$data,s,e.dataPathArr)+"; ",i="schema"+a):i=u;var m,g,y,b,w,x=this,k="definition"+a,_=x.definition,E="";if(v&&_.$data){w="keywordValidate"+a;var A=_.validateSchema;o+=" var "+k+" = RULES.custom['"+t+"'].definition; var "+w+" = "+k+".validate;"}else{if(!(b=e.useCustomRule(x,u,e.schema,e)))return;i="validate.schema"+c,w=b.code,m=_.compile,g=_.inline,y=_.macro}var S=w+".errors",O="i"+a,T="ruleErr"+a,P=_.async;if(P&&!e.async)throw new Error("async keyword in sync schema");if(g||y||(o+=S+" = null;"),o+="var "+h+" = errors;var "+p+";",v&&_.$data&&(E+="}",o+=" if ("+i+" === undefined) { "+p+" = true; } else { ",A&&(E+="}",o+=" "+p+" = "+k+".validateSchema("+i+"); if ("+p+") { ")),g)_.statements?o+=" "+b.validate+" ":o+=" "+p+" = "+b.validate+"; ";else if(y){var C=e.util.copy(e);E="";C.level++;var I="valid"+C.level;C.schema=b.validate,C.schemaPath="";var R=e.compositeRule;e.compositeRule=C.compositeRule=!0;var j=e.validate(C).replace(/validate\.schema/g,w);e.compositeRule=C.compositeRule=R,o+=" "+j}else{(U=U||[]).push(o),o="",o+=" "+w+".call( ",e.opts.passContext?o+="this":o+="self",m||!1===_.schema?o+=" , "+d+" ":o+=" , "+i+" , "+d+" , validate.schema"+e.schemaPath+" ",o+=" , (dataPath || '')",'""'!=e.errorPath&&(o+=" + "+e.errorPath);var N=s?"data"+(s-1||""):"parentData",M=s?e.dataPathArr[s]:"parentDataProperty",L=o+=" , "+N+" , "+M+" , rootData ) ";o=U.pop(),!1===_.errors?(o+=" "+p+" = ",P&&(o+="await "),o+=L+"; "):o+=P?" var "+(S="customErrors"+a)+" = null; try { "+p+" = await "+L+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+S+" = e.errors; else throw e; } ":" "+S+" = null; "+p+" = "+L+"; "}if(_.modifying&&(o+=" if ("+N+") "+d+" = "+N+"["+M+"];"),o+=""+E,_.valid)f&&(o+=" if (true) { ");else{var U;o+=" if ( ",void 0===_.valid?(o+=" !",o+=y?""+I:""+p):o+=" "+!_.valid+" ",o+=") { ",r=x.keyword,(U=U||[]).push(o),o="",(U=U||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(r||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { keyword: '"+x.keyword+"' } ",!1!==e.opts.messages&&(o+=" , message: 'should pass \""+x.keyword+"\" keyword validation' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var D=o;o=U.pop(),!e.compositeRule&&f?e.async?o+=" throw new ValidationError(["+D+"]); ":o+=" validate.errors = ["+D+"]; return false; ":o+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var B=o;o=U.pop(),g?_.errors?"full"!=_.errors&&(o+=" for (var "+O+"="+h+"; "+O+"0||!1===y:e.util.schemaHasRules(y,e.RULES.all))&&(r+=" "+h+" = true; if ( "+l+e.util.getProperty(x)+" !== undefined ",g&&(r+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(x)+"') "),r+=") { ",d.schema=y,d.schemaPath=s+e.util.getProperty(x),d.errSchemaPath=u+"/"+e.util.escapeFragment(x),r+=" "+e.validate(d)+" ",d.baseId=M,r+=" } ",c&&(r+=" if ("+h+") { ",p+="}"))}return c&&(r+=" "+p+" if ("+f+" == errors) {"),r}},42785:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d=e.opts.$data&&a&&a.$data;d&&(r+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ");var p="i"+i,h="schema"+i;d||(r+=" var "+h+" = validate.schema"+s+";"),r+="var "+f+";",d&&(r+=" if (schema"+i+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+i+")) "+f+" = false; else {"),r+=f+" = false;for (var "+p+"=0; "+p+"<"+h+".length; "+p+"++) if (equal("+l+", "+h+"["+p+"])) { "+f+" = true; break; }",d&&(r+=" } "),r+=" if (!"+f+") { ";var v=v||[];v.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+i+" } ",!1!==e.opts.messages&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var m=r;return r=v.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",c&&(r+=" else { "),r}},72563:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||"");if(!1===e.opts.format)return c&&(r+=" if (true) { "),r;var f,d=e.opts.$data&&a&&a.$data;d?(r+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ",f="schema"+i):f=a;var p=e.opts.unknownFormats,h=Array.isArray(p);if(d){r+=" var "+(v="format"+i)+" = formats["+f+"]; var "+(m="isObject"+i)+" = typeof "+v+" == 'object' && !("+v+" instanceof RegExp) && "+v+".validate; var "+(g="formatType"+i)+" = "+m+" && "+v+".type || 'string'; if ("+m+") { ",e.async&&(r+=" var async"+i+" = "+v+".async; "),r+=" "+v+" = "+v+".validate; } if ( ",d&&(r+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),r+=" (","ignore"!=p&&(r+=" ("+f+" && !"+v+" ",h&&(r+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),r+=") || "),r+=" ("+v+" && "+g+" == '"+n+"' && !(typeof "+v+" == 'function' ? ",e.async?r+=" (async"+i+" ? await "+v+"("+l+") : "+v+"("+l+")) ":r+=" "+v+"("+l+") ",r+=" : "+v+".test("+l+"))))) {"}else{var v;if(!(v=e.formats[a])){if("ignore"==p)return e.logger.warn('unknown format "'+a+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(r+=" if (true) { "),r;if(h&&p.indexOf(a)>=0)return c&&(r+=" if (true) { "),r;throw new Error('unknown format "'+a+'" is used in schema at path "'+e.errSchemaPath+'"')}var m,g=(m="object"==typeof v&&!(v instanceof RegExp)&&v.validate)&&v.type||"string";if(m){var y=!0===v.async;v=v.validate}if(g!=n)return c&&(r+=" if (true) { "),r;if(y){if(!e.async)throw new Error("async format in sync schema");r+=" if (!(await "+(b="formats"+e.util.getProperty(a)+".validate")+"("+l+"))) { "}else{r+=" if (! ";var b="formats"+e.util.getProperty(a);m&&(b+=".validate"),r+="function"==typeof v?" "+b+"("+l+") ":" "+b+".test("+l+") ",r+=") { "}}var w=w||[];w.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",r+=d?""+f:""+e.util.toQuotedString(a),r+=" } ",!1!==e.opts.messages&&(r+=" , message: 'should match format \"",r+=d?"' + "+f+" + '":""+e.util.escapeQuotes(a),r+="\"' "),e.opts.verbose&&(r+=" , schema: ",r+=d?"validate.schema"+s:""+e.util.toQuotedString(a),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var x=r;return r=w.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+x+"]); ":r+=" validate.errors = ["+x+"]; return false; ":r+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",c&&(r+=" else { "),r}},84987:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d="errs__"+i,p=e.util.copy(e);p.level++;var h="valid"+p.level,v=e.schema.then,m=e.schema.else,g=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0||!1===v:e.util.schemaHasRules(v,e.RULES.all)),y=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all)),b=p.baseId;if(g||y){var w;p.createErrors=!1,p.schema=a,p.schemaPath=s,p.errSchemaPath=u,r+=" var "+d+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=p.compositeRule=!0,r+=" "+e.validate(p)+" ",p.baseId=b,p.createErrors=!0,r+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=p.compositeRule=x,g?(r+=" if ("+h+") { ",p.schema=e.schema.then,p.schemaPath=e.schemaPath+".then",p.errSchemaPath=e.errSchemaPath+"/then",r+=" "+e.validate(p)+" ",p.baseId=b,r+=" "+f+" = "+h+"; ",g&&y?r+=" var "+(w="ifClause"+i)+" = 'then'; ":w="'then'",r+=" } ",y&&(r+=" else { ")):r+=" if (!"+h+") { ",y&&(p.schema=e.schema.else,p.schemaPath=e.schemaPath+".else",p.errSchemaPath=e.errSchemaPath+"/else",r+=" "+e.validate(p)+" ",p.baseId=b,r+=" "+f+" = "+h+"; ",g&&y?r+=" var "+(w="ifClause"+i)+" = 'else'; ":w="'else'",r+=" } "),r+=" if (!"+f+") { var err = ",!1!==e.createErrors?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(r+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" } ",c&&(r+=" else { ")}else c&&(r+=" if (true) { ");return r}},38690:function(e,t,n){"use strict";e.exports={$ref:n(16348),allOf:n(51389),anyOf:n(32746),$comment:n(26985),const:n(36922),contains:n(83925),dependencies:n(7023),enum:n(42785),format:n(72563),if:n(84987),items:n(73250),maximum:n(17851),minimum:n(17851),maxItems:n(16982),minItems:n(16982),maxLength:n(9429),minLength:n(9429),maxProperties:n(68447),minProperties:n(68447),multipleOf:n(46180),not:n(3922),oneOf:n(15033),pattern:n(74589),properties:n(9854),propertyNames:n(77551),required:n(85856),uniqueItems:n(91538),validate:n(23073)}},73250:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d="errs__"+i,p=e.util.copy(e),h="";p.level++;var v="valid"+p.level,m="i"+i,g=p.dataLevel=e.dataLevel+1,y="data"+g,b=e.baseId;if(r+="var "+d+" = errors;var "+f+";",Array.isArray(a)){var w=e.schema.additionalItems;if(!1===w){r+=" "+f+" = "+l+".length <= "+a.length+"; ";var x=u;u=e.errSchemaPath+"/additionalItems",r+=" if (!"+f+") { ";var k=k||[];k.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a.length+" } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have more than "+a.length+" items' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var _=r;r=k.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+_+"]); ":r+=" validate.errors = ["+_+"]; return false; ":r+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",u=x,c&&(h+="}",r+=" else { ")}var E=a;if(E)for(var A,S=-1,O=E.length-1;S0||!1===A:e.util.schemaHasRules(A,e.RULES.all)){r+=" "+v+" = true; if ("+l+".length > "+S+") { ";var T=l+"["+S+"]";p.schema=A,p.schemaPath=s+"["+S+"]",p.errSchemaPath=u+"/"+S,p.errorPath=e.util.getPathExpr(e.errorPath,S,e.opts.jsonPointers,!0),p.dataPathArr[g]=S;var P=e.validate(p);p.baseId=b,e.util.varOccurences(P,y)<2?r+=" "+e.util.varReplace(P,y,T)+" ":r+=" var "+y+" = "+T+"; "+P+" ",r+=" } ",c&&(r+=" if ("+v+") { ",h+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0||!1===w:e.util.schemaHasRules(w,e.RULES.all))){p.schema=w,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+v+" = true; if ("+l+".length > "+a.length+") { for (var "+m+" = "+a.length+"; "+m+" < "+l+".length; "+m+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);T=l+"["+m+"]";p.dataPathArr[g]=m;P=e.validate(p);p.baseId=b,e.util.varOccurences(P,y)<2?r+=" "+e.util.varReplace(P,y,T)+" ":r+=" var "+y+" = "+T+"; "+P+" ",c&&(r+=" if (!"+v+") break; "),r+=" } } ",c&&(r+=" if ("+v+") { ",h+="}")}}else if(e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0||!1===a:e.util.schemaHasRules(a,e.RULES.all)){p.schema=a,p.schemaPath=s,p.errSchemaPath=u,r+=" for (var "+m+" = 0; "+m+" < "+l+".length; "+m+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);T=l+"["+m+"]";p.dataPathArr[g]=m;P=e.validate(p);p.baseId=b,e.util.varOccurences(P,y)<2?r+=" "+e.util.varReplace(P,y,T)+" ":r+=" var "+y+" = "+T+"; "+P+" ",c&&(r+=" if (!"+v+") break; "),r+=" }"}return c&&(r+=" "+h+" if ("+d+" == errors) {"),r}},46180:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),d=e.opts.$data&&s&&s.$data;if(d?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",r="schema"+o):r=s,!d&&"number"!=typeof s)throw new Error(t+" must be number");i+="var division"+o+";if (",d&&(i+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),i+=" (division"+o+" = "+f+" / "+r+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",d&&(i+=" ) "),i+=" ) { ";var p=p||[];p.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=d?"' + "+r:r+"'"),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var h=i;return i=p.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+h+"]); ":i+=" validate.errors = ["+h+"]; return false; ":i+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},3922:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,d=e.util.copy(e);d.level++;var p="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0||!1===a:e.util.schemaHasRules(a,e.RULES.all)){d.schema=a,d.schemaPath=s,d.errSchemaPath=u,r+=" var "+f+" = errors; ";var h,v=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(h=d.opts.allErrors,d.opts.allErrors=!1),r+=" "+e.validate(d)+" ",d.createErrors=!0,h&&(d.opts.allErrors=h),e.compositeRule=d.compositeRule=v,r+=" if ("+p+") { ";var m=m||[];m.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var g=r;r=m.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+g+"]); ":r+=" validate.errors = ["+g+"]; return false; ":r+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(r+=" if (false) { ");return r}},15033:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="valid"+i,d="errs__"+i,p=e.util.copy(e),h="";p.level++;var v="valid"+p.level,m=p.baseId,g="prevValid"+i,y="passingSchemas"+i;r+="var "+d+" = errors , "+g+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=p.compositeRule=!0;var w=a;if(w)for(var x,k=-1,_=w.length-1;k<_;)x=w[k+=1],(e.opts.strictKeywords?"object"==typeof x&&Object.keys(x).length>0||!1===x:e.util.schemaHasRules(x,e.RULES.all))?(p.schema=x,p.schemaPath=s+"["+k+"]",p.errSchemaPath=u+"/"+k,r+=" "+e.validate(p)+" ",p.baseId=m):r+=" var "+v+" = true; ",k&&(r+=" if ("+v+" && "+g+") { "+f+" = false; "+y+" = ["+y+", "+k+"]; } else { ",h+="}"),r+=" if ("+v+") { "+f+" = "+g+" = true; "+y+" = "+k+"; }";return e.compositeRule=p.compositeRule=b,r+=h+"if (!"+f+") { var err = ",!1!==e.createErrors?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}},74589:function(e){"use strict";e.exports=function(e,t,n){var r,i=" ",o=e.level,a=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,f="data"+(a||""),d=e.opts.$data&&s&&s.$data;d?(i+=" var schema"+o+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",r="schema"+o):r=s,i+="if ( ",d&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'string') || "),i+=" !"+(d?"(new RegExp("+r+"))":e.usePattern(s))+".test("+f+") ) { ";var p=p||[];p.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",i+=d?""+r:""+e.util.toQuotedString(s),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match pattern \"",i+=d?"' + "+r+" + '":""+e.util.escapeQuotes(s),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+u:""+e.util.toQuotedString(s),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var h=i;return i=p.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+h+"]); ":i+=" validate.errors = ["+h+"]; return false; ":i+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",l&&(i+=" else { "),i}},9854:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,d=e.util.copy(e),p="";d.level++;var h="valid"+d.level,v="key"+i,m="idx"+i,g=d.dataLevel=e.dataLevel+1,y="data"+g,b="dataProperties"+i,w=Object.keys(a||{}).filter(j),x=e.schema.patternProperties||{},k=Object.keys(x).filter(j),_=e.schema.additionalProperties,E=w.length||k.length,A=!1===_,S="object"==typeof _&&Object.keys(_).length,O=e.opts.removeAdditional,T=A||S||O,P=e.opts.ownProperties,C=e.baseId,I=e.schema.required;if(I&&(!e.opts.$data||!I.$data)&&I.length8)r+=" || validate.schema"+s+".hasOwnProperty("+v+") ";else{var N=w;if(N)for(var M=-1,L=N.length-1;M0||!1===X:e.util.schemaHasRules(X,e.RULES.all)){var $=e.util.getProperty(K),ee=(V=l+$,G&&void 0!==X.default);d.schema=X,d.schemaPath=s+$,d.errSchemaPath=u+"/"+e.util.escapeFragment(K),d.errorPath=e.util.getPath(e.errorPath,K,e.opts.jsonPointers),d.dataPathArr[g]=e.util.toQuotedString(K);W=e.validate(d);if(d.baseId=C,e.util.varOccurences(W,y)<2){W=e.util.varReplace(W,y,V);var te=V}else{te=y;r+=" var "+y+" = "+V+"; "}if(ee)r+=" "+W+" ";else{if(R&&R[K]){r+=" if ( "+te+" === undefined ",P&&(r+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(K)+"') "),r+=") { "+h+" = false; ";F=e.errorPath,z=u;var ne,re=e.util.escapeQuotes(K);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(F,K,e.opts.jsonPointers)),u=e.errSchemaPath+"/required",(ne=ne||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+re+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";H=r;r=ne.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+H+"]); ":r+=" validate.errors = ["+H+"]; return false; ":r+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=z,e.errorPath=F,r+=" } else { "}else c?(r+=" if ( "+te+" === undefined ",P&&(r+=" || ! Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(K)+"') "),r+=") { "+h+" = true; } else { "):(r+=" if ("+te+" !== undefined ",P&&(r+=" && Object.prototype.hasOwnProperty.call("+l+", '"+e.util.escapeQuotes(K)+"') "),r+=" ) { ");r+=" "+W+" } "}}c&&(r+=" if ("+h+") { ",p+="}")}}if(k.length){var ie=k;if(ie)for(var oe,ae=-1,se=ie.length-1;ae0||!1===X:e.util.schemaHasRules(X,e.RULES.all)){d.schema=X,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(oe),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(oe),r+=P?" "+b+" = "+b+" || Object.keys("+l+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+v+" = "+b+"["+m+"]; ":" for (var "+v+" in "+l+") { ",r+=" if ("+e.usePattern(oe)+".test("+v+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers);V=l+"["+v+"]";d.dataPathArr[g]=v;W=e.validate(d);d.baseId=C,e.util.varOccurences(W,y)<2?r+=" "+e.util.varReplace(W,y,V)+" ":r+=" var "+y+" = "+V+"; "+W+" ",c&&(r+=" if (!"+h+") break; "),r+=" } ",c&&(r+=" else "+h+" = true; "),r+=" } ",c&&(r+=" if ("+h+") { ",p+="}")}}}return c&&(r+=" "+p+" if ("+f+" == errors) {"),r}},77551:function(e){"use strict";e.exports=function(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),f="errs__"+i,d=e.util.copy(e);d.level++;var p="valid"+d.level;if(r+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof a&&Object.keys(a).length>0||!1===a:e.util.schemaHasRules(a,e.RULES.all)){d.schema=a,d.schemaPath=s,d.errSchemaPath=u;var h="key"+i,v="idx"+i,m="i"+i,g="' + "+h+" + '",y="data"+(d.dataLevel=e.dataLevel+1),b="dataProperties"+i,w=e.opts.ownProperties,x=e.baseId;w&&(r+=" var "+b+" = undefined; "),r+=w?" "+b+" = "+b+" || Object.keys("+l+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+h+" = "+b+"["+v+"]; ":" for (var "+h+" in "+l+") { ",r+=" var startErrs"+i+" = errors; ";var k=h,_=e.compositeRule;e.compositeRule=d.compositeRule=!0;var E=e.validate(d);d.baseId=x,e.util.varOccurences(E,y)<2?r+=" "+e.util.varReplace(E,y,k)+" ":r+=" var "+y+" = "+k+"; "+E+" ",e.compositeRule=d.compositeRule=_,r+=" if (!"+p+") { for (var "+m+"=startErrs"+i+"; "+m+"0||!1===b:e.util.schemaHasRules(b,e.RULES.all))||(h[h.length]=m)}}else h=a;if(d||h.length){var w=e.errorPath,x=d||h.length>=e.opts.loopRequired,k=e.opts.ownProperties;if(c)if(r+=" var missing"+i+"; ",x){d||(r+=" var "+p+" = validate.schema"+s+"; ");var _="' + "+(P="schema"+i+"["+(S="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,P,e.opts.jsonPointers)),r+=" var "+f+" = true; ",d&&(r+=" if (schema"+i+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+i+")) "+f+" = false; else {"),r+=" for (var "+S+" = 0; "+S+" < "+p+".length; "+S+"++) { "+f+" = "+l+"["+p+"["+S+"]] !== undefined ",k&&(r+=" && Object.prototype.hasOwnProperty.call("+l+", "+p+"["+S+"]) "),r+="; if (!"+f+") break; } ",d&&(r+=" } "),r+=" if (!"+f+") { ",(T=T||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+_+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+_+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),r+=" } "):r+=" {} ";var E=r;r=T.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+E+"]); ":r+=" validate.errors = ["+E+"]; return false; ":r+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var A=h;if(A)for(var S=-1,O=A.length-1;S 1) { ";var h=e.schema.items&&e.schema.items.type,v=Array.isArray(h);if(!h||"object"==h||"array"==h||v&&(h.indexOf("object")>=0||h.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+d+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var m="checkDataType"+(v?"s":"");i+=" if ("+e.util[m](h,"item",e.opts.strictNumbers,!0)+") continue; ",v&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",p&&(i+=" } "),i+=" if (!"+d+") { ";var g=g||[];g.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=p?"validate.schema"+u:""+s,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var y=i;i=g.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",l&&(i+=" else { ")}else l&&(i+=" if (true) { ");return i}},23073:function(e){"use strict";e.exports=function(e,t,n){var r="",i=!0===e.schema.$async,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),a=e.self._getId(e.schema);if(e.opts.strictKeywords){var s=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(s){var u="unknown keyword: "+s;if("log"!==e.opts.strictKeywords)throw new Error(u);e.logger.warn(u)}}if(e.isTop&&(r+=" var validate = ",i&&(e.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",a&&(e.opts.sourceCode||e.opts.processCode)&&(r+=" /*# sourceURL="+a+" */ ")),"boolean"==typeof e.schema||!o&&!e.schema.$ref){t="false schema";var c=e.level,l=e.dataLevel,f=e.schema[t],d=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,v="data"+(l||""),m="valid"+c;if(!1===e.schema){e.isTop?h=!0:r+=" var "+m+" = false; ",(J=J||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'boolean schema is false' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),r+=" } "):r+=" {} ";var g=r;r=J.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+g+"]); ":r+=" validate.errors = ["+g+"]; return false; ":r+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?r+=i?" return data; ":" validate.errors = null; return true; ":r+=" var "+m+" = true; ";return e.isTop&&(r+=" }; return validate; "),r}if(e.isTop){var y=e.isTop;c=e.level=0,l=e.dataLevel=0,v="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var b="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(b);e.logger.warn(b)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{c=e.level,v="data"+((l=e.dataLevel)||"");if(a&&(e.baseId=e.resolve.url(e.baseId,a)),i&&!e.async)throw new Error("async schema in sync schema");r+=" var errs_"+c+" = errors;"}m="valid"+c,h=!e.opts.allErrors;var w="",x="",k=e.schema.type,_=Array.isArray(k);if(k&&e.opts.nullable&&!0===e.schema.nullable&&(_?-1==k.indexOf("null")&&(k=k.concat("null")):"null"!=k&&(k=[k,"null"],_=!0)),_&&1==k.length&&(k=k[0],_=!1),e.schema.$ref&&o){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(o=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(r+=" "+e.RULES.all.$comment.code(e,"$comment")),k){if(e.opts.coerceTypes)var E=e.util.coerceToTypes(e.opts.coerceTypes,k);var A=e.RULES.types[k];if(E||_||!0===A||A&&!Q(A)){d=e.schemaPath+".type",p=e.errSchemaPath+"/type",d=e.schemaPath+".type",p=e.errSchemaPath+"/type";var S=_?"checkDataTypes":"checkDataType";if(r+=" if ("+e.util[S](k,v,e.opts.strictNumbers,!0)+") { ",E){var O="dataType"+c,T="coerced"+c;r+=" var "+O+" = typeof "+v+"; var "+T+" = undefined; ","array"==e.opts.coerceTypes&&(r+=" if ("+O+" == 'object' && Array.isArray("+v+") && "+v+".length == 1) { "+v+" = "+v+"[0]; "+O+" = typeof "+v+"; if ("+e.util.checkDataType(e.schema.type,v,e.opts.strictNumbers)+") "+T+" = "+v+"; } "),r+=" if ("+T+" !== undefined) ; ";var P=E;if(P)for(var C,I=-1,R=P.length-1;I1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},e.prototype._dispatch=function(){var e=this,t=this._queue.shift();if(t){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}();t.default=i},50224:function(e,t,n){"use strict";t.WU=void 0;var r=n(44246);Object.defineProperty(t,"WU",{enumerable:!0,get:function(){return r.default}});var i=n(75884);var o=n(73398)},73398:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=void 0;var r=n(5052);t.withTimeout=function(e,t,n){var i=this;return void 0===n&&(n=new Error("timeout")),{acquire:function(){return new Promise((function(o,a){return r.__awaiter(i,void 0,void 0,(function(){var i,s;return r.__generator(this,(function(r){switch(r.label){case 0:return i=!1,setTimeout((function(){i=!0,a(n)}),t),[4,e.acquire()];case 1:return s=r.sent(),i?(Array.isArray(s)?s[1]:s)():o(s),[2]}}))}))}))},runExclusive:function(e){return r.__awaiter(this,void 0,void 0,(function(){var t,n;return r.__generator(this,(function(r){switch(r.label){case 0:t=function(){},r.label=1;case 1:return r.trys.push([1,,7,8]),[4,this.acquire()];case 2:return n=r.sent(),Array.isArray(n)?(t=n[1],[4,e(n[0])]):[3,4];case 3:return[2,r.sent()];case 4:return t=n,[4,e()];case 5:return[2,r.sent()];case 6:return[3,8];case 7:return t(),[7];case 8:return[2]}}))}))},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}},2470:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=s(e),a=o[0],u=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,u)),l=0,f=u>0?a-4:a;for(n=0;n>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===u&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,c=r-i;sc?c:s+a));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],r[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},65109:function(e){"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={},r=0;r<32;r++){var i=t.charAt(r);if(void 0!==n[i])throw new TypeError(i+" is ambiguous");n[i]=r}function o(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=o(t)^r>>5}for(t=o(t),n=0;nt)return"Exceeds length limit";var r=e.toLowerCase(),i=e.toUpperCase();if(e!==r&&e!==i)return"Mixed-case string "+e;var s=(e=r).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var u=e.slice(0,s),c=e.slice(s+1);if(c.length<6)return"Data too short";var l=a(u);if("string"===typeof l)return l;for(var f=[],d=0;d=c.length||f.push(h)}return 1!==l?"Invalid checksum for "+e:{prefix:u,words:f}}function u(e,t,n,r){for(var i=0,o=0,a=(1<=n;)o-=n,s.push(i>>o&a);if(r)o>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var i=a(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var s=e+"1",u=0;u>5!==0)throw new Error("Non 5-bit word");i=o(i)^c,s+=t.charAt(c)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u){s+=t.charAt(i>>5*(5-u)&31)}return s},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},76791:function(e,t,n){var r;!function(i){"use strict";var o,a=1e6,s=1e6,u="[big.js] ",c=u+"Invalid ",l=c+"decimal places",f=c+"rounding mode",d=u+"Division by zero",p={},h=void 0,v=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function m(e,t,n,r){var i=e.c,o=e.e+t+1;if(o=5;else if(2===n)r=i[o]>5||5==i[o]&&(r||o<0||i[o+1]!==h||1&i[o-1]);else if(3===n)r=r||!!i[0];else if(r=!1,0!==n)throw Error(f);if(o<1)i.length=1,r?(e.e=-t,i[0]=1):i[0]=e.e=0;else{if(i.length=o--,r)for(;++i[o]>9;)i[o]=0,o--||(++e.e,i.unshift(1));for(o=i.length;!i[--o];)i.pop()}}else if(n<0||n>3||n!==~~n)throw Error(f);return e}function g(e,t,n,r){var i,o,s=e.constructor,u=!e.c[0];if(n!==h){if(n!==~~n||n<(3==t)||n>a)throw Error(3==t?c+"precision":l);for(n=r-(e=new s(e)).e,e.c.length>++r&&m(e,n,s.RM),2==t&&(r=e.e+n+1);e.c.length=s.PE))o=o.charAt(0)+(n>1?"."+o.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)o="0"+o;o="0."+o}else if(i>0)if(++i>n)for(i-=n;i--;)o+="0";else i1&&(o=o.charAt(0)+"."+o.slice(1));return e.s<0&&(!u||4==t)?"-"+o:o}p.abs=function(){var e=new this.constructor(this);return e.s=1,e},p.cmp=function(e){var t,n=this,r=n.c,i=(e=new n.constructor(e)).c,o=n.s,a=e.s,s=n.e,u=e.e;if(!r[0]||!i[0])return r[0]?o:i[0]?-a:0;if(o!=a)return o;if(t=o<0,s!=u)return s>u^t?1:-1;for(a=(s=r.length)<(u=i.length)?s:u,o=-1;++oi[o]^t?1:-1;return s==u?0:s>u^t?1:-1},p.div=function(e){var t=this,n=t.constructor,r=t.c,i=(e=new n(e)).c,o=t.s==e.s?1:-1,s=n.DP;if(s!==~~s||s<0||s>a)throw Error(l);if(!i[0])throw Error(d);if(!r[0])return new n(0*o);var u,c,f,p,v,g=i.slice(),y=u=i.length,b=r.length,w=r.slice(0,u),x=w.length,k=e,_=k.c=[],E=0,A=s+(k.e=t.e-e.e)+1;for(k.s=o,o=A<0?0:A,g.unshift(0);x++x?1:-1;else for(v=-1,p=0;++vw[v]?1:-1;break}if(!(p<0))break;for(c=x==u?i:g;x;){if(w[--x]A&&m(k,s,n.RM,w[0]!==h),k},p.eq=function(e){return!this.cmp(e)},p.gt=function(e){return this.cmp(e)>0},p.gte=function(e){return this.cmp(e)>-1},p.lt=function(e){return this.cmp(e)<0},p.lte=function(e){return this.cmp(e)<1},p.minus=p.sub=function(e){var t,n,r,i,o=this,a=o.constructor,s=o.s,u=(e=new a(e)).s;if(s!=u)return e.s=-u,o.plus(e);var c=o.c.slice(),l=o.e,f=e.c,d=e.e;if(!c[0]||!f[0])return f[0]?(e.s=-u,e):new a(c[0]?o:0);if(s=l-d){for((i=s<0)?(s=-s,r=c):(d=l,r=f),r.reverse(),u=s;u--;)r.push(0);r.reverse()}else for(n=((i=c.length0)for(;u--;)c[t++]=0;for(u=t;n>s;){if(c[--n]0?(u=a,t=c):(i=-i,t=s),t.reverse();i--;)t.push(0);t.reverse()}for(s.length-c.length<0&&(t=c,c=s,s=t),i=c.length,o=0;i;s[i]%=10)o=(s[--i]=s[i]+c[i]+o)/10|0;for(o&&(s.unshift(o),++u),i=s.length;0===s[--i];)s.pop();return e.c=s,e.e=u,e},p.pow=function(e){var t=this,n=new t.constructor(1),r=n,i=e<0;if(e!==~~e||e<-1e6||e>s)throw Error(c+"exponent");for(i&&(e=-e);1&e&&(r=r.times(t)),e>>=1;)t=t.times(t);return i?n.div(r):r},p.round=function(e,t){var n=this.constructor;if(e===h)e=0;else if(e!==~~e||e<-a||e>a)throw Error(l);return m(new n(this),e,t===h?n.RM:t)},p.sqrt=function(){var e,t,n,r=this,i=r.constructor,o=r.s,a=r.e,s=new i(.5);if(!r.c[0])return new i(r);if(o<0)throw Error(u+"No square root");0===(o=Math.sqrt(r+""))||o===1/0?((t=r.c.join("")).length+a&1||(t+="0"),a=((a+1)/2|0)-(a<0||1&a),e=new i(((o=Math.sqrt(t))==1/0?"1e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+a)):e=new i(o),a=e.e+(i.DP+=4);do{n=e,e=s.times(n.plus(r.div(n)))}while(n.c.slice(0,a).join("")!==e.c.slice(0,a).join(""));return m(e,i.DP-=4,i.RM)},p.times=p.mul=function(e){var t,n=this,r=n.constructor,i=n.c,o=(e=new r(e)).c,a=i.length,s=o.length,u=n.e,c=e.e;if(e.s=n.s==e.s?1:-1,!i[0]||!o[0])return new r(0*e.s);for(e.e=u+c,au;)s=t[c]+o[u]*i[c-u-1]+s,t[c--]=s%10,s=s/10|0;t[c]=(t[c]+s)%10}for(s?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e},p.toExponential=function(e){return g(this,1,e,e)},p.toFixed=function(e){return g(this,2,e,this.e+e)},p.toPrecision=function(e){return g(this,3,e,e-1)},p.toString=function(){return g(this)},p.valueOf=p.toJSON=function(){return g(this,4)},o=function e(){function t(n){var r=this;if(!(r instanceof t))return n===h?e():new t(n);n instanceof t?(r.s=n.s,r.e=n.e,r.c=n.c.slice()):function(e,t){var n,r,i;if(0===t&&1/t<0)t="-0";else if(!v.test(t+=""))throw Error(c+"number");e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(n=t.indexOf("."))>-1&&(t=t.replace(".",""));(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length);for(i=t.length,r=0;r0&&"0"==t.charAt(--i););for(e.e=n-r-1,e.c=[],n=0;r<=i;)e.c[n++]=+t.charAt(r++)}}(r,n),r.constructor=t}return t.prototype=p,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.version="5.2.2",t}(),o.default=o.Big=o,void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},45590:function(e,t){"use strict";var n;function r(e,t,r){if(!r||typeof r.value!==n.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+t+"> is not a method!");return{configurable:n.boolTrue,get:function(){var e=r.value.bind(this);return Object.defineProperty(this,t,{value:e,configurable:n.boolTrue,writable:n.boolTrue}),e}}}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.typeOfFunction="function",e.boolTrue=!0}(n||(n={})),t.bind=r,t.default=r},40918:function(e,t,n){"use strict";var r=n(2470),i=n(60545),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,n)}function c(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|v(e,t),r=s(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);var i=function(e){if(u.isBuffer(e)){var t=0|h(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||z(e.length)?s(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),s(e<0?0:0|h(e))}function d(e){for(var t=e.length<0?0:0|h(e.length),n=s(t),r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function v(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(i)return r?-1:D(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return S(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,d=0;di&&(r=i):r=i;var o=t.length;r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function S(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128===(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?u.from(o).copy(r,i):Uint8Array.prototype.set.call(r,o,i);else{if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i)}i+=o.length}return r},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,i){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return k(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return t=+t,n>>>=0,o||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o>>=0,t>>>=0,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function B(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!==e}var H=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},44680:function(e,t,n){"use strict";var r=n(28476),i=n(59962),o=i(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"===typeof n&&o(e,".prototype.")>-1?i(n):n}},59962:function(e,t,n){"use strict";var r=n(1199),i=n(28476),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||r.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(d){c=null}e.exports=function(e){var t=s(r,a,arguments);u&&c&&(u(t,"length").configurable&&c(t,"length",{value:1+l(0,e.length-(arguments.length-1))}));return t};var f=function(){return s(r,o,arguments)};c?c(e.exports,"apply",{value:f}):e.exports.apply=f},2304:function(e,t,n){"use strict";var r=n(74704).default,i=n(56690).default,o=n(89728).default,a=n(2042).encodeText,s=function(){function e(t,n,r,o){i(this,e),this.name=t,this.code=n,this.codeBuf=a(this.code),this.alphabet=o,this.codec=r(o)}return o(e,[{key:"encode",value:function(e){return this.codec.encode(e)}},{key:"decode",value:function(e){var t,n=r(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(this.alphabet&&this.alphabet.indexOf(i)<0)throw new Error("invalid character '".concat(i,"' in '").concat(e,"'"))}}catch(o){n.e(o)}finally{n.f()}return this.codec.decode(e)}}]),e}();e.exports=s},45067:function(e,t,n){"use strict";var r=n(17391),i=n(2304),o=n(83833).rfc4648,a=n(2042),s=a.decodeText,u=a.encodeText,c=[["identity","\0",function(){return{encode:s,decode:u}},""],["base2","0",o(1),"01"],["base8","7",o(3),"01234567"],["base10","9",r,"0123456789"],["base16","f",o(4),"0123456789abcdef"],["base16upper","F",o(4),"0123456789ABCDEF"],["base32hex","v",o(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",o(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",o(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",o(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",o(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",r,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",r,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",r,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",r,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],l=c.reduce((function(e,t){return e[t[0]]=new i(t[0],t[1],t[2],t[3]),e}),{}),f=c.reduce((function(e,t){return e[t[1]]=l[t[0]],e}),{});e.exports={names:l,codes:f}},96332:function(e,t,n){"use strict";var r=n(45067),i=n(2042),o=i.encodeText,a=i.decodeText,s=i.concat;function u(e){if(Object.prototype.hasOwnProperty.call(r.names,e))return r.names[e];if(Object.prototype.hasOwnProperty.call(r.codes,e))return r.codes[e];throw new Error("Unsupported encoding: ".concat(e))}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");var n=u(e),r=n.name,i=n.codeBuf;return function(e,t){var n=u(e);n.decode(a(t))}(r,t),s([i,t],i.length+t.length)}).encode=function(e,t){var n=u(e),r=o(n.encode(t));return s([n.codeBuf,r],n.codeBuf.length+r.length)},t.decode=function(e){e instanceof Uint8Array&&(e=a(e));var t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),u(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=a(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return u(e[0]).name}catch(t){return!1}},t.encoding=u,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=a(e)),u(e[0])};var c=Object.freeze(r.names),l=Object.freeze(r.codes);t.names=c,t.codes=l},83833:function(e){"use strict";e.exports={rfc4648:function(e){return function(t){return{encode:function(n){return function(e,t,n){for(var r="="===t[t.length-1],i=(1<n;)o+=t[i&s>>(a-=n)];if(a&&(o+=t[i&s<=8&&(s-=8,a[c++]=255&u>>s)}if(s>=n||255&u<<8-s)throw new SyntaxError("Unexpected end of data");return a}(n,t,e)}}}}}},2042:function(e,t,n){"use strict";var r=n(74704).default,i=new TextDecoder,o=new TextEncoder;e.exports={decodeText:function(e){return i.decode(e)},encodeText:function(e){return o.encode(e)},concat:function(e,t){var n,i=new Uint8Array(t),o=0,a=r(e);try{for(a.s();!(n=a.n()).done;){var s=n.value;i.set(s,o),o+=s.length}}catch(u){a.e(u)}finally{a.f()}return i}}},44265:function(e){e.exports=function e(r,i){var o,a=0,s=0,u=i=i||0,c=r.length;do{if(u>=c||s>49)throw e.bytes=0,new RangeError("Could not decode varint");o=r[u++],a+=s<28?(o&n)<=t);return e.bytes=u-i,a};var t=128,n=127},55152:function(e){e.exports=function e(i,o,a){if(Number.MAX_SAFE_INTEGER&&i>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");o=o||[];var s=a=a||0;for(;i>=r;)o[a++]=255&i|t,i/=128;for(;i&n;)o[a++]=255&i|t,i>>>=7;return o[a]=0|i,e.bytes=a-s+1,o};var t=128,n=-128,r=Math.pow(2,31)},99917:function(e,t,n){e.exports={encode:n(55152),decode:n(44265),encodingLength:n(7807)}},7807:function(e){var t=Math.pow(2,7),n=Math.pow(2,14),r=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),a=Math.pow(2,42),s=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e 2 bytes.");var t=i.decode(e);if(!v(t))throw new Error("multihash unknown function code: 0x".concat(t.toString(16)));e=e.slice(i.decode.bytes);var n=i.decode(e);if(n<0)throw new Error("multihash invalid length: ".concat(n));if((e=e.slice(i.decode.bytes)).length!==n)throw new Error("multihash length inconsistent: 0x".concat(a(e,"base16")));return{code:t,name:c[t],length:n,digest:e}}function p(e){var t=e;if("string"===typeof e){if(void 0===o[e])throw new Error("Unrecognized hash function named: ".concat(e));t=o[e]}if("number"!==typeof t)throw new Error("Hash function code should be a number. Got: ".concat(t));if(void 0===c[t]&&!h(t))throw new Error("Unrecognized function code: ".concat(t));return t}function h(e){return e>0&&e<16}function v(e){return!!h(e)||!!c[e]}function m(e){d(e)}Object.freeze(c),e.exports={names:o,codes:c,toHexString:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return a(e,"base16")},fromHexString:function(e){return s(e,"base16")},toB58String:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return a(r.encode("base58btc",e)).slice(1)},fromB58String:function(e){var t=e instanceof Uint8Array?a(e):e;return r.decode("z"+t)},decode:d,encode:function(e,t,n){if(!e||void 0===t)throw new Error("multihash encode requires at least two args: digest, code");var r=p(t);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==n&&(n=e.length),n&&e.length!==n)throw new Error("digest length should be equal to specified length.");var o=i.encode(r),a=i.encode(n);return u([o,a,e],o.length+a.length+e.length)},coerceCode:p,isAppCode:h,validate:m,prefix:function(e){return m(e),e.subarray(0,2)},isValidCode:v}},92202:function(e,t,n){"use strict";var r=n(97599),i={checkCIDComponents:function(e){if(null==e)return"null values are not valid CIDs";if(0!==e.version&&1!==e.version)return"Invalid version, must be a number equal to 1 or 0";if("string"!==typeof e.codec)return"codec must be string";if(0===e.version){if("dag-pb"!==e.codec)return"codec must be 'dag-pb' for CIDv0";if("base58btc"!==e.multibaseName)return"multibaseName must be 'base58btc' for CIDv0"}if(!(e.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{r.validate(e.multihash)}catch(n){var t=n.message;return t||(t="Multihash validation failed"),t}}};e.exports=i},57964:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,o=n(97599),a=n(96332),s=n(15887),u=n(92202),c=n(45201).concat,l=n(74233).toString,f=n(52568).equals,d=s.nameToCode,p=Object.keys(d).reduce((function(e,t){return e[d[t]]=t,e}),{}),h=Symbol.for("@ipld/js-cid/CID"),v=function(e){function t(e,n,i,u){if(r(this,t),this.version,this.codec,this.multihash,Object.defineProperty(this,h,{value:!0}),t.isCID(e)){var c=e;return this.version=c.version,this.codec=c.codec,this.multihash=c.multihash,void(this.multibaseName=c.multibaseName||(0===c.version?"base58btc":"base32"))}if("string"===typeof e){var l=a.isEncoded(e);if(l){var f=a.decode(e);this.version=parseInt(f[0].toString(),16),this.codec=s.getCodec(f.slice(1)),this.multihash=s.rmPrefix(f.slice(1)),this.multibaseName=l}else this.version=0,this.codec="dag-pb",this.multihash=o.fromB58String(e),this.multibaseName="base58btc";return t.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(e instanceof Uint8Array){var d=parseInt(e[0].toString(),16);if(1===d){var v=e;this.version=d,this.codec=s.getCodec(v.slice(1)),this.multihash=s.rmPrefix(v.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";t.validateCID(this)}else this.version=e,"number"===typeof n&&(n=p[n]),this.codec=n,this.multihash=i,this.multibaseName=u||(0===e?"base58btc":"base32"),t.validateCID(this)}return i(t,[{key:"bytes",get:function(){var e=this._bytes;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");var t=s.getCodeVarint(this.codec);e=c([[1],t,this.multihash],1+t.byteLength+this.multihash.byteLength)}Object.defineProperty(this,"_bytes",{value:e})}return e}},{key:"prefix",get:function(){var e=s.getCodeVarint(this.codec),t=o.prefix(this.multihash);return c([[this.version],e,t],1+e.byteLength+t.byteLength)}},{key:"code",get:function(){return d[this.codec]}},{key:"toV0",value:function(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");var e=o.decode(this.multihash),n=e.name,r=e.length;if("sha2-256"!==n)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==r)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new t(0,this.codec,this.multihash)}},{key:"toV1",value:function(){return new t(1,this.codec,this.multihash,this.multibaseName)}},{key:"toBaseEncodedString",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.multibaseName;if(this.string&&0!==this.string.length&&t===this.multibaseName)return this.string;if(0===this.version){if("base58btc"!==t)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");e=o.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");e=l(a.encode(t,this.bytes))}return t===this.multibaseName&&Object.defineProperty(this,"string",{value:e}),e}},{key:e,value:function(){return"CID("+this.toString()+")"}},{key:"toString",value:function(e){return this.toBaseEncodedString(e)}},{key:"toJSON",value:function(){return{codec:this.codec,version:this.version,hash:this.multihash}}},{key:"equals",value:function(e){return this.codec===e.codec&&this.version===e.version&&f(this.multihash,e.multihash)}}],[{key:"validateCID",value:function(e){var t=u.checkCIDComponents(e);if(t)throw new Error(t)}},{key:"isCID",value:function(e){return e instanceof t||Boolean(e&&e[h])}}]),t}(Symbol.for("nodejs.util.inspect.custom"));v.codecs=d,e.exports=v},97438:function(e){var t=function(){"use strict";function e(t,r,i,o){"object"===typeof r&&(i=r.depth,o=r.prototype,r.filter,r=r.circular);var a=[],s=[],u="undefined"!=typeof Buffer;return"undefined"==typeof r&&(r=!0),"undefined"==typeof i&&(i=1/0),function t(i,c){if(null===i)return null;if(0==c)return i;var l,f;if("object"!=typeof i)return i;if(e.__isArray(i))l=[];else if(e.__isRegExp(i))l=new RegExp(i.source,n(i)),i.lastIndex&&(l.lastIndex=i.lastIndex);else if(e.__isDate(i))l=new Date(i.getTime());else{if(u&&Buffer.isBuffer(i))return l=Buffer.allocUnsafe?Buffer.allocUnsafe(i.length):new Buffer(i.length),i.copy(l),l;"undefined"==typeof o?(f=Object.getPrototypeOf(i),l=Object.create(f)):(l=Object.create(o),f=o)}if(r){var d=a.indexOf(i);if(-1!=d)return s[d];a.push(i),s.push(l)}for(var p in i){var h;f&&(h=Object.getOwnPropertyDescriptor(f,p)),h&&null==h.set||(l[p]=t(i[p],c-1))}return l}(t,i)}function t(e){return Object.prototype.toString.call(e)}function n(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return e.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},e.__objToStr=t,e.__isDate=function(e){return"object"===typeof e&&"[object Date]"===t(e)},e.__isArray=function(e){return"object"===typeof e&&"[object Array]"===t(e)},e.__isRegExp=function(e){return"object"===typeof e&&"[object RegExp]"===t(e)},e.__getRegExpFlags=n,e}();e.exports&&(e.exports=t)},83061:function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t1&&(i-=1)),[360*i,100*o,100*c]},a.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[a.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(n,r))),100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},a.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-i)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-i-t)/(1-t)||0),100*t]},a.rgb.keyword=function(e){var t=i[e];if(t)return t;var n,o,a,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var c=r[u],l=(o=e,a=c,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));l.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},a.rgb.lab=function(e){var t=a.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(e){var t,n,r,i,o,a=e[0]/360,s=e[1]/100,u=e[2]/100;if(0===s)return[o=255*u,o,o];t=2*u-(n=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[c]=255*o;return i},a.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[t,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*o),u=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,u,a];case 1:return[s,r,a];case 2:return[a,r,u];case 3:return[a,s,r];case 4:return[u,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(e){var t,n,r,i=e[0],o=e[1]/100,a=e[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(t=(2-o)*s)<=1?t:2-t)||0),100*(r/=2)]},a.hwb.rgb=function(e){var t,n,r,i,o,a,s,u=e[0]/360,c=e[1]/100,l=e[2]/100,f=c+l;switch(f>1&&(c/=f,l/=f),r=6*u-(t=Math.floor(6*u)),0!==(1&t)&&(r=1-r),i=c+r*((n=1-l)-c),t){default:case 6:case 0:o=n,a=i,s=c;break;case 1:o=i,a=n,s=c;break;case 2:o=c,a=n,s=i;break;case 3:o=c,a=i,s=n;break;case 4:o=i,a=c,s=n;break;case 5:o=n,a=c,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(e){var t,n,r,i=e[0]/100,o=e[1]/100,a=e[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,t=(t=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(e){var t,n,r,i=e[0];t=e[1]/500+(n=(i+16)/116),r=n-e[2]/200;var o=Math.pow(n,3),a=Math.pow(t,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},a.lab.lch=function(e){var t,n=e[0],r=e[1],i=e[2];return(t=360*Math.atan2(i,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+i*i),t]},a.lch.lab=function(e){var t,n=e[0],r=e[1];return t=e[2]/360*2*Math.PI,[n,r*Math.cos(t),r*Math.sin(t)]},a.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:a.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return t=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,i=0;return(r=n<.5?2*t*n:2*t*(1-n))<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},a.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},a.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var i,o=[0,0,0],a=t%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},a.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},a.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},a.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},a.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=a.gray.hsv=function(e){return[0,0,e[0]]},a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},35111:function(e,t,n){var r=n(94860),i=n(15103),o={};Object.keys(r).forEach((function(e){o[e]={},Object.defineProperty(o[e],"channels",{value:r[e].channels}),Object.defineProperty(o[e],"labels",{value:r[e].labels});var t=i(e);Object.keys(t).forEach((function(n){var r=t[n];o[e][n]=function(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"===typeof n)for(var r=n.length,i=0;i1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)}))})),e.exports=o},25926:function(e){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},15103:function(e,t,n){var r=n(94860);function i(e){var t=function(){for(var e={},t=Object.keys(r),n=t.length,i=0;in?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){return this.values.hsl[2]+=this.values.hsl[2]*e,this.setValues("hsl",this.values.hsl),this},darken:function(e){return this.values.hsl[2]-=this.values.hsl[2]*e,this.setValues("hsl",this.values.hsl),this},saturate:function(e){return this.values.hsl[1]+=this.values.hsl[1]*e,this.setValues("hsl",this.values.hsl),this},desaturate:function(e){return this.values.hsl[1]-=this.values.hsl[1]*e,this.setValues("hsl",this.values.hsl),this},whiten:function(e){return this.values.hwb[1]+=this.values.hwb[1]*e,this.setValues("hwb",this.values.hwb),this},blacken:function(e){return this.values.hwb[2]+=this.values.hwb[2]*e,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){return this.setValues("alpha",this.values.alpha-this.values.alpha*e),this},opaquer:function(e){return this.setValues("alpha",this.values.alpha+this.values.alpha*e),this},rotate:function(e){var t=this.values.hsl[0];return t=(t=(t+e)%360)<0?360+t:t,this.values.hsl[0]=t,this.setValues("hsl",this.values.hsl),this},mix:function(e,t){var n=this,r=e,i=void 0===t?.5:t,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,u=1-s;return this.rgb(s*n.red()+u*r.red(),s*n.green()+u*r.green(),s*n.blue()+u*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var e=new a;return e.values=r(this.values),e}},a.prototype.getValues=function(e){for(var t={},n=0;n-1};function c(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!==typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=h(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"===typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"===typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=h(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function x(e){var t=new d;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t}function k(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},k.error=function(){var e=new k(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];k.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new k(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(A){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise((function(r,o){var a=new b(e,n);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:x(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;r(new k(t,e))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send("undefined"===typeof a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=d,e.Request=b,e.Response=k),t.Headers=d,t.Request=b,t.Response=k,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},43672:function(e){var t=1e3,n=60*t,r=60*n,i=24*r,o=7*i,a=365.25*i;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,u){u=u||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var u=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*r;case"minutes":case"minute":case"mins":case"min":case"m":return u*n;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(e);if("number"===c&&isFinite(e))return u.long?function(e){var o=Math.abs(e);if(o>=i)return s(e,o,i,"day");if(o>=r)return s(e,o,r,"hour");if(o>=n)return s(e,o,n,"minute");if(o>=t)return s(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=i)return Math.round(e/i)+"d";if(o>=r)return Math.round(e/r)+"h";if(o>=n)return Math.round(e/n)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},44054:function(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(n){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(n){}!e&&"undefined"!==typeof process&&"env"in process&&(e={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CHAIN_ID:"1313161554",REACT_APP_NETWORK_ID:"1",REACT_APP_NETWORK_URL:"https://mainnet.aurora.dev/"}.DEBUG);return e},t.useColors=function(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=function(){var e=!1;return function(){e||(e=!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`."))}}(),t.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"],t.log=console.debug||console.log||function(){},e.exports=n(87175)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},87175:function(e,t,n){var r=n(861).default;e.exports=function(e){function t(e){var n,r,o,a=null;function s(){for(var e=arguments.length,r=new Array(e),i=0;i(s=(a=Math.ceil(d/m))>s?a+1:s+1)&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for((s=c.length)-(o=l.length)<0&&(o=s,r=l,l=c,c=r),n=0;o;)n=(c[--o]=c[o]+l[o]+n)/v|0,c[o]%=v;for(n&&(c.unshift(n),++i),s=c.length;0==c[--s];)c.pop();return t.d=c,t.e=i,u?C(t,d):t}function x(e,t,n){if(e!==~~e||en)throw Error(l+e)}function k(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;te.e^o.s<0?1:-1;for(t=0,n=(r=o.d.length)<(i=e.d.length)?r:i;te.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1},b.decimalPlaces=b.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*m;if(t=e.d[t])for(;t%10==0;t/=10)n--;return n<0?0:n},b.dividedBy=b.div=function(e){return _(this,new this.constructor(e))},b.dividedToIntegerBy=b.idiv=function(e){var t=this.constructor;return C(_(this,new t(e),0,1),t.precision)},b.equals=b.eq=function(e){return!this.cmp(e)},b.exponent=function(){return A(this)},b.greaterThan=b.gt=function(e){return this.cmp(e)>0},b.greaterThanOrEqualTo=b.gte=function(e){return this.cmp(e)>=0},b.isInteger=b.isint=function(){return this.e>this.d.length-2},b.isNegative=b.isneg=function(){return this.s<0},b.isPositive=b.ispos=function(){return this.s>0},b.isZero=function(){return 0===this.s},b.lessThan=b.lt=function(e){return this.cmp(e)<0},b.lessThanOrEqualTo=b.lte=function(e){return this.cmp(e)<1},b.logarithm=b.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(void 0===e)e=new r(10);else if((e=new r(e)).s<1||e.eq(o))throw Error(c+"NaN");if(n.s<1)throw Error(c+(n.s?"NaN":"-Infinity"));return n.eq(o)?new r(0):(u=!1,t=_(T(n,a),T(e,a),a),u=!0,C(t,i))},b.minus=b.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?I(t,e):w(t,(e.s=-e.s,e))},b.modulo=b.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(!(e=new r(e)).s)throw Error(c+"NaN");return n.s?(u=!1,t=_(n,e,0,1).times(e),u=!0,n.minus(t)):C(new r(n),i)},b.naturalExponential=b.exp=function(){return E(this)},b.naturalLogarithm=b.ln=function(){return T(this)},b.negated=b.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},b.plus=b.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?w(t,e):I(t,(e.s=-e.s,e))},b.precision=b.sd=function(e){var t,n,r,i=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(l+e);if(t=A(i)+1,n=(r=i.d.length-1)*m+1,r=i.d[r]){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},b.squareRoot=b.sqrt=function(){var e,t,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(c+"NaN")}for(e=A(s),u=!1,0==(i=Math.sqrt(+s))||i==1/0?(((t=k(s.d)).length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=d((e+1)/2)-(e<0||e%2),r=new l(t=i==1/0?"5e"+e:(t=i.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new l(i.toString()),i=a=(n=l.precision)+3;;)if(r=(o=r).plus(_(s,o,a+2)).times(.5),k(o.d).slice(0,a)===(t=k(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&"4999"==t){if(C(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if("9999"!=t)break;a+=4}return u=!0,C(r,n)},b.times=b.mul=function(e){var t,n,r,i,o,a,s,c,l,f=this,d=f.constructor,p=f.d,h=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,n=f.e+e.e,(c=p.length)<(l=h.length)&&(o=p,p=h,h=o,a=c,c=l,l=a),o=[],r=a=c+l;r--;)o.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)s=o[i]+h[r]*p[i-r-1]+t,o[i--]=s%v|0,t=s/v|0;o[i]=(o[i]+t)%v|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,u?C(e,d.precision):e},b.toDecimalPlaces=b.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(x(e,0,a),void 0===t?t=r.rounding:x(t,0,8),C(n,e+A(n)+1,t))},b.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=R(r,!0):(x(e,0,a),void 0===t?t=i.rounding:x(t,0,8),n=R(r=C(new i(r),e+1,t),!0,e+1)),n},b.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?R(i):(x(e,0,a),void 0===t?t=o.rounding:x(t,0,8),n=R((r=C(new o(i),e+A(i)+1,t)).abs(),!1,e+A(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)},b.toInteger=b.toint=function(){var e=this,t=e.constructor;return C(new t(e),A(e)+1,t.rounding)},b.toNumber=function(){return+this},b.toPower=b.pow=function(e){var t,n,r,i,a,s,l=this,f=l.constructor,p=+(e=new f(e));if(!e.s)return new f(o);if(!(l=new f(l)).s){if(e.s<1)throw Error(c+"Infinity");return l}if(l.eq(o))return l;if(r=f.precision,e.eq(o))return C(l,r);if(s=(t=e.e)>=(n=e.d.length-1),a=l.s,s){if((n=p<0?-p:p)<=g){for(i=new f(o),t=Math.ceil(r/m+4),u=!1;n%2&&j((i=i.times(l)).d,t),0!==(n=d(n/2));)j((l=l.times(l)).d,t);return u=!0,e.s<0?new f(o).div(i):C(i,r)}}else if(a<0)throw Error(c+"NaN");return a=a<0&&1&e.d[Math.max(t,n)]?-1:1,l.s=1,u=!1,i=e.times(T(l,r+12)),u=!0,(i=E(i)).s=a,i},b.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?r=R(i,(n=A(i))<=o.toExpNeg||n>=o.toExpPos):(x(e,1,a),void 0===t?t=o.rounding:x(t,0,8),r=R(i=C(new o(i),e,t),e<=(n=A(i))||n<=o.toExpNeg,e)),r},b.toSignificantDigits=b.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(x(e,1,a),void 0===t?t=n.rounding:x(t,0,8)),C(new n(this),e,t)},b.toString=b.valueOf=b.val=b.toJSON=function(){var e=this,t=A(e),n=e.constructor;return R(e,t<=n.toExpNeg||t>=n.toExpPos)};var _=function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%v|0,r=n/v|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]1;)e.shift()}return function(r,i,o,a){var s,u,l,f,d,p,h,g,y,b,w,x,k,_,E,S,O,T,P=r.constructor,I=r.s==i.s?1:-1,R=r.d,j=i.d;if(!r.s)return new P(r);if(!i.s)throw Error(c+"Division by zero");for(u=r.e-i.e,O=j.length,E=R.length,g=(h=new P(I)).d=[],l=0;j[l]==(R[l]||0);)++l;if(j[l]>(R[l]||0)&&--u,(x=null==o?o=P.precision:a?o+(A(r)-A(i))+1:o)<0)return new P(0);if(x=x/m+2|0,l=0,1==O)for(f=0,j=j[0],x++;(l1&&(j=e(j,f),R=e(R,f),O=j.length,E=R.length),_=O,b=(y=R.slice(0,O)).length;b=v/2&&++S;do{f=0,(s=t(j,y,O,b))<0?(w=y[0],O!=b&&(w=w*v+(y[1]||0)),(f=w/S|0)>1?(f>=v&&(f=v-1),1==(s=t(d=e(j,f),y,p=d.length,b=y.length))&&(f--,n(d,O16)throw Error(f+A(e));if(!e.s)return new d(o);for(null==t?(u=!1,s=h):s=t,a=new d(.03125);e.abs().gte(.1);)e=e.times(a),l+=5;for(s+=Math.log(p(2,l))/Math.LN10*2+5|0,n=r=i=new d(o),d.precision=s;;){if(r=C(r.times(e),s),n=n.times(++c),k((a=i.plus(_(r,n,s))).d).slice(0,s)===k(i.d).slice(0,s)){for(;l--;)i=C(i.times(i),s);return d.precision=h,null==t?(u=!0,C(i,h)):i}i=a}}function A(e){for(var t=e.e*m,n=e.d[0];n>=10;n/=10)t++;return t}function S(e,t,n){if(t>e.LN10.sd())throw u=!0,n&&(e.precision=n),Error(c+"LN10 precision limit exceeded");return C(new e(e.LN10),t)}function O(e){for(var t="";e--;)t+="0";return t}function T(e,t){var n,r,i,a,s,l,f,d,p,h=1,v=e,m=v.d,g=v.constructor,y=g.precision;if(v.s<1)throw Error(c+(v.s?"NaN":"-Infinity"));if(v.eq(o))return new g(0);if(null==t?(u=!1,d=y):d=t,v.eq(10))return null==t&&(u=!0),S(g,d);if(d+=10,g.precision=d,r=(n=k(m)).charAt(0),a=A(v),!(Math.abs(a)<15e14))return f=S(g,d+2,y).times(a+""),v=T(new g(r+"."+n.slice(1)),d-10).plus(f),g.precision=y,null==t?(u=!0,C(v,y)):v;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=k((v=v.times(e)).d)).charAt(0),h++;for(a=A(v),r>1?(v=new g("0."+n),a++):v=new g(r+"."+n.slice(1)),l=s=v=_(v.minus(o),v.plus(o),d),p=C(v.times(v),d),i=3;;){if(s=C(s.times(p),d),k((f=l.plus(_(s,new g(i),d))).d).slice(0,d)===k(l.d).slice(0,d))return l=l.times(2),0!==a&&(l=l.plus(S(g,d+2,y).times(a+""))),l=_(l,new g(h),d),g.precision=y,null==t?(u=!0,C(l,y)):l;l=f,i+=2}}function P(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(i=t.length;48===t.charCodeAt(i-1);)--i;if(t=t.slice(r,i)){if(i-=r,n=n-r-1,e.e=d(n/m),e.d=[],r=(n+1)%m,n<0&&(r+=m),ry||e.e<-y))throw Error(f+n)}else e.s=0,e.e=0,e.d=[0];return e}function C(e,t,n){var r,i,o,a,s,c,l,h,g=e.d;for(a=1,o=g[0];o>=10;o/=10)a++;if((r=t-a)<0)r+=m,i=t,l=g[h=0];else{if((h=Math.ceil((r+1)/m))>=(o=g.length))return e;for(l=o=g[h],a=1;o>=10;o/=10)a++;i=(r%=m)-m+a}if(void 0!==n&&(s=l/(o=p(10,a-i-1))%10|0,c=t<0||void 0!==g[h+1]||l%o,c=n<4?(s||c)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||c||6==n&&(r>0?i>0?l/p(10,a-i):0:g[h-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return c?(o=A(e),g.length=1,t=t-o-1,g[0]=p(10,(m-t%m)%m),e.e=d(-t/m)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(0==r?(g.length=h,o=1,h--):(g.length=h+1,o=p(10,m-r),g[h]=i>0?(l/p(10,a-i)%p(10,i)|0)*o:0),c)for(;;){if(0==h){(g[0]+=o)==v&&(g[0]=1,++e.e);break}if(g[h]+=o,g[h]!=v)break;g[h--]=0,o=1}for(r=g.length;0===g[--r];)g.pop();if(u&&(e.e>y||e.e<-y))throw Error(f+A(e));return e}function I(e,t){var n,r,i,o,a,s,c,l,f,d,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),u?C(t,h):t;if(c=e.d,d=t.d,r=t.e,l=e.e,c=c.slice(),a=l-r){for((f=a<0)?(n=c,a=-a,s=d.length):(n=d,r=l,s=c.length),a>(i=Math.max(Math.ceil(h/m),s)+2)&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for((f=(i=c.length)<(s=d.length))&&(s=i),i=0;i0;--i)c[s++]=0;for(i=d.length;i>a;){if(c[--i]0?o=o.charAt(0)+"."+o.slice(1)+O(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+O(-i-1)+o,n&&(r=n-a)>0&&(o+=O(r))):i>=a?(o+=O(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+O(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=O(r))),e.s<0?"-"+o:o}function j(e,t){if(e.length>t)return e.length=t,!0}function N(e){if(!e||"object"!==typeof e)throw Error(c+"Object expected");var t,n,r,i=["precision",1,a,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t=i[t+1]&&r<=i[t+2]))throw Error(l+n+": "+r);this[n]=r}if(void 0!==(r=e[n="LN10"])){if(r!=Math.LN10)throw Error(l+n+": "+r);this[n]=new this(r)}return this}s=function e(t){var n,r,i;function o(e){var t=this;if(!(t instanceof o))return new o(e);if(t.constructor=o,e instanceof o)return t.s=e.s,t.e=e.e,void(t.d=(e=e.d)?e.slice():e);if("number"===typeof e){if(0*e!==0)throw Error(l+e);if(e>0)t.s=1;else{if(!(e<0))return t.s=0,t.e=0,void(t.d=[0]);e=-e,t.s=-1}return e===~~e&&e<1e7?(t.e=0,void(t.d=[e])):P(t,e.toString())}if("string"!==typeof e)throw Error(l+e);if(45===e.charCodeAt(0)?(e=e.slice(1),t.s=-1):t.s=1,!h.test(e))throw Error(l+e);P(t,e)}if(o.prototype=b,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=e,o.config=o.set=N,void 0===t&&(t={}),t)for(i=["precision","rounding","toExpNeg","toExpPos","LN10"],n=0;n0||this._maybeEnd()}},{key:"_maybeStart",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isRunning){e.next=2;break}return e.abrupt("return");case 2:return this._isRunning=!0,this._cancelBlockResetTimeout(),e.next=6,this._start();case 6:this.emit("_started");case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_maybeEnd",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._isRunning){e.next=2;break}return e.abrupt("return");case 2:return this._isRunning=!1,this._setupBlockResetTimeout(),e.next=6,this._end();case 6:this.emit("_ended");case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_getBlockTrackerEventCount",value:function(){var e=this;return v.map((function(t){return e.listenerCount(t)})).reduce(h)}},{key:"_newPotentialLatest",value:function(e){var t=this._currentBlock;t&&g(e)<=g(t)||this._setCurrentBlock(e)}},{key:"_setCurrentBlock",value:function(e){var t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}},{key:"_setupBlockResetTimeout",value:function(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}},{key:"_cancelBlockResetTimeout",value:function(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}},{key:"_resetCurrentBlock",value:function(){this._currentBlock=null}}]),n}(p.default);function g(e){return Number.parseInt(e,16)}t.BaseBlockTracker=m},82956:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default,s=n(61655).default,u=n(26389).default,c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PollingBlockTracker=void 0;var l=c(n(39702)),f=c(n(32768)),d=n(27753),p=n(41098),h=(0,p.createModuleLogger)(p.projectLogger,"polling-block-tracker"),v=(0,l.default)(),m=function(e){s(n,e);var t=u(n);function n(){var e,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,n),!i.provider)throw new Error("PollingBlockTracker - no provider specified.");return(e=t.call(this,{blockResetDuration:null!==(r=i.blockResetDuration)&&void 0!==r?r:i.pollingInterval}))._provider=i.provider,e._pollingInterval=i.pollingInterval||2e4,e._retryTimeout=i.retryTimeout||e._pollingInterval/10,e._keepEventLoopActive=void 0===i.keepEventLoopActive||i.keepEventLoopActive,e._setSkipCacheFlag=i.setSkipCacheFlag||!1,e}return a(n,[{key:"checkForLatestBlock",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._updateLatestBlock();case 2:return e.next=4,this.getLatestBlock();case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_start",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._synchronize();case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_end",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"_synchronize",value:function(){var e=i(r().mark((function e(){var t,n,i,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isRunning){e.next=20;break}return e.prev=1,e.next=4,this._updateLatestBlock();case 4:return n=g(this._pollingInterval,!this._keepEventLoopActive),this.emit("_waitingForNextIteration"),e.next=8,n;case 8:e.next=18;break;case 10:e.prev=10,e.t0=e.catch(1),i=new Error("PollingBlockTracker - encountered an error while attempting to update latest block:\n".concat(null!==(t=e.t0.stack)&&void 0!==t?t:e.t0));try{this.emit("error",i)}catch(r){console.error(i)}return o=g(this._retryTimeout,!this._keepEventLoopActive),this.emit("_waitingForNextIteration"),e.next=18,o;case 18:e.next=0;break;case 20:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"_updateLatestBlock",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchLatestBlock();case 2:t=e.sent,this._newPotentialLatest(t);case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_fetchLatestBlock",value:function(){var e=i(r().mark((function e(){var t,n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={jsonrpc:"2.0",id:v(),method:"eth_blockNumber",params:[]},this._setSkipCacheFlag&&(t.skipCache=!0),h("Making request",t),e.next=5,(0,f.default)((function(e){return i._provider.sendAsync(t,e)}))();case 5:if(n=e.sent,h("Got response",n),!n.error){e.next=9;break}throw new Error("PollingBlockTracker - encountered error fetching block:\n".concat(n.error.message));case 9:return e.abrupt("return",n.result);case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),n}(d.BaseBlockTracker);function g(e,t){return new Promise((function(n){var r=setTimeout(n,e);r.unref&&t&&r.unref()}))}t.PollingBlockTracker=m},33996:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default,s=n(61655).default,u=n(26389).default,c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SubscribeBlockTracker=void 0;var l=c(n(39702)),f=n(27753),d=(0,l.default)(),p=function(e){s(n,e);var t=u(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,n),!r.provider)throw new Error("SubscribeBlockTracker - no provider specified.");return(e=t.call(this,r))._provider=r.provider,e._subscriptionId=null,e}return a(n,[{key:"checkForLatestBlock",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getLatestBlock();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"_start",value:function(){var e=i(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==this._subscriptionId&&null!==this._subscriptionId){e.next=15;break}return e.prev=1,e.next=4,this._call("eth_blockNumber");case 4:return t=e.sent,e.next=7,this._call("eth_subscribe","newHeads");case 7:this._subscriptionId=e.sent,this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),this.emit("error",e.t0);case 15:case"end":return e.stop()}}),e,this,[[1,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"_end",value:function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this._subscriptionId||void 0===this._subscriptionId){e.next=10;break}return e.prev=1,e.next=4,this._call("eth_unsubscribe",this._subscriptionId);case 4:this._subscriptionId=null,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),this.emit("error",e.t0);case 10:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(){return e.apply(this,arguments)}}()},{key:"_call",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i0?t.on("sync",w):n>0&&0===r&&t.removeListener("sync",w)}}},61409:function(e,t,n){var r=n(17061).default,i=n(17156).default,o=n(56690).default,a=n(89728).default,s=n(61655).default,u=n(26389).default,c=n(78630),l=n(94492),f=n(24424),d=n(15261),p=(d.bnToHex,d.hexToInt),h=d.incrementHexInt,v=d.minBlockRef,m=d.blockRefIsNumber,g=function(e){"use strict";s(n,e);var t=u(n);function n(e){var r,i=e.provider,a=e.params;return o(this,n),(r=t.call(this)).type="log",r.ethQuery=new c(i),r.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},a),r.params.address&&(Array.isArray(r.params.address)||(r.params.address=[r.params.address]),r.params.address=r.params.address.map((function(e){return e.toLowerCase()}))),r}return a(n,[{key:"initialize",value:function(){var e=i(r().mark((function e(t){var n,i,o,a,s;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.currentBlock,i=this.params.fromBlock,["latest","pending"].includes(i)&&(i=n),"earliest"===i&&(i="0x0"),this.params.fromBlock=i,o=v(this.params.toBlock,n),a=Object.assign({},this.params,{toBlock:o}),e.next=9,this._fetchLogs(a);case 9:s=e.sent,this.addInitialResults(s);case 11:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"update",value:function(){var e=i(r().mark((function e(t){var n,i,o,a,s,u,c,l=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.oldBlock,i=t.newBlock,o=i,a=n?h(n):i,s=Object.assign({},this.params,{fromBlock:a,toBlock:o}),e.next=6,this._fetchLogs(s);case 6:u=e.sent,c=u.filter((function(e){return l.matchLog(e)})),this.addResults(c);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_fetchLogs",value:function(){var e=i(r().mark((function e(t){var n,i=this;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l((function(e){return i.ethQuery.getLogs(t,e)}))();case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"matchLog",value:function(e){if(p(this.params.fromBlock)>=p(e.blockNumber))return!1;if(m(this.params.toBlock)&&p(this.params.toBlock)<=p(e.blockNumber))return!1;var t=e.address&&e.address.toLowerCase();return!(this.params.address&&t&&!this.params.address.includes(t))&&this.params.topics.every((function(t,n){var r=e.topics[n];if(!r)return!1;r=r.toLowerCase();var i=Array.isArray(t)?t:[t];return!!i.includes(null)||(i=i.map((function(e){return e.toLowerCase()}))).includes(r)}))}}]),n}(f);e.exports=g},94492:function(e,t,n){"use strict";var r=n(42122).default,i=function(e,t,n,r){return function(){for(var i=this,o=arguments.length,a=new Array(o),s=0;s=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return t.call(this,e,i,o)}return i(n)}(c);function f(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=l},1479:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},71846:function(e,t,n){"use strict";var r=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;var i=n(44409),o=n(17638),a=n(1479);function s(e,t){var n=c(t),a=r(n,2),s=a[0],u=a[1];return new i.EthereumRpcError(e,s||o.getMessageFromCode(e),u)}function u(e,t){var n=c(t),a=r(n,2),s=a[0],u=a[1];return new i.EthereumProviderError(e,s||o.getMessageFromCode(e),u)}function c(e){if(e){if("string"===typeof e)return[e];if("object"===typeof e&&!Array.isArray(e)){var t=e.message,n=e.data;if(t&&"string"!==typeof t)throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}t.ethErrors={rpc:{parse:function(e){return s(a.errorCodes.rpc.parse,e)},invalidRequest:function(e){return s(a.errorCodes.rpc.invalidRequest,e)},invalidParams:function(e){return s(a.errorCodes.rpc.invalidParams,e)},methodNotFound:function(e){return s(a.errorCodes.rpc.methodNotFound,e)},internal:function(e){return s(a.errorCodes.rpc.internal,e)},server:function(e){if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");var t=e.code;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:function(e){return s(a.errorCodes.rpc.invalidInput,e)},resourceNotFound:function(e){return s(a.errorCodes.rpc.resourceNotFound,e)},resourceUnavailable:function(e){return s(a.errorCodes.rpc.resourceUnavailable,e)},transactionRejected:function(e){return s(a.errorCodes.rpc.transactionRejected,e)},methodNotSupported:function(e){return s(a.errorCodes.rpc.methodNotSupported,e)},limitExceeded:function(e){return s(a.errorCodes.rpc.limitExceeded,e)}},provider:{userRejectedRequest:function(e){return u(a.errorCodes.provider.userRejectedRequest,e)},unauthorized:function(e){return u(a.errorCodes.provider.unauthorized,e)},unsupportedMethod:function(e){return u(a.errorCodes.provider.unsupportedMethod,e)},disconnected:function(e){return u(a.errorCodes.provider.disconnected,e)},chainDisconnected:function(e){return u(a.errorCodes.provider.chainDisconnected,e)},custom:function(e){if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");var t=e.code,n=e.message,r=e.data;if(!n||"string"!==typeof n)throw new Error('"message" must be a nonempty string');return new i.EthereumProviderError(t,n,r)}}}},98689:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;var r=n(44409);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});var i=n(17638);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return i.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}});var o=n(71846);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});var a=n(1479);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})},17638:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var r=n(1479),i=n(44409),o=r.errorCodes.rpc.internal,a="Unspecified error message. This is a bug, please report it.",s={code:o,message:u(o)};function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;if(Number.isInteger(e)){var i=e.toString();if(d(r.errorValues,i))return r.errorValues[i].message;if(l(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function c(e){if(!Number.isInteger(e))return!1;var t=e.toString();return!!r.errorValues[t]||!!l(e)}function l(e){return e>=-32099&&e<=-32e3}function f(e){return e&&"object"===typeof e&&!Array.isArray(e)?Object.assign({},e):e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=u,t.isValidCode=c,t.serializeError=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.fallbackError,a=void 0===o?s:o,l=r.shouldIncludeStack,p=void 0!==l&&l;if(!a||!Number.isInteger(a.code)||"string"!==typeof a.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();var h={};if(e&&"object"===typeof e&&!Array.isArray(e)&&d(e,"code")&&c(e.code)){var v=e;h.code=v.code,v.message&&"string"===typeof v.message?(h.message=v.message,d(v,"data")&&(h.data=v.data)):(h.message=u(h.code),h.data={originalError:f(e)})}else{h.code=a.code;var m=null===(t=e)||void 0===t?void 0:t.message;h.message=m&&"string"===typeof m?m:a.message,h.data={originalError:f(e)}}var g=null===(n=e)||void 0===n?void 0:n.stack;return p&&e&&g&&"string"===typeof g&&(h.stack=g),h}},20548:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!==typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,c=l,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function d(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"===typeof u)r(u,this,t);else{var c=u.length,l=h(u,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},89806:function(e){"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!==i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!==i--;){var a=o[i];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}},8461:function(e){"use strict";e.exports=function(e,t){t||(t={}),"function"===typeof t&&(t={cmp:t});var n,r="boolean"===typeof t.cycles&&t.cycles,i=t.cmp&&(n=t.cmp,function(e){return function(t,r){var i={key:t,value:e[t]},o={key:r,value:e[r]};return n(i,o)}}),o=[];return function e(t){if(t&&t.toJSON&&"function"===typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!==typeof t)return JSON.stringify(t);var n,a;if(Array.isArray(t)){for(a="[",n=0;nl.depthLimit)return void s(t,e,r,a);if("undefined"!==typeof l.edgesLimit&&i+1>l.edgesLimit)return void s(t,e,r,a);if(o.push(e),Array.isArray(e))for(f=0;ft?1:0}function l(e,t,n,a){"undefined"===typeof a&&(a=o());var s,u=f(e,"",0,[],void 0,0,a)||e;try{s=0===i.length?JSON.stringify(u,t,n):JSON.stringify(u,d(t),n)}catch(l){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function f(e,i,o,a,u,l,d){var p;if(l+=1,"object"===typeof e&&null!==e){for(p=0;pd.depthLimit)return void s(t,e,i,u);if("undefined"!==typeof d.edgesLimit&&o+1>d.edgesLimit)return void s(t,e,i,u);if(a.push(e),Array.isArray(e))for(p=0;p0)for(var r=0;r=3&&(a=n),"[object Array]"===i.call(e)?function(e,t,n){for(var r=0,i=e.length;r1&&"boolean"!==typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===S(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=A(e,0,1),n=A(e,-1);if("%"===t&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return E(e,O,(function(e,t,n,i){r[r.length]=n?E(i,T,"$1"):t||e})),r}(e),r=n.length>0?n[0]:"",o=P("%"+r+"%",t),s=o.name,c=o.value,l=!1,f=o.alias;f&&(r=f[0],_(n,k([0,1],f)));for(var d=1,p=!0;d=n.length){var y=u(c,h);c=(p=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[h]}else p=x(c,h),c=c[h];p&&!l&&(m[s]=c)}}return c}},56103:function(e,t,n){"use strict";var r=n(28476)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(i){r=null}e.exports=r},87593:function(e){"use strict";var t={foo:{}},n=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof n)}},95520:function(e,t,n){"use strict";var r="undefined"!==typeof Symbol&&Symbol,i=n(80541);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&i())))}},80541:function(e){"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},48857:function(e,t,n){"use strict";var r=n(80541);e.exports=function(){return r()&&!!Symbol.toStringTag}},37838:function(e,t,n){"use strict";var r=n(1199);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},37553:function(e,t,n){var r=t;r.utils=n(67657),r.common=n(43345),r.sha=n(90395),r.ripemd=n(85751),r.hmac=n(79161),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},43345:function(e,t,n){"use strict";var r=n(67657),i=n(65701);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},67657:function(e,t,n){"use strict";var r=n(65701),i=n(80273);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i>6|192,n[r++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,o,a,s){var u=0,c=t;return u+=(c=c+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0},t.sum64_5_hi=function(e,t,n,r,i,o,a,s,u,c){var l=0,f=t;return l+=(f=f+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,i,o,a,s,u,c){return t+r+o+s+c>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},67861:function(e,t,n){"use strict";var r=n(96214),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(h){var i=p(n);i&&i!==h&&e(t,i,r)}var a=l(n);f&&(a=a.concat(f(n)));for(var s=u(t),v=u(n),m=0;m>1,l=-7,f=n?i-1:0,d=n?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=h,a/=256,c-=8);e[n+p-h]|=128*v}},80273:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},95021:function(e,t,n){"use strict";var r=n(48857)(),i=n(44680)("Object.prototype.toString"),o=function(e){return!(r&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},8866:function(e){"use strict";var t,n,r=Function.prototype.toString,i="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof i&&"function"===typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},i((function(){throw 42}),null,t)}catch(p){p!==n&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(e){try{var t=r.call(e);return o.test(t)}catch(n){return!1}},s=function(e){try{return!a(e)&&(r.call(e),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"===typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"===typeof document){var d=document.all;u.call(d)===u.call(document.all)&&(f=function(e){if((l||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(n){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{i(e,null,t)}catch(r){if(r!==n)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(c)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},7469:function(e,t,n){"use strict";var r,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=n(48857)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!==typeof e)return!1;if(a.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if("undefined"===typeof r){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&u(t)}return u(e)===r}},72105:function(e,t,n){"use strict";var r=n(45767),i=n(93645),o=n(44680),a=o("Object.prototype.toString"),s=n(48857)(),u=n(56103),c="undefined"===typeof globalThis?n.g:globalThis,l=i(),f=o("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n-1}return!!u&&function(e){var t=!1;return r(p,(function(n,r){if(!t)try{t=n.call(e)===r}catch(i){}})),t}(e)}},14593:function(e){e.exports=["#01888C","#FC7500","#034F5D","#F73F01","#FC1960","#C7144C","#F3C100","#1598F2","#2465E1","#F19E02"]},619:function(e,t,n){var r,i=n(6346),o=n(47668),a=n(32901),s=n(14593);function u(e,t,n,i,o){var a=e.rect(0,0,n,n);a.rotate(360*r.random());var s=n/o*r.random()+i*n/o;a.translate(s),a.rotate(180*r.random()),a.attr("fill",c(t)),a.attr("stroke","none")}function c(e){r.random();var t=Math.floor(e.length*r.random());return e.splice(t,1)[0]}e.exports=function(e,t){r=new i(t);var n=o(e),f=n.paper,d=n.container,p=function(e,t){var n=30*t.random()-l/2;return e.map((function(e){var t=a(e);return t.rotate(n),t.hexString()}))}(s.slice(),r),h=f.rect(0,0,e,e);h.attr("fill",c(p)),h.attr("stroke","none");for(var v=0;v<3;v++)u(f,p,e,v,3);return d};var l=30},47668:function(e,t,n){var r=n(67983);e.exports=function(e){var t=document.createElement("div");return t.style.borderRadius="50px",t.style.overflow="hidden",t.style.padding="0px",t.style.margin="0px",t.style.width=e+"px",t.style.height=e+"px",t.style.display="inline-block",{paper:r(t,100,100),container:t}}},37676:function(e,t,n){var r;!function(){"use strict";var i="input is invalid type",o="object"===typeof window,a=o?window:{};a.JS_SHA3_NO_WINDOW&&(o=!1);var s=!o&&"object"===typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node?a=n.g:s&&(a=self);var u=!a.JS_SHA3_NO_COMMON_JS&&e.exports,c=n.amdO,l=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),d=[4,1024,262144,67108864],p=[0,8,16,24],h=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],m=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],y={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var b=function(e,t,n){return function(r){return new N(e,t,e).update(r)[n]()}},w=function(e,t,n){return function(r,i){return new N(e,t,i).update(r)[n]()}},x=function(e,t,n){return function(t,r,i,o){return S["cshake"+e].update(t,r,i,o)[n]()}},k=function(e,t,n){return function(t,r,i,o){return S["kmac"+e].update(t,r,i,o)[n]()}},_=function(e,t,n,r){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function M(e,t,n){N.call(this,e,t,n)}N.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var r,o,a=this.blocks,s=this.byteCount,u=e.length,c=this.blockCount,f=0,d=this.s;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[r>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=s){for(this.start=r-s,this.block=a[c],r=0;r>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},N.prototype.encodeString=function(e){var t,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}var r=0,o=e.length;if(t)r=o;else for(var a=0;a=57344?r+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),r+=4)}return r+=this.encode(8*r),this.update(e),r},N.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];a%t===0&&(L(n),o=0)}return i&&(e=n[o],s+=f[e>>4&15]+f[15&e],i>1&&(s+=f[e>>12&15]+f[e>>8&15]),i>2&&(s+=f[e>>20&15]+f[e>>16&15])),s},N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%n===0&&L(r)}return o&&(e=s<<2,t=r[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},M.prototype=new N,M.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var L=function(e){var t,n,r,i,o,a,s,u,c,l,f,d,p,v,m,g,y,b,w,x,k,_,E,A,S,O,T,P,C,I,R,j,N,M,L,U,D,B,F,Z,z,H,q,V,W,G,Y,K,J,Q,X,$,ee,te,ne,re,ie,oe,ae,se,ue,ce,le;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),n=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(u<<1|c>>>31),n=o^(c<<1|u>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=a^(l<<1|f>>>31),n=s^(f<<1|l>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=u^(d<<1|p>>>31),n=c^(p<<1|d>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=l^(i<<1|o>>>31),n=f^(o<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,v=e[0],m=e[1],G=e[11]<<4|e[10]>>>28,Y=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,C=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,q=e[41]<<18|e[40]>>>14,M=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,g=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,K=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Q=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,j=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,O=e[18]<<20|e[19]>>>12,T=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,Z=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,E=e[49]<<14|e[48]>>>18,e[0]=v^~g&b,e[1]=m^~y&w,e[10]=A^~O&P,e[11]=S^~T&C,e[20]=M^~U&B,e[21]=L^~D&F,e[30]=V^~G&K,e[31]=W^~Y&J,e[40]=te^~re&oe,e[41]=ne^~ie&ae,e[2]=g^~b&x,e[3]=y^~w&k,e[12]=O^~P&I,e[13]=T^~C&R,e[22]=U^~B&Z,e[23]=D^~F&z,e[32]=G^~K&Q,e[33]=Y^~J&X,e[42]=re^~oe&se,e[43]=ie^~ae&ue,e[4]=b^~x&_,e[5]=w^~k&E,e[14]=P^~I&j,e[15]=C^~R&N,e[24]=B^~Z&H,e[25]=F^~z&q,e[34]=K^~Q&$,e[35]=J^~X&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&le,e[6]=x^~_&v,e[7]=k^~E&m,e[16]=I^~j&A,e[17]=R^~N&S,e[26]=Z^~H&M,e[27]=z^~q&L,e[36]=Q^~$&V,e[37]=X^~ee&W,e[46]=se^~ce&te,e[47]=ue^~le&ne,e[8]=_^~v&g,e[9]=E^~m&y,e[18]=j^~A&O,e[19]=N^~S&T,e[28]=H^~M&U,e[29]=q^~L&D,e[38]=$^~V&G,e[39]=ee^~W&Y,e[48]=ce^~te&re,e[49]=le^~ne&ie,e[0]^=h[r],e[1]^=h[r+1]};if(u)e.exports=S;else{for(T=0;Tc.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return a(r)}return o(c,[{key:"toDebugString",value:function(){var e,t=["BigInt["],n=r(this);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.push((i?(i>>>0).toString(16):i)+", ")}}catch(o){n.e(o)}finally{n.f()}return t.push("]"),t.join("")}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;if(2>e||36this.length&&(n=this.length);for(var r=32767&e,i=e>>>15,o=0,a=t,s=0;s>>15,d=c.__imul(l,r),p=c.__imul(l,i),h=c.__imul(f,r),v=a+d+o;o=v>>>30,v&=1073741823,o+=(v+=((32767&p)<<15)+((32767&h)<<15))>>>30,a=c.__imul(f,i)+(p>>>15)+(h>>>15),this.__setDigit(s,1073741823&v)}if(0!=o||0!==a)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(e,t,n){for(var r=0,i=0;i>>15,this.__setHalfDigit(t+i,32767&o)}return r}},{key:"__inplaceSub",value:function(e,t,n){var r=0;if(1&t){t>>=1;for(var i=this.__digit(t),o=32767&i,a=0;a>>1;a++){var s=e.__digit(a),u=(i>>>15)-(32767&s)-r;r=1&u>>>15,this.__setDigit(t+a,(32767&u)<<15|32767&o),r=1&(o=(32767&(i=this.__digit(t+a+1)))-(s>>>15)-r)>>>15}var c=e.__digit(a),l=(i>>>15)-(32767&c)-r;if(r=1&l>>>15,this.__setDigit(t+a,(32767&l)<<15|32767&o),t+a+1>=this.length)throw new RangeError("out of bounds");0==(1&n)&&(r=1&(o=(32767&(i=this.__digit(t+a+1)))-(c>>>15)-r)>>>15,this.__setDigit(t+e.length,1073709056&i|32767&o))}else{t>>=1;for(var f=0;f>>15)-(p>>>15)-(r=1&h>>>15);r=1&v>>>15,this.__setDigit(t+f,(32767&v)<<15|32767&h)}var m=this.__digit(t+f),g=e.__digit(f),y=(32767&m)-(32767&g)-r;r=1&y>>>15;var b=0;0==(1&n)&&(r=1&(b=(m>>>15)-(g>>>15)-r)>>>15),this.__setDigit(t+f,(32767&b)<<15|32767&y)}return r}},{key:"__inplaceRightShift",value:function(e){if(0!==e){for(var t=this.__digit(0)>>>e,n=this.length-1,r=0;r>>e}this.__setDigit(n,t)}}},{key:"__digit",value:function(e){return this[e]}},{key:"__unsignedDigit",value:function(e){return this[e]>>>0}},{key:"__setDigit",value:function(e,t){this[e]=0|t}},{key:"__setDigitGrow",value:function(e,t){this[e]=0|t}},{key:"__halfDigitLength",value:function(){var e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}},{key:"__halfDigit",value:function(e){return 32767&this[e>>>1]>>>15*(1&e)}},{key:"__setHalfDigit",value:function(e,t){var n=e>>>1,r=this.__digit(n),i=1&e?32767&r|t<<15:1073709056&r|32767&t;this.__setDigit(n,i)}}],[{key:"BigInt",value:function(e){var t=Number.isFinite;if("number"==typeof e){if(0===e)return c.__zero();if(c.__isOneDigitInt(e))return 0>e?c.__oneDigit(-e,!0):c.__oneDigit(e,!1);if(!t(e)||f(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return c.__fromDouble(e)}if("string"==typeof e){var n=c.__fromString(e);if(null===n)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return n}if("boolean"==typeof e)return!0===e?c.__oneDigit(1,!1):c.__zero();if("object"==typeof e){if(e.constructor===c)return e;var r=c.__toPrimitive(e);return c.BigInt(r)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(e){var t=e.length;if(0===t)return 0;if(1===t){var n=e.__unsignedDigit(0);return e.sign?-n:n}var r=e.__digit(t-1),i=c.__clz30(r),o=30*t-i;if(1024>>=12;var d=l-12,p=12<=l?0:s<<20+l,h=20+l;for(0>>30-d,p=s<>>30-h,h-=30;var v=c.__decideRounding(e,h,u,s);if((1===v||0===v&&1==(1&p))&&0===(p=p+1>>>0)&&0!=++f>>>20&&(f=0,1023<++a))return e.sign?-1/0:1/0;var m=e.sign?-2147483648:0;return a=a+1023<<20,c.__kBitConversionInts[1]=m|a|f,c.__kBitConversionInts[0]=p,c.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(e){if(0===e.length)return e;var t=e.__copy();return t.sign=!e.sign,t}},{key:"bitwiseNot",value:function(e){return e.sign?c.__absoluteSubOne(e).__trim():c.__absoluteAddOne(e,!0)}},{key:"exponentiate",value:function(e,t){if(t.sign)throw new RangeError("Exponent must be positive");if(0===t.length)return c.__oneDigit(1,!1);if(0===e.length)return e;if(1===e.length&&1===e.__digit(0))return e.sign&&0==(1&t.__digit(0))?c.unaryMinus(e):e;if(1=c.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===e.length&&2===e.__digit(0)){var r=1+(0|n/30),i=new c(r,e.sign&&0!=(1&n));i.__initializeDigits();var o=1<>=1;0!==n;n>>=1)s=c.multiply(s,s),0!=(1&n)&&(a=null===a?s:c.multiply(a,s));return a}},{key:"multiply",value:function(e,t){if(0===e.length)return e;if(0===t.length)return t;var n=e.length+t.length;30<=e.__clzmsd()+t.__clzmsd()&&n--;var r=new c(n,e.sign!==t.sign);r.__initializeDigits();for(var i=0;ic.__absoluteCompare(e,t))return c.__zero();var n,r=e.sign!==t.sign,i=t.__unsignedDigit(0);if(1===t.length&&32767>=i){if(1===i)return r===e.sign?e:c.unaryMinus(e);n=c.__absoluteDivSmall(e,i,null)}else n=c.__absoluteDivLarge(e,t,!0,!1);return n.sign=r,n.__trim()}},{key:"remainder",value:function(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>c.__absoluteCompare(e,t))return e;var n=t.__unsignedDigit(0);if(1===t.length&&32767>=n){if(1===n)return c.__zero();var r=c.__absoluteModSmall(e,n);return 0===r?c.__zero():c.__oneDigit(r,e.sign)}var i=c.__absoluteDivLarge(e,t,!1,!0);return i.sign=e.sign,i.__trim()}},{key:"add",value:function(e,t){var n=e.sign;return n===t.sign?c.__absoluteAdd(e,t,n):0<=c.__absoluteCompare(e,t)?c.__absoluteSub(e,t,n):c.__absoluteSub(t,e,!n)}},{key:"subtract",value:function(e,t){var n=e.sign;return n===t.sign?0<=c.__absoluteCompare(e,t)?c.__absoluteSub(e,t,n):c.__absoluteSub(t,e,!n):c.__absoluteAdd(e,t,n)}},{key:"leftShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?c.__rightShiftByAbsolute(e,t):c.__leftShiftByAbsolute(e,t)}},{key:"signedRightShift",value:function(e,t){return 0===t.length||0===e.length?e:t.sign?c.__leftShiftByAbsolute(e,t):c.__rightShiftByAbsolute(e,t)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(e,t){return 0>c.__compareToBigInt(e,t)}},{key:"lessThanOrEqual",value:function(e,t){return 0>=c.__compareToBigInt(e,t)}},{key:"greaterThan",value:function(e,t){return 0(e=f(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return c.__zero();if(e>=c.__kMaxLengthBits)return t;var n=0|(e+29)/30;if(t.length(e=f(e)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return c.__zero();if(t.sign){if(e>c.__kMaxLengthBits)throw new RangeError("BigInt too big");return c.__truncateAndSubFromPowerOfTwo(e,t,!1)}if(e>=c.__kMaxLengthBits)return t;var n=0|(e+29)/30;if(t.length>>r)return t}return c.__truncateToNBits(e,t)}},{key:"ADD",value:function(e,t){if(e=c.__toPrimitive(e),t=c.__toPrimitive(t),"string"==typeof e)return"string"!=typeof t&&(t=t.toString()),e+t;if("string"==typeof t)return e.toString()+t;if(e=c.__toNumeric(e),t=c.__toNumeric(t),c.__isBigInt(e)&&c.__isBigInt(t))return c.add(e,t);if("number"==typeof e&&"number"==typeof t)return e+t;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(e,t){return c.__compare(e,t,0)}},{key:"LE",value:function(e,t){return c.__compare(e,t,1)}},{key:"GT",value:function(e,t){return c.__compare(e,t,2)}},{key:"GE",value:function(e,t){return c.__compare(e,t,3)}},{key:"EQ",value:function(e,t){for(;;){if(c.__isBigInt(e))return c.__isBigInt(t)?c.equal(e,t):c.EQ(t,e);if("number"==typeof e){if(c.__isBigInt(t))return c.__equalToNumber(t,e);if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else if("string"==typeof e){if(c.__isBigInt(t))return null!==(e=c.__fromString(e))&&c.equal(e,t);if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else if("boolean"==typeof e){if(c.__isBigInt(t))return c.__equalToNumber(t,+e);if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else if("symbol"==typeof e){if(c.__isBigInt(t))return!1;if("object"!=typeof t)return e==t;t=c.__toPrimitive(t)}else{if("object"!=typeof e)return e==t;if("object"==typeof t&&t.constructor!==c)return e==t;e=c.__toPrimitive(e)}}}},{key:"NE",value:function(e,t){return!c.EQ(e,t)}},{key:"__zero",value:function(){return new c(0,!1)}},{key:"__oneDigit",value:function(e,t){var n=new c(1,t);return n.__setDigit(0,e),n}},{key:"__decideRounding",value:function(e,t,n,r){if(0t)i=-t-1;else{if(0===n)return-1;n--,r=e.__digit(n),i=29}var o=1<>>20)-1023,r=1+(0|n/30),i=new c(r,0>e),o=1048575&c.__kBitConversionInts[1]|1048576,a=c.__kBitConversionInts[0],s=20,u=n%30,l=0;if(20>u){var f=s-u;l=f+32,t=o>>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(20===u)l=32,t=o,o=a,a=0;else{var d=u-s;l=32-d,t=o<>>32-d,o=a<>>2,o=o<<30|a>>>2,a<<=30):t=0,i.__setDigit(p,t);return i.__trim()}},{key:"__isWhitespace",value:function(e){return!!(13>=e&&9<=e)||(159>=e?32==e:131071>=e?160==e||5760==e:196607>=e?10>=(e&=131071)||40==e||41==e||47==e||95==e||4096==e:65279==e)}},{key:"__fromString",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0,r=e.length,i=0;if(i===r)return c.__zero();for(var o=e.charCodeAt(i);c.__isWhitespace(o);){if(++i===r)return c.__zero();o=e.charCodeAt(i)}if(43===o){if(++i===r)return null;o=e.charCodeAt(i),n=1}else if(45===o){if(++i===r)return null;o=e.charCodeAt(i),n=-1}if(0===t){if(t=10,48===o){if(++i===r)return c.__zero();if(88===(o=e.charCodeAt(i))||120===o){if(t=16,++i===r)return null;o=e.charCodeAt(i)}else if(79===o||111===o){if(t=8,++i===r)return null;o=e.charCodeAt(i)}else if(66===o||98===o){if(t=2,++i===r)return null;o=e.charCodeAt(i)}}}else if(16===t&&48===o){if(++i===r)return c.__zero();if(88===(o=e.charCodeAt(i))||120===o){if(++i===r)return null;o=e.charCodeAt(i)}}if(0!=n&&10!==t)return null;for(;48===o;){if(++i===r)return c.__zero();o=e.charCodeAt(i)}var a=r-i,s=c.__kMaxBitsPerChar[t],u=c.__kBitsPerCharTableMultiplier-1;if(a>1073741824/s)return null;var l=new c(0|(29+(s*a+u>>>c.__kBitsPerCharTableShift))/30,!1),f=10>t?t:10,d=10>=c.__kBitsPerCharTableShift;var p=[],h=[],v=!1;do{for(var m=0,g=0;;){var y=void 0;if(o-48>>>0>>0>>0>>0>>c.__kBitsPerCharTableShift)/30;l.__inplaceMultiplyAdd(k,x,A)}while(!b)}if(i!==r){if(!c.__isWhitespace(o))return null;for(i++;i>>u-(o-=30))}if(0!==i){if(r>=e.length)throw new Error("implementation bug");e.__setDigit(r++,i)}for(;r>>1)+(85&r))>>>2)+(51&r))>>>4)+(15&r),o=t-1,a=e.__digit(n-1),s=0|(30*n-c.__clz30(a)+i-1)/i;if(e.sign&&s++,268435456>>m,d=30-m;d>=i;)u[l--]=c.__kConversionChars[f&o],f>>>=i,d-=i}var g=(f|a<>>i-d;0!==f;)u[l--]=c.__kConversionChars[f&o],f>>>=i;if(e.sign&&(u[l--]="-"),-1!=l)throw new Error("implementation bug");return u.join("")}},{key:"__toStringGeneric",value:function(e,t,n){var r=e.length;if(0===r)return"";if(1===r){var i=e.__unsignedDigit(0).toString(t);return!1===n&&e.sign&&(i="-"+i),i}var o,a,s=30*r-c.__clz30(e.__digit(r-1)),u=c.__kMaxBitsPerChar[t]-1,l=s*c.__kBitsPerCharTableMultiplier,f=1+(l=0|(l+=u-1)/u)>>1,d=c.exponentiate(c.__oneDigit(t,!1),c.__oneDigit(f,!1)),p=d.__unsignedDigit(0);if(1===d.length&&32767>=p){(o=new c(e.length,!1)).__initializeDigits();for(var h=0,v=2*e.length-1;0<=v;v--){var m=h<<15|e.__halfDigit(v);o.__setHalfDigit(v,0|m/p),h=0|m%p}a=h.toString(t)}else{var g=c.__absoluteDivLarge(e,d,!0,!0);o=g.quotient;var y=g.remainder.__trim();a=c.__toStringGeneric(y,t,!0)}o.__trim();for(var b=c.__toStringGeneric(o,t,!0);a.lengthr?c.__absoluteLess(n):0}},{key:"__compareToNumber",value:function(e,t){if(c.__isOneDigitInt(t)){var r=e.sign,i=0>t;if(r!==i)return c.__unequalSign(r);if(0===e.length){if(i)throw new Error("implementation bug");return 0===t?0:-1}if(1o?c.__absoluteGreater(r):at)return c.__unequalSign(n);if(0===t)throw new Error("implementation bug: should be handled elsewhere");if(0===e.length)return-1;c.__kBitConversionDouble[0]=t;var r=2047&c.__kBitConversionInts[1]>>>20;if(2047==r)throw new Error("implementation bug: handled elsewhere");var i=r-1023;if(0>i)return c.__absoluteGreater(n);var o=e.length,a=e.__digit(o-1),s=c.__clz30(a),u=30*o-s,l=i+1;if(ul)return c.__absoluteGreater(n);var f=1048576|1048575&c.__kBitConversionInts[1],d=c.__kBitConversionInts[0],p=20,h=29-s;if(h!==(0|(u-1)%30))throw new Error("implementation bug");var v,m=0;if(20>h){var g=p-h;m=g+32,v=f>>>g,f=f<<32-g|d>>>g,d<<=32-g}else if(20===h)m=32,v=f,f=d,d=0;else{var y=h-p;m=32-y,v=f<>>32-y,f=d<>>=0)>(v>>>=0))return c.__absoluteGreater(n);if(a>>2,f=f<<30|d>>>2,d<<=30):v=0;var w=e.__unsignedDigit(b);if(w>v)return c.__absoluteGreater(n);if(wt&&e.__unsignedDigit(0)===n(t):0===c.__compareToDouble(e,t)}},{key:"__comparisonResultToBool",value:function(e,t){return 0===t?0>e:1===t?0>=e:2===t?0t;case 3:return e>=t}if(c.__isBigInt(e)&&"string"==typeof t)return null!==(t=c.__fromString(t))&&c.__comparisonResultToBool(c.__compareToBigInt(e,t),n);if("string"==typeof e&&c.__isBigInt(t))return null!==(e=c.__fromString(e))&&c.__comparisonResultToBool(c.__compareToBigInt(e,t),n);if(e=c.__toNumeric(e),t=c.__toNumeric(t),c.__isBigInt(e)){if(c.__isBigInt(t))return c.__comparisonResultToBool(c.__compareToBigInt(e,t),n);if("number"!=typeof t)throw new Error("implementation bug");return c.__comparisonResultToBool(c.__compareToNumber(e,t),n)}if("number"!=typeof e)throw new Error("implementation bug");if(c.__isBigInt(t))return c.__comparisonResultToBool(c.__compareToNumber(t,e),2^n);if("number"!=typeof t)throw new Error("implementation bug");return 0===n?et:3===n?e>=t:void 0}},{key:"__absoluteAdd",value:function(e,t,n){if(e.length>>30,i.__setDigit(a,1073741823&s)}for(;a>>30,i.__setDigit(a,1073741823&u)}return a>>30,r.__setDigit(o,1073741823&a)}for(;o>>30,r.__setDigit(o,1073741823&s)}return r.__trim()}},{key:"__absoluteAddOne",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.length;null===n?n=new c(r,t):n.sign=t;for(var i=1,o=0;o>>30,n.__setDigit(o,1073741823&a)}return 0!=i&&n.__setDigitGrow(r,1),n}},{key:"__absoluteSubOne",value:function(e,t){for(var n=e.length,r=new c(t=t||n,!1),i=1,o=0;o>>30,r.__setDigit(o,1073741823&a)}if(0!=i)throw new Error("implementation bug");for(var s=n;s2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,o=i;if(r2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,o=i;r2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,o=i;if(r2&&void 0!==arguments[2]?arguments[2]:null,r=e.length,i=t.length,o=i;if(rr?0:e.__unsignedDigit(r)>t.__unsignedDigit(r)?1:-1}},{key:"__multiplyAccumulate",value:function(e,t,n,r){if(0!==t){for(var i,o=32767&t,a=t>>>15,s=0,u=0,l=0;l>>15,h=c.__imul(d,o),v=c.__imul(d,a),m=c.__imul(p,o);s=(i+=u+h+s)>>>30,i&=1073741823,s+=(i+=((32767&v)<<15)+((32767&m)<<15))>>>30,u=c.__imul(p,a)+(v>>>15)+(m>>>15),n.__setDigit(r,1073741823&i)}for(;0!=s||0!==u;r++){var g=n.__digit(r);g+=s+u,u=0,s=g>>>30,n.__setDigit(r,1073741823&g)}}}},{key:"__internalMultiplyAdd",value:function(e,t,n,r,i){for(var o=n,a=0,s=0;s>>15,t),d=l+((32767&f)<<15)+a+o;o=d>>>30,a=f>>>15,i.__setDigit(s,1073741823&d)}if(i.length>r)for(i.__setDigit(r++,o+a);r2&&void 0!==arguments[2]?arguments[2]:null;null===n&&(n=new c(e.length,!1));for(var r,i=0,o=2*e.length-1;0<=o;o-=2){var a=0|(r=(i<<15|e.__halfDigit(o))>>>0)/t,s=0|(r=((i=0|r%t)<<15|e.__halfDigit(o-1))>>>0)/t;i=0|r%t,n.__setDigit(o>>>1,a<<15|s)}return n}},{key:"__absoluteModSmall",value:function(e,t){for(var n=0,r=2*e.length-1;0<=r;r--)n=0|((n<<15|e.__halfDigit(r))>>>0)%t;return n}},{key:"__absoluteDivLarge",value:function(e,t,n,r){var i=t.__halfDigitLength(),o=t.length,a=e.__halfDigitLength()-i,s=null;n&&(s=new c(a+2>>>1,!1)).__initializeDigits();var u=new c(i+2>>>1,!1);u.__initializeDigits();var l=c.__clz15(t.__halfDigit(i-1));0>>0;f=0|g/p;for(var y=0|g%p,b=t.__halfDigit(i-2),w=d.__halfDigit(v+i-2);c.__imul(f,b)>>>0>(y<<16|w)>>>0&&(f--,!(32767<(y+=p))););}c.__internalMultiplyAdd(t,f,0,o,u);var x=d.__inplaceSub(u,v,i+1);0!==x&&(x=d.__inplaceAdd(t,v,i),d.__setHalfDigit(v+i,32767&d.__halfDigit(v+i)+x),f--),n&&(1&v?h=f<<15:s.__setDigit(v>>>1,h|f))}if(r)return d.__inplaceRightShift(l),n?{quotient:s,remainder:d}:d;if(n)return s;throw new Error("unreachable")}},{key:"__clz15",value:function(e){return c.__clz30(e)-15}},{key:"__specialLeftShift",value:function(e,t,n){var r=e.length,i=new c(r+n,!1);if(0===t){for(var o=0;o>>30-t}return 0n)throw new RangeError("BigInt too big");var r=0|n/30,i=n%30,o=e.length,a=0!==i&&0!=e.__digit(o-1)>>>30-i,s=o+r+(a?1:0),u=new c(s,e.sign);if(0===i){for(var l=0;l>>30-i}if(a)u.__setDigit(o+r,f);else if(0!==f)throw new Error("implementation bug")}return u.__trim()}},{key:"__rightShiftByAbsolute",value:function(e,t){var n=e.length,r=e.sign,i=c.__toShiftAmount(t);if(0>i)return c.__rightShiftByMaximum(r);var o=0|i/30,a=i%30,s=n-o;if(0>=s)return c.__rightShiftByMaximum(r);var u=!1;if(r)if(0!=(e.__digit(o)&(1<>>a,h=n-o-1,v=0;v>>a}f.__setDigit(h,p)}return u&&(f=c.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(e){return e?c.__oneDigit(1,!0):c.__zero()}},{key:"__toShiftAmount",value:function(e){if(1c.__kMaxLengthBits?-1:t}},{key:"__toPrimitive",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";if("object"!=typeof e)return e;if(e.constructor===c)return e;if("undefined"!=typeof Symbol&&"symbol"==typeof Symbol.toPrimitive){var n=e[Symbol.toPrimitive];if(n){var r=n(t);if("object"!=typeof r)return r;throw new TypeError("Cannot convert object to primitive value")}}var i=e.valueOf;if(i){var o=i.call(e);if("object"!=typeof o)return o}var a=e.toString;if(a){var s=a.call(e);if("object"!=typeof s)return s}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(e){return c.__isBigInt(e)?e:+e}},{key:"__isBigInt",value:function(e){return"object"==typeof e&&null!==e&&e.constructor===c}},{key:"__truncateToNBits",value:function(e,t){for(var n=0|(e+29)/30,r=new c(n,t.sign),i=n-1,o=0;o>>s}return r.__setDigit(i,a),r.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(e,t,n){for(var r=Math.min,i=0|(e+29)/30,o=new c(i,n),a=0,s=i-1,u=0,l=r(s,t.length);a>>30,o.__setDigit(a,1073741823&f)}for(;a>>v)-u,d&=m-1}return o.__setDigit(s,d),o.__trim()}},{key:"__digitPow",value:function(e,t){for(var n=1;0>>=1,e*=e;return n}},{key:"__isOneDigitInt",value:function(e){return(1073741823&e)===e}}]),c}(c(Array));return d.__kMaxLength=33554432,d.__kMaxLengthBits=d.__kMaxLength<<5,d.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],d.__kBitsPerCharTableShift=5,d.__kBitsPerCharTableMultiplier=1<>>0)/t)},d.__imul=e||function(e,t){return 0|e*t},d}()},40909:function(e,t,n){"use strict";var r=n(74704).default,i=n(17061).default,o=n(27424).default,a=n(17156).default,s=n(56690).default,u=n(89728).default,c=n(61655).default,l=n(26389).default,f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcEngine=void 0;var d=f(n(4609)),p=n(57666),h=function(e){c(n,e);var t=l(n);function n(){var e;return s(this,n),(e=t.call(this))._middleware=[],e}return u(n,[{key:"push",value:function(e){this._middleware.push(e)}},{key:"handle",value:function(e,t){if(t&&"function"!==typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}},{key:"asMiddleware",value:function(){var e=this;return function(){var t=a(i().mark((function t(r,s,u,c){var l,f,d,p,h;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n._runAllMiddleware(r,s,e._middleware);case 3:if(l=t.sent,f=o(l,3),d=f[0],p=f[1],h=f[2],!p){t.next=12;break}return t.next=11,n._runReturnHandlers(h);case 11:return t.abrupt("return",c(d));case 12:return t.abrupt("return",u(function(){var e=a(i().mark((function e(t){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n._runReturnHandlers(h);case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",t(e.t0));case 8:return e.abrupt("return",t());case 9:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}()));case 15:return t.prev=15,t.t0=t.catch(0),t.abrupt("return",c(t.t0));case 18:case"end":return t.stop()}}),t,null,[[0,15]])})));return function(e,n,r,i){return t.apply(this,arguments)}}()}},{key:"_handleBatch",value:function(){var e=a(i().mark((function e(t,n){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all(t.map(this._promiseHandle.bind(this)));case 3:if(r=e.sent,!n){e.next=6;break}return e.abrupt("return",n(null,r));case 6:return e.abrupt("return",r);case 9:if(e.prev=9,e.t0=e.catch(0),!n){e.next=13;break}return e.abrupt("return",n(e.t0));case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,this,[[0,9]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_promiseHandle",value:function(e){var t=this;return new Promise((function(n){t._handle(e,(function(e,t){n(t)}))}))}},{key:"_handle",value:function(){var e=a(i().mark((function e(t,n){var r,o,a,s,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&!Array.isArray(t)&&"object"===typeof t){e.next=3;break}return r=new p.EthereumRpcError(p.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: ".concat(typeof t),{request:t}),e.abrupt("return",n(r,{id:void 0,jsonrpc:"2.0",error:r}));case 3:if("string"===typeof t.method){e.next=6;break}return o=new p.EthereumRpcError(p.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: ".concat(typeof t.method),{request:t}),e.abrupt("return",n(o,{id:t.id,jsonrpc:"2.0",error:o}));case 6:return a=Object.assign({},t),s={id:a.id,jsonrpc:a.jsonrpc},u=null,e.prev=9,e.next=12,this._processRequest(a,s);case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(9),u=e.t0;case 17:return u&&(delete s.result,s.error||(s.error=p.serializeError(u))),e.abrupt("return",n(u,s));case 19:case"end":return e.stop()}}),e,this,[[9,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_processRequest",value:function(){var e=a(i().mark((function e(t,r){var a,s,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n._runAllMiddleware(t,r,this._middleware);case 2:return a=e.sent,s=o(a,3),u=s[0],c=s[1],l=s[2],n._checkForCompletion(t,r,c),e.next=10,n._runReturnHandlers(l);case 10:if(!u){e.next=12;break}throw u;case 12:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}],[{key:"_runAllMiddleware",value:function(){var e=a(i().mark((function e(t,a,s){var u,c,l,f,d,p,h,v;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=[],c=null,l=!1,f=r(s),e.prev=4,f.s();case 6:if((d=f.n()).done){e.next=18;break}return p=d.value,e.next=10,n._runMiddleware(t,a,p,u);case 10:if(h=e.sent,v=o(h,2),c=v[0],!(l=v[1])){e.next=16;break}return e.abrupt("break",18);case 16:e.next=6;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(4),f.e(e.t0);case 23:return e.prev=23,f.f(),e.finish(23);case 26:return e.abrupt("return",[c,l,u.reverse()]);case 27:case"end":return e.stop()}}),e,null,[[4,20,23,26]])})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"_runMiddleware",value:function(e,t,n,r){return new Promise((function(i){var o=function(e){var n=e||t.error;n&&(t.error=p.serializeError(n)),i([n,!0])};try{n(e,t,(function(n){t.error?o(t.error):(n&&("function"!==typeof n&&o(new p.EthereumRpcError(p.errorCodes.rpc.internal,'JsonRpcEngine: "next" return handlers must be functions. '+'Received "'.concat(typeof n,'" for request:\n').concat(v(e)),{request:e})),r.push(n)),i([null,!1]))}),o)}catch(a){o(a)}}))}},{key:"_runReturnHandlers",value:function(){var e=a(i().mark((function e(t){var n,o,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r(t),e.prev=1,a=i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.value,e.next=3,new Promise((function(e,n){t((function(t){return t?n(t):e()}))}));case 3:case"end":return e.stop()}}),e)})),n.s();case 4:if((o=n.n()).done){e.next=8;break}return e.delegateYield(a(),"t0",6);case 6:e.next=4;break;case 8:e.next=13;break;case 10:e.prev=10,e.t1=e.catch(1),n.e(e.t1);case 13:return e.prev=13,n.f(),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_checkForCompletion",value:function(e,t,n){if(!("result"in t)&&!("error"in t))throw new p.EthereumRpcError(p.errorCodes.rpc.internal,"JsonRpcEngine: Response has no error or result for request:\n".concat(v(e)),{request:e});if(!n)throw new p.EthereumRpcError(p.errorCodes.rpc.internal,"JsonRpcEngine: Nothing ended request:\n".concat(v(e)),{request:e})}}]),n}(d.default);function v(e){return JSON.stringify(e,null,2)}t.JsonRpcEngine=h},14825:function(e,t,n){"use strict";var r=n(17061).default,i=n(17156).default;Object.defineProperty(t,"__esModule",{value:!0}),t.createAsyncMiddleware=void 0,t.createAsyncMiddleware=function(e){return function(){var t=i(r().mark((function t(n,o,a,s){var u,c,l,f,d;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=new Promise((function(e){u=e})),l=null,f=!1,d=function(){var e=i(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=!0,a((function(e){l=e,u()})),e.next=4,c;case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),t.prev=4,t.next=7,e(n,o,d);case 7:if(!f){t.next=13;break}return t.next=10,c;case 10:l(null),t.next=14;break;case 13:s(null);case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(4),l?l(t.t0):s(t.t0);case 19:case"end":return t.stop()}}),t,null,[[4,16]])})));return function(e,n,r,i){return t.apply(this,arguments)}}()}},28711:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createScaffoldMiddleware=void 0,t.createScaffoldMiddleware=function(e){return function(t,n,r,i){var o=e[t.method];return void 0===o?r():"function"===typeof o?o(t,n,r,i):(n.result=o,i())}}},68919:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=void 0;var n=4294967295,r=Math.floor(Math.random()*n);t.getUniqueId=function(){return r=(r+1)%n}},40883:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIdRemapMiddleware=void 0;var r=n(68919);t.createIdRemapMiddleware=function(){return function(e,t,n,i){var o=e.id,a=r.getUniqueId();e.id=a,t.id=a,n((function(n){e.id=o,t.id=o,n()}))}}},79223:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(40883),t),i(n(14825),t),i(n(28711),t),i(n(68919),t),i(n(40909),t),i(n(61970),t)},61970:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMiddleware=void 0;var r=n(40909);t.mergeMiddleware=function(e){var t=new r.JsonRpcEngine;return e.forEach((function(e){return t.push(e)})),t.asMiddleware()}},77163:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,o=n(61655).default,a=n(26389).default,s=n(33496).default;Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;var u=n(62891),c=function(e){o(n,e);var t=a(n);function n(e,i,o){var a;if(r(this,n),!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!i||"string"!==typeof i)throw new Error('"message" must be a nonempty string.');return(a=t.call(this,i)).code=e,void 0!==o&&(a.data=o),a}return i(n,[{key:"serialize",value:function(){var e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}},{key:"toString",value:function(){return u.default(this.serialize(),f,2)}}]),n}(s(Error));t.EthereumRpcError=c;var l=function(e){o(n,e);var t=a(n);function n(e,i,o){if(r(this,n),!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');return t.call(this,e,i,o)}return i(n)}(c);function f(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=l},3902:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},52653:function(e,t,n){"use strict";var r=n(27424).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;var i=n(77163),o=n(97376),a=n(3902);function s(e,t){var n=c(t),a=r(n,2),s=a[0],u=a[1];return new i.EthereumRpcError(e,s||o.getMessageFromCode(e),u)}function u(e,t){var n=c(t),a=r(n,2),s=a[0],u=a[1];return new i.EthereumProviderError(e,s||o.getMessageFromCode(e),u)}function c(e){if(e){if("string"===typeof e)return[e];if("object"===typeof e&&!Array.isArray(e)){var t=e.message,n=e.data;if(t&&"string"!==typeof t)throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}t.ethErrors={rpc:{parse:function(e){return s(a.errorCodes.rpc.parse,e)},invalidRequest:function(e){return s(a.errorCodes.rpc.invalidRequest,e)},invalidParams:function(e){return s(a.errorCodes.rpc.invalidParams,e)},methodNotFound:function(e){return s(a.errorCodes.rpc.methodNotFound,e)},internal:function(e){return s(a.errorCodes.rpc.internal,e)},server:function(e){if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");var t=e.code;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:function(e){return s(a.errorCodes.rpc.invalidInput,e)},resourceNotFound:function(e){return s(a.errorCodes.rpc.resourceNotFound,e)},resourceUnavailable:function(e){return s(a.errorCodes.rpc.resourceUnavailable,e)},transactionRejected:function(e){return s(a.errorCodes.rpc.transactionRejected,e)},methodNotSupported:function(e){return s(a.errorCodes.rpc.methodNotSupported,e)},limitExceeded:function(e){return s(a.errorCodes.rpc.limitExceeded,e)}},provider:{userRejectedRequest:function(e){return u(a.errorCodes.provider.userRejectedRequest,e)},unauthorized:function(e){return u(a.errorCodes.provider.unauthorized,e)},unsupportedMethod:function(e){return u(a.errorCodes.provider.unsupportedMethod,e)},disconnected:function(e){return u(a.errorCodes.provider.disconnected,e)},chainDisconnected:function(e){return u(a.errorCodes.provider.chainDisconnected,e)},custom:function(e){if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");var t=e.code,n=e.message,r=e.data;if(!n||"string"!==typeof n)throw new Error('"message" must be a nonempty string');return new i.EthereumProviderError(t,n,r)}}}},57666:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;var r=n(77163);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});var i=n(97376);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return i.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}});var o=n(52653);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});var a=n(3902);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})},97376:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var r=n(3902),i=n(77163),o=r.errorCodes.rpc.internal,a="Unspecified error message. This is a bug, please report it.",s={code:o,message:u(o)};function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;if(Number.isInteger(e)){var i=e.toString();if(d(r.errorValues,i))return r.errorValues[i].message;if(l(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return n}function c(e){if(!Number.isInteger(e))return!1;var t=e.toString();return!!r.errorValues[t]||!!l(e)}function l(e){return e>=-32099&&e<=-32e3}function f(e){return e&&"object"===typeof e&&!Array.isArray(e)?Object.assign({},e):e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=u,t.isValidCode=c,t.serializeError=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.fallbackError,a=void 0===o?s:o,l=r.shouldIncludeStack,p=void 0!==l&&l;if(!a||!Number.isInteger(a.code)||"string"!==typeof a.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();var h={};if(e&&"object"===typeof e&&!Array.isArray(e)&&d(e,"code")&&c(e.code)){var v=e;h.code=v.code,v.message&&"string"===typeof v.message?(h.message=v.message,d(v,"data")&&(h.data=v.data)):(h.message=u(h.code),h.data={originalError:f(e)})}else{h.code=a.code;var m=null===(t=e)||void 0===t?void 0:t.message;h.message=m&&"string"===typeof m?m:a.message,h.data={originalError:f(e)}}var g=null===(n=e)||void 0===n?void 0:n.stack;return p&&e&&g&&"string"===typeof g&&(h.stack=g),h}},39702:function(e){e.exports=function(e){var t=(e=e||{}).max||Number.MAX_SAFE_INTEGER,n="undefined"!==typeof e.start?e.start:Math.floor(Math.random()*t);return function(){return n%=t,n++}}},23523:function(e){"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,i,o,a,s,u,c,l,f){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var d in r(o,a,s,u,c,l,f),o){var p=o[d];if(Array.isArray(p)){if(d in t.arrayKeywords)for(var h=0;h>>31),h=d^(a<<1|o>>>31),v=e[0]^p,m=e[1]^h,g=e[10]^p,y=e[11]^h,b=e[20]^p,w=e[21]^h,x=e[30]^p,k=e[31]^h,_=e[40]^p,E=e[41]^h;p=r^(s<<1|u>>>31),h=i^(u<<1|s>>>31);var A=e[2]^p,S=e[3]^h,O=e[12]^p,T=e[13]^h,P=e[22]^p,C=e[23]^h,I=e[32]^p,R=e[33]^h,j=e[42]^p,N=e[43]^h;p=o^(c<<1|l>>>31),h=a^(l<<1|c>>>31);var M=e[4]^p,L=e[5]^h,U=e[14]^p,D=e[15]^h,B=e[24]^p,F=e[25]^h,Z=e[34]^p,z=e[35]^h,H=e[44]^p,q=e[45]^h;p=s^(f<<1|d>>>31),h=u^(d<<1|f>>>31);var V=e[6]^p,W=e[7]^h,G=e[16]^p,Y=e[17]^h,K=e[26]^p,J=e[27]^h,Q=e[36]^p,X=e[37]^h,$=e[46]^p,ee=e[47]^h;p=c^(r<<1|i>>>31),h=l^(i<<1|r>>>31);var te=e[8]^p,ne=e[9]^h,re=e[18]^p,ie=e[19]^h,oe=e[28]^p,ae=e[29]^h,se=e[38]^p,ue=e[39]^h,ce=e[48]^p,le=e[49]^h,fe=v,de=m,pe=y<<4|g>>>28,he=g<<4|y>>>28,ve=b<<3|w>>>29,me=w<<3|b>>>29,ge=k<<9|x>>>23,ye=x<<9|k>>>23,be=_<<18|E>>>14,we=E<<18|_>>>14,xe=A<<1|S>>>31,ke=S<<1|A>>>31,_e=T<<12|O>>>20,Ee=O<<12|T>>>20,Ae=P<<10|C>>>22,Se=C<<10|P>>>22,Oe=R<<13|I>>>19,Te=I<<13|R>>>19,Pe=j<<2|N>>>30,Ce=N<<2|j>>>30,Ie=L<<30|M>>>2,Re=M<<30|L>>>2,je=U<<6|D>>>26,Ne=D<<6|U>>>26,Me=F<<11|B>>>21,Le=B<<11|F>>>21,Ue=Z<<15|z>>>17,De=z<<15|Z>>>17,Be=q<<29|H>>>3,Fe=H<<29|q>>>3,Ze=V<<28|W>>>4,ze=W<<28|V>>>4,He=Y<<23|G>>>9,qe=G<<23|Y>>>9,Ve=K<<25|J>>>7,We=J<<25|K>>>7,Ge=Q<<21|X>>>11,Ye=X<<21|Q>>>11,Ke=ee<<24|$>>>8,Je=$<<24|ee>>>8,Qe=te<<27|ne>>>5,Xe=ne<<27|te>>>5,$e=re<<20|ie>>>12,et=ie<<20|re>>>12,tt=ae<<7|oe>>>25,nt=oe<<7|ae>>>25,rt=se<<8|ue>>>24,it=ue<<8|se>>>24,ot=ce<<14|le>>>18,at=le<<14|ce>>>18;e[0]=fe^~_e&Me,e[1]=de^~Ee&Le,e[10]=Ze^~$e&ve,e[11]=ze^~et&me,e[20]=xe^~je&Ve,e[21]=ke^~Ne&We,e[30]=Qe^~pe&Ae,e[31]=Xe^~he&Se,e[40]=Ie^~He&tt,e[41]=Re^~qe&nt,e[2]=_e^~Me&Ge,e[3]=Ee^~Le&Ye,e[12]=$e^~ve&Oe,e[13]=et^~me&Te,e[22]=je^~Ve&rt,e[23]=Ne^~We&it,e[32]=pe^~Ae&Ue,e[33]=he^~Se&De,e[42]=He^~tt&ge,e[43]=qe^~nt&ye,e[4]=Me^~Ge&ot,e[5]=Le^~Ye&at,e[14]=ve^~Oe&Be,e[15]=me^~Te&Fe,e[24]=Ve^~rt&be,e[25]=We^~it&we,e[34]=Ae^~Ue&Ke,e[35]=Se^~De&Je,e[44]=tt^~ge&Pe,e[45]=nt^~ye&Ce,e[6]=Ge^~ot&fe,e[7]=Ye^~at&de,e[16]=Oe^~Be&Ze,e[17]=Te^~Fe&ze,e[26]=rt^~be&xe,e[27]=it^~we&ke,e[36]=Ue^~Ke&Qe,e[37]=De^~Je&Xe,e[46]=ge^~Pe&Ie,e[47]=ye^~Ce&Re,e[8]=ot^~fe&_e,e[9]=at^~de&Ee,e[18]=Be^~Ze&$e,e[19]=Fe^~ze&et,e[28]=be^~xe&je,e[29]=we^~ke&Ne,e[38]=Ke^~Qe&pe,e[39]=Je^~Xe&he,e[48]=Pe^~Ie&He,e[49]=Ce^~Re&qe,e[0]^=n[2*t],e[1]^=n[2*t+1]}}},17788:function(e,t,n){var r=n(63090);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(e,t){for(var n=0;n<50;++n)this.state[n]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(var t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(r.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},86771:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",i=1,o=2,a=1/0,s=9007199254740991,u="[object Arguments]",c="[object Array]",l="[object Boolean]",f="[object Date]",d="[object Error]",p="[object Function]",h="[object GeneratorFunction]",v="[object Map]",m="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",w="[object Set]",x="[object String]",k="[object Symbol]",_="[object WeakMap]",E="[object ArrayBuffer]",A="[object DataView]",S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,T=/^\./,P=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,C=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,j={};j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j[u]=j[c]=j[E]=j[l]=j[A]=j[f]=j[d]=j[p]=j[v]=j[m]=j[g]=j[b]=j[w]=j[x]=j[_]=!1;var N="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,M="object"==typeof self&&self&&self.Object===Object&&self,L=N||M||Function("return this")(),U=t&&!t.nodeType&&t,D=U&&e&&!e.nodeType&&e,B=D&&D.exports===U&&N.process,F=function(){try{return B&&B.binding("util")}catch(e){}}(),Z=F&&F.isTypedArray;function z(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n-1},Se.prototype.set=function(e,t){var n=this.__data__,r=Ie(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Oe.prototype.clear=function(){this.__data__={hash:new Ae,map:new(de||Se),string:new Ae}},Oe.prototype.delete=function(e){return We(this,e).delete(e)},Oe.prototype.get=function(e){return We(this,e).get(e)},Oe.prototype.has=function(e){return We(this,e).has(e)},Oe.prototype.set=function(e,t){return We(this,e).set(e,t),this},Te.prototype.add=Te.prototype.push=function(e){return this.__data__.set(e,r),this},Te.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.clear=function(){this.__data__=new Se},Pe.prototype.delete=function(e){return this.__data__.delete(e)},Pe.prototype.get=function(e){return this.__data__.get(e)},Pe.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Se){var r=n.__data__;if(!de||r.length<199)return r.push([e,t]),this;n=this.__data__=new Oe(r)}return n.set(e,t),this};var Re,je,Ne=(Re=function(e,t){return e&&Le(e,t,ht)},function(e,t){if(null==e)return e;if(!st(e))return Re(e,t);for(var n=e.length,r=je?n:-1,i=Object(e);(je?r--:++r0&&n(s)?t>1?Me(s,t-1,n,r,i):H(i,s):r||(i[i.length]=s)}return i}var Le=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}();function Ue(e,t){for(var n=0,r=(t=Qe(t,e)?[t]:qe(t)).length;null!=e&&nc))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var d=-1,p=!0,h=a&i?new Te:void 0;for(s.set(e,t),s.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=s}function lt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ft(e){return!!e&&"object"==typeof e}function dt(e){return"symbol"==typeof e||ft(e)&&re.call(e)==k}var pt=Z?function(e){return function(t){return e(t)}}(Z):function(e){return ft(e)&&ct(e.length)&&!!j[re.call(e)]};function ht(e){return st(e)?Ce(e):ze(e)}function vt(e){return e}e.exports=function(e,t){return Me(function(e,t){var n=at(e)?z:He;return n(e,Ze(t))}(e,t),1)}},23108:function(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",i=1,o=2,a=9007199254740991,s="[object Arguments]",u="[object Array]",c="[object AsyncFunction]",l="[object Boolean]",f="[object Date]",d="[object Error]",p="[object Function]",h="[object GeneratorFunction]",v="[object Map]",m="[object Number]",g="[object Null]",y="[object Object]",b="[object Promise]",w="[object Proxy]",x="[object RegExp]",k="[object Set]",_="[object String]",E="[object Symbol]",A="[object Undefined]",S="[object WeakMap]",O="[object ArrayBuffer]",T="[object DataView]",P=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[s]=I[u]=I[O]=I[l]=I[T]=I[f]=I[d]=I[p]=I[v]=I[m]=I[y]=I[x]=I[k]=I[_]=I[S]=!1;var R="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,j="object"==typeof self&&self&&self.Object===Object&&self,N=R||j||Function("return this")(),M=t&&!t.nodeType&&t,L=M&&e&&!e.nodeType&&e,U=L&&L.exports===M,D=U&&R.process,B=function(){try{return D&&D.binding&&D.binding("util")}catch(e){}}(),F=B&&B.isTypedArray;function Z(e,t){for(var n=-1,r=null==e?0:e.length;++nc))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var d=-1,p=!0,h=n&o?new Se:void 0;for(s.set(e,t),s.set(t,e);++d-1},Ee.prototype.set=function(e,t){var n=this.__data__,r=Pe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Ae.prototype.clear=function(){this.size=0,this.__data__={hash:new _e,map:new(fe||Ee),string:new _e}},Ae.prototype.delete=function(e){var t=Ue(this,e).delete(e);return this.size-=t?1:0,t},Ae.prototype.get=function(e){return Ue(this,e).get(e)},Ae.prototype.has=function(e){return Ue(this,e).has(e)},Ae.prototype.set=function(e,t){var n=Ue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Se.prototype.add=Se.prototype.push=function(e){return this.__data__.set(e,r),this},Se.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.clear=function(){this.__data__=new Ee,this.size=0},Oe.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ee){var r=n.__data__;if(!fe||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ae(r)}return n.set(e,t),this.size=n.size,this};var Be=se?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=a}function Ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Qe=F?function(e){return function(t){return e(t)}}(F):function(e){return Je(e)&&Ye(e.length)&&!!I[Ce(e)]};function Xe(e){return null!=(t=e)&&Ye(t.length)&&!Ge(t)?Te(e):Ne(e);var t}e.exports=function(e,t){return Re(e,t)}},81725:function(e,t,n){var r=n(70781)(n(24393),"DataView");e.exports=r},69748:function(e,t,n){var r=n(56545),i=n(69843),o=n(86266),a=n(17364),s=n(74156);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tl))return!1;var d=u.get(e),p=u.get(t);if(d&&p)return d==t&&p==e;var h=-1,v=!0,m=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++h-1&&e%1==0&&e-1}},73316:function(e,t,n){var r=n(69194);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},79e3:function(e,t,n){var r=n(69748),i=n(95745),o=n(18579);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},37240:function(e,t,n){var r=n(16911);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},63414:function(e,t,n){var r=n(16911);e.exports=function(e){return r(this,e).get(e)}},17140:function(e,t,n){var r=n(16911);e.exports=function(e){return r(this,e).has(e)}},85429:function(e,t,n){var r=n(16911);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},258:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},22093:function(e){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},83679:function(e,t,n){var r=n(92736);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},11353:function(e,t,n){var r=n(70781)(Object,"create");e.exports=r},8723:function(e,t,n){var r=n(9698)(Object.keys,Object);e.exports=r},3481:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},47785:function(e,t,n){e=n.nmd(e);var r=n(32692),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=s},78186:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9698:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},25313:function(e,t,n){var r=n(81686),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},23653:function(e,t,n){var r=n(95745);e.exports=function(){this.__data__=new r,this.size=0}},43359:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},92571:function(e){e.exports=function(e){return this.__data__.get(e)}},31698:function(e){e.exports=function(e){return this.__data__.has(e)}},85883:function(e,t,n){var r=n(95745),i=n(18579),o=n(13109);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},3002:function(e,t,n){var r=n(83679),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},60925:function(e,t,n){var r=n(72060);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},92043:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},54161:function(e,t,n){var r=n(46476);e.exports=function(e){return r(e,4)}},83194:function(e){e.exports=function(e){return function(){return e}}},60979:function(e,t,n){var r=n(33088),i=n(83666),o=n(73271),a=n(67086),s=Object.prototype,u=s.hasOwnProperty,c=r((function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&o(t[0],t[1],c)&&(r=1);++n-1&&e%1==0&&e<=9007199254740991}},15874:function(e,t,n){var r=n(37094),i=n(36902),o=n(47785),a=o&&o.isMap,s=a?i(a):r;e.exports=s},91845:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},89752:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},41859:function(e,t,n){var r=n(18711),i=n(36902),o=n(47785),a=o&&o.isSet,s=a?i(a):r;e.exports=s},72060:function(e,t,n){var r=n(18665),i=n(89752);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},53153:function(e,t,n){var r=n(77499),i=n(36902),o=n(47785),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},56385:function(e,t,n){var r=n(83200),i=n(23409),o=n(2114);e.exports=function(e){return o(e)?r(e):i(e)}},67086:function(e,t,n){var r=n(83200),i=n(89130),o=n(2114);e.exports=function(e){return o(e)?r(e,!0):i(e)}},16031:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",u=16,c=32,l=64,f=128,d=256,p=1/0,h=9007199254740991,v=NaN,m=4294967295,g=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",c],["partialRight",l],["rearg",d]],y="[object Arguments]",b="[object Array]",w="[object Boolean]",x="[object Date]",k="[object Error]",_="[object Function]",E="[object GeneratorFunction]",A="[object Map]",S="[object Number]",O="[object Object]",T="[object Promise]",P="[object RegExp]",C="[object Set]",I="[object String]",R="[object Symbol]",j="[object WeakMap]",N="[object ArrayBuffer]",M="[object DataView]",L="[object Float32Array]",U="[object Float64Array]",D="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",Z="[object Uint8Array]",z="[object Uint8ClampedArray]",H="[object Uint16Array]",q="[object Uint32Array]",V=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,J=RegExp(Y.source),Q=RegExp(K.source),X=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ve=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",Ae="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Oe="a-z\\xdf-\\xf6\\xf8-\\xff",Te="A-Z\\xc0-\\xd6\\xd8-\\xde",Pe="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['\u2019]",Re="["+Ee+"]",je="["+Ce+"]",Ne="["+Ae+"]",Me="\\d+",Le="["+Se+"]",Ue="["+Oe+"]",De="[^"+Ee+Ce+Me+Se+Oe+Te+"]",Be="\\ud83c[\\udffb-\\udfff]",Fe="[^"+Ee+"]",Ze="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Te+"]",qe="\\u200d",Ve="(?:"+Ue+"|"+De+")",We="(?:"+He+"|"+De+")",Ge="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ye="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ke="(?:"+Ne+"|"+Be+")"+"?",Je="["+Pe+"]?",Qe=Je+Ke+("(?:"+qe+"(?:"+[Fe,Ze,ze].join("|")+")"+Je+Ke+")*"),Xe="(?:"+[Le,Ze,ze].join("|")+")"+Qe,$e="(?:"+[Fe+Ne+"?",Ne,Ze,ze,Re].join("|")+")",et=RegExp(Ie,"g"),tt=RegExp(Ne,"g"),nt=RegExp(Be+"(?="+Be+")|"+$e+Qe,"g"),rt=RegExp([He+"?"+Ue+"+"+Ge+"(?="+[je,He,"$"].join("|")+")",We+"+"+Ye+"(?="+[je,He+Ve,"$"].join("|")+")",He+"?"+Ve+"+"+Ge,He+"+"+Ye,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Me,Xe].join("|"),"g"),it=RegExp("["+qe+Ee+Ae+Pe+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,ut={};ut[L]=ut[U]=ut[D]=ut[B]=ut[F]=ut[Z]=ut[z]=ut[H]=ut[q]=!0,ut[y]=ut[b]=ut[N]=ut[w]=ut[M]=ut[x]=ut[k]=ut[_]=ut[A]=ut[S]=ut[O]=ut[P]=ut[C]=ut[I]=ut[j]=!1;var ct={};ct[y]=ct[b]=ct[N]=ct[M]=ct[w]=ct[x]=ct[L]=ct[U]=ct[D]=ct[B]=ct[F]=ct[A]=ct[S]=ct[O]=ct[P]=ct[C]=ct[I]=ct[R]=ct[Z]=ct[z]=ct[H]=ct[q]=!0,ct[k]=ct[_]=ct[j]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,pt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ht="object"==typeof self&&self&&self.Object===Object&&self,vt=pt||ht||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,yt=gt&>.exports===mt,bt=yt&&pt.process,wt=function(){try{var e=gt&>.require&>.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(t){}}(),xt=wt&&wt.isArrayBuffer,kt=wt&&wt.isDate,_t=wt&&wt.isMap,Et=wt&&wt.isRegExp,At=wt&&wt.isSet,St=wt&&wt.isTypedArray;function Ot(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Nt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function rn(e,t){for(var n=e.length;n--&&Ht(t,e[n],0)>-1;);return n}var on=Yt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),an=Yt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+lt[e]}function un(e){return it.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function ln(e,t){return function(n){return e(t(n))}}function fn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var yn=function e(t){var n=(t=null==t?vt:yn.defaults(vt.Object(),t,yn.pick(vt,at))).Array,r=t.Date,se=t.Error,Ee=t.Function,Ae=t.Math,Se=t.Object,Oe=t.RegExp,Te=t.String,Pe=t.TypeError,Ce=n.prototype,Ie=Ee.prototype,Re=Se.prototype,je=t["__core-js_shared__"],Ne=Ie.toString,Me=Re.hasOwnProperty,Le=0,Ue=function(){var e=/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),De=Re.toString,Be=Ne.call(Se),Fe=vt._,Ze=Oe("^"+Ne.call(Me).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ze=yt?t.Buffer:i,He=t.Symbol,qe=t.Uint8Array,Ve=ze?ze.allocUnsafe:i,We=ln(Se.getPrototypeOf,Se),Ge=Se.create,Ye=Re.propertyIsEnumerable,Ke=Ce.splice,Je=He?He.isConcatSpreadable:i,Qe=He?He.iterator:i,Xe=He?He.toStringTag:i,$e=function(){try{var e=fo(Se,"defineProperty");return e({},"",{}),e}catch(t){}}(),nt=t.clearTimeout!==vt.clearTimeout&&t.clearTimeout,it=r&&r.now!==vt.Date.now&&r.now,lt=t.setTimeout!==vt.setTimeout&&t.setTimeout,pt=Ae.ceil,ht=Ae.floor,mt=Se.getOwnPropertySymbols,gt=ze?ze.isBuffer:i,bt=t.isFinite,wt=Ce.join,Ft=ln(Se.keys,Se),Yt=Ae.max,bn=Ae.min,wn=r.now,xn=t.parseInt,kn=Ae.random,_n=Ce.reverse,En=fo(t,"DataView"),An=fo(t,"Map"),Sn=fo(t,"Promise"),On=fo(t,"Set"),Tn=fo(t,"WeakMap"),Pn=fo(Se,"create"),Cn=Tn&&new Tn,In={},Rn=Do(En),jn=Do(An),Nn=Do(Sn),Mn=Do(On),Ln=Do(Tn),Un=He?He.prototype:i,Dn=Un?Un.valueOf:i,Bn=Un?Un.toString:i;function Fn(e){if(ts(e)&&!qa(e)&&!(e instanceof qn)){if(e instanceof Hn)return e;if(Me.call(e,"__wrapped__"))return Bo(e)}return new Hn(e)}var Zn=function(){function e(){}return function(t){if(!es(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function zn(){}function Hn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function qn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function ur(e,t,n,r,o,a){var s,u=1&t,c=2&t,l=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!es(e))return e;var f=qa(e);if(f){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!u)return Pi(e,s)}else{var d=vo(e),p=d==_||d==E;if(Ya(e))return _i(e,u);if(d==O||d==y||p&&!o){if(s=c||p?{}:go(e),!u)return c?function(e,t){return Ci(e,ho(e),t)}(e,function(e,t){return e&&Ci(t,Rs(t),e)}(s,e)):function(e,t){return Ci(e,po(e),t)}(e,ir(s,e))}else{if(!ct[d])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case N:return Ei(e);case w:case x:return new r(+e);case M:return function(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case U:case D:case B:case F:case Z:case z:case H:case q:return Ai(e,n);case A:return new r;case S:case I:return new r(e);case P:return function(e){var t=new e.constructor(e.source,ve.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new r;case R:return i=e,Dn?Se(Dn.call(i)):{}}var i}(e,d,u)}}a||(a=new Kn);var h=a.get(e);if(h)return h;a.set(e,s),as(e)?e.forEach((function(r){s.add(ur(r,t,n,r,e,a))})):ns(e)&&e.forEach((function(r,i){s.set(i,ur(r,t,n,i,e,a))}));var v=f?i:(l?c?io:ro:c?Rs:Is)(e);return Pt(v||e,(function(r,i){v&&(r=e[i=r]),tr(s,i,ur(r,t,n,i,e,a))})),s}function cr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Se(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function lr(e,t,n){if("function"!=typeof e)throw new Pe(o);return Io((function(){e.apply(i,n)}),t)}function fr(e,t,n,r){var i=-1,o=jt,a=!0,s=e.length,u=[],c=t.length;if(!s)return u;n&&(t=Mt(t,$t(n))),r?(o=Nt,a=!1):t.length>=200&&(o=tn,a=!1,t=new Yn(t));e:for(;++i-1},Wn.prototype.set=function(e,t){var n=this.__data__,r=nr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(An||Wn),string:new Vn}},Gn.prototype.delete=function(e){var t=co(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return co(this,e).get(e)},Gn.prototype.has=function(e){return co(this,e).has(e)},Gn.prototype.set=function(e,t){var n=co(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,a),this},Yn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Kn.prototype.get=function(e){return this.__data__.get(e)},Kn.prototype.has=function(e){return this.__data__.has(e)},Kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!An||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var dr=ji(wr),pr=ji(xr,!0);function hr(e,t){var n=!0;return dr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function vr(e,t,n){for(var r=-1,o=e.length;++r0&&n(s)?t>1?gr(s,t-1,n,r,i):Lt(i,s):r||(i[i.length]=s)}return i}var yr=Ni(),br=Ni(!0);function wr(e,t){return e&&yr(e,t,Is)}function xr(e,t){return e&&br(e,t,Is)}function kr(e,t){return Rt(t,(function(t){return Qa(e[t])}))}function _r(e,t){for(var n=0,r=(t=bi(t,e)).length;null!=e&&nt}function Or(e,t){return null!=e&&Me.call(e,t)}function Tr(e,t){return null!=e&&t in Se(e)}function Pr(e,t,r){for(var o=r?Nt:jt,a=e[0].length,s=e.length,u=s,c=n(s),l=1/0,f=[];u--;){var d=e[u];u&&t&&(d=Mt(d,$t(t))),l=bn(d.length,l),c[u]=!r&&(t||a>=120&&d.length>=120)?new Yn(u&&d):i}d=e[0];var p=-1,h=c[0];e:for(;++p=s?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)s!==e&&Ke.call(s,u,1),Ke.call(e,u,1);return e}function Gr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;bo(i)?Ke.call(e,i,1):fi(e,i)}}return e}function Yr(e,t){return e+ht(kn()*(t-e+1))}function Kr(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=ht(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Ro(Oo(e,t,ru),e+"")}function Qr(e){return Qn(Fs(e))}function Xr(e,t){var n=Fs(e);return Mo(n,sr(t,0,n.length))}function $r(e,t,n,r){if(!es(e))return e;for(var o=-1,a=(t=bi(t,e)).length,s=a-1,u=e;null!=u&&++oo?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=n(o);++i>>1,a=e[o];null!==a&&!us(a)&&(n?a<=t:a=200){var c=t?null:Ki(e);if(c)return dn(c);a=!1,i=tn,u=new Yn}else u=t?[]:s;e:for(;++r=r?e:ri(e,t,n)}var ki=nt||function(e){return vt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function Ei(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function Ai(e,t){var n=t?Ei(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Si(e,t){if(e!==t){var n=e!==i,r=null===e,o=e===e,a=us(e),s=t!==i,u=null===t,c=t===t,l=us(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!l&&e1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&wo(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=Se(t);++r-1?o[a?t[s]:s]:i}}function Bi(e){return no((function(t){var n=t.length,r=n,a=Hn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Pe(o);if(a&&!u&&"wrapper"==ao(s))var u=new Hn([],!0)}for(r=u?r:n;++r1&&w.reverse(),p&&lu))return!1;var l=a.get(e),f=a.get(t);if(l&&f)return l==t&&f==e;var d=-1,p=!0,h=2&n?new Yn:i;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ue,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Pt(g,(function(n){var r="_."+n[0];t&n[1]&&!jt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(le):[]}(r),n)))}function No(e){var t=0,n=0;return function(){var r=wn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Mo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,oa(e,n)}));function da(e){var t=Fn(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ha=no((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ar(t,e)};return!(t>1||this.__actions__.length)&&r instanceof qn&&bo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[o],thisArg:i}),new Hn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var va=Ii((function(e,t,n){Me.call(e,n)?++e[n]:or(e,n,1)}));var ma=Di(Ho),ga=Di(qo);function ya(e,t){return(qa(e)?Pt:dr)(e,uo(t,3))}function ba(e,t){return(qa(e)?Ct:pr)(e,uo(t,3))}var wa=Ii((function(e,t,n){Me.call(e,n)?e[n].push(t):or(e,n,[t])}));var xa=Jr((function(e,t,r){var i=-1,o="function"==typeof t,a=Wa(e)?n(e.length):[];return dr(e,(function(e){a[++i]=o?Ot(t,e,r):Cr(e,t,r)})),a})),ka=Ii((function(e,t,n){or(e,n,t)}));function _a(e,t){return(qa(e)?Mt:Br)(e,uo(t,3))}var Ea=Ii((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Aa=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&wo(e,t[0],t[1])?t=[]:n>2&&wo(t[0],t[1],t[2])&&(t=[t[0]]),qr(e,gr(t,1),[])})),Sa=it||function(){return vt.Date.now()};function Oa(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Qi(e,f,i,i,i,i,t)}function Ta(e,t){var n;if("function"!=typeof t)throw new Pe(o);return e=hs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Pa=Jr((function(e,t,n){var r=1;if(n.length){var i=fn(n,so(Pa));r|=c}return Qi(e,r,t,n,i)})),Ca=Jr((function(e,t,n){var r=3;if(n.length){var i=fn(n,so(Ca));r|=c}return Qi(t,r,e,n,i)}));function Ia(e,t,n){var r,a,s,u,c,l,f=0,d=!1,p=!1,h=!0;if("function"!=typeof e)throw new Pe(o);function v(t){var n=r,o=a;return r=a=i,f=t,u=e.apply(o,n)}function m(e){var n=e-l;return l===i||n>=t||n<0||p&&e-f>=s}function g(){var e=Sa();if(m(e))return y(e);c=Io(g,function(e){var n=t-(e-l);return p?bn(n,s-(e-f)):n}(e))}function y(e){return c=i,h&&r?v(e):(r=a=i,u)}function b(){var e=Sa(),n=m(e);if(r=arguments,a=this,l=e,n){if(c===i)return function(e){return f=e,c=Io(g,t),d?v(e):u}(l);if(p)return ki(c),c=Io(g,t),v(l)}return c===i&&(c=Io(g,t)),u}return t=ms(t)||0,es(n)&&(d=!!n.leading,s=(p="maxWait"in n)?Yt(ms(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),b.cancel=function(){c!==i&&ki(c),f=0,r=l=a=c=i},b.flush=function(){return c===i?u:y(Sa())},b}var Ra=Jr((function(e,t){return lr(e,1,t)})),ja=Jr((function(e,t,n){return lr(e,ms(t)||0,n)}));function Na(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Pe(o);var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Na.Cache||Gn),n}function Ma(e){if("function"!=typeof e)throw new Pe(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Na.Cache=Gn;var La=wi((function(e,t){var n=(t=1==t.length&&qa(t[0])?Mt(t[0],$t(uo())):Mt(gr(t,1),$t(uo()))).length;return Jr((function(r){for(var i=-1,o=bn(r.length,n);++i=t})),Ha=Ir(function(){return arguments}())?Ir:function(e){return ts(e)&&Me.call(e,"callee")&&!Ye.call(e,"callee")},qa=n.isArray,Va=xt?$t(xt):function(e){return ts(e)&&Ar(e)==N};function Wa(e){return null!=e&&$a(e.length)&&!Qa(e)}function Ga(e){return ts(e)&&Wa(e)}var Ya=gt||mu,Ka=kt?$t(kt):function(e){return ts(e)&&Ar(e)==x};function Ja(e){if(!ts(e))return!1;var t=Ar(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!is(e)}function Qa(e){if(!es(e))return!1;var t=Ar(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xa(e){return"number"==typeof e&&e==hs(e)}function $a(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function es(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ts(e){return null!=e&&"object"==typeof e}var ns=_t?$t(_t):function(e){return ts(e)&&vo(e)==A};function rs(e){return"number"==typeof e||ts(e)&&Ar(e)==S}function is(e){if(!ts(e)||Ar(e)!=O)return!1;var t=We(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ne.call(n)==Be}var os=Et?$t(Et):function(e){return ts(e)&&Ar(e)==P};var as=At?$t(At):function(e){return ts(e)&&vo(e)==C};function ss(e){return"string"==typeof e||!qa(e)&&ts(e)&&Ar(e)==I}function us(e){return"symbol"==typeof e||ts(e)&&Ar(e)==R}var cs=St?$t(St):function(e){return ts(e)&&$a(e.length)&&!!ut[Ar(e)]};var ls=Wi(Dr),fs=Wi((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Wa(e))return ss(e)?vn(e):Pi(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=vo(e);return(t==A?cn:t==C?dn:Fs)(e)}function ps(e){return e?(e=ms(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e===e?e:0:0===e?e:0}function hs(e){var t=ps(e),n=t%1;return t===t?n?t-n:t:0}function vs(e){return e?sr(hs(e),0,m):0}function ms(e){if("number"==typeof e)return e;if(us(e))return v;if(es(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=es(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=ge.test(e);return n||be.test(e)?dt(e.slice(2),n?2:8):me.test(e)?v:+e}function gs(e){return Ci(e,Rs(e))}function ys(e){return null==e?"":ci(e)}var bs=Ri((function(e,t){if(Eo(t)||Wa(t))Ci(t,Is(t),e);else for(var n in t)Me.call(t,n)&&tr(e,n,t[n])})),ws=Ri((function(e,t){Ci(t,Rs(t),e)})),xs=Ri((function(e,t,n,r){Ci(t,Rs(t),e,r)})),ks=Ri((function(e,t,n,r){Ci(t,Is(t),e,r)})),_s=no(ar);var Es=Jr((function(e,t){e=Se(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&wo(t[0],t[1],o)&&(r=1);++n1),t})),Ci(e,io(e),n),r&&(n=ur(n,7,eo));for(var i=t.length;i--;)fi(n,t[i]);return n}));var Ls=no((function(e,t){return null==e?{}:function(e,t){return Vr(e,t,(function(t,n){return Os(e,n)}))}(e,t)}));function Us(e,t){if(null==e)return{};var n=Mt(io(e),(function(e){return[e]}));return t=uo(t),Vr(e,n,(function(e,n){return t(e,n[0])}))}var Ds=Ji(Is),Bs=Ji(Rs);function Fs(e){return null==e?[]:en(e,Is(e))}var Zs=Li((function(e,t,n){return t=t.toLowerCase(),e+(n?zs(t):t)}));function zs(e){return Js(ys(e).toLowerCase())}function Hs(e){return(e=ys(e))&&e.replace(xe,on).replace(tt,"")}var qs=Li((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Vs=Li((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ws=Mi("toLowerCase");var Gs=Li((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ys=Li((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Ks=Li((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Mi("toUpperCase");function Qs(e,t,n){return e=ys(e),(t=n?i:t)===i?function(e){return ot.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Xs=Jr((function(e,t){try{return Ot(e,i,t)}catch(n){return Ja(n)?n:new se(n)}})),$s=no((function(e,t){return Pt(t,(function(t){t=Uo(t),or(e,t,Pa(e[t],e))})),e}));function eu(e){return function(){return e}}var tu=Bi(),nu=Bi(!0);function ru(e){return e}function iu(e){return Mr("function"==typeof e?e:ur(e,1))}var ou=Jr((function(e,t){return function(n){return Cr(n,e,t)}})),au=Jr((function(e,t){return function(n){return Cr(e,n,t)}}));function su(e,t,n){var r=Is(t),i=kr(t,r);null!=n||es(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=kr(t,Is(t)));var o=!(es(n)&&"chain"in n)||!!n.chain,a=Qa(e);return Pt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Pi(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Lt([this.value()],arguments))})})),e}function uu(){}var cu=Hi(Mt),lu=Hi(It),fu=Hi(Bt);function du(e){return xo(e)?Gt(Uo(e)):function(e){return function(t){return _r(t,e)}}(e)}var pu=Vi(),hu=Vi(!0);function vu(){return[]}function mu(){return!1}var gu=zi((function(e,t){return e+t}),0),yu=Yi("ceil"),bu=zi((function(e,t){return e/t}),1),wu=Yi("floor");var xu=zi((function(e,t){return e*t}),1),ku=Yi("round"),_u=zi((function(e,t){return e-t}),0);return Fn.after=function(e,t){if("function"!=typeof t)throw new Pe(o);return e=hs(e),function(){if(--e<1)return t.apply(this,arguments)}},Fn.ary=Oa,Fn.assign=bs,Fn.assignIn=ws,Fn.assignInWith=xs,Fn.assignWith=ks,Fn.at=_s,Fn.before=Ta,Fn.bind=Pa,Fn.bindAll=$s,Fn.bindKey=Ca,Fn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qa(e)?e:[e]},Fn.chain=da,Fn.chunk=function(e,t,r){t=(r?wo(e,t,r):t===i)?1:Yt(hs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,u=n(pt(o/t));ao?0:o+n),(r=r===i||r>o?o:hs(r))<0&&(r+=o),r=n>r?0:vs(r);n>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!os(t))&&!(t=ci(t))&&un(e)?xi(vn(e),0,n):e.split(t,n):[]},Fn.spread=function(e,t){if("function"!=typeof e)throw new Pe(o);return t=null==t?0:Yt(hs(t),0),Jr((function(n){var r=n[t],i=xi(n,0,t);return r&&Lt(i,r),Ot(e,this,i)}))},Fn.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Fn.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===i?1:hs(t))<0?0:t):[]},Fn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ri(e,(t=r-(t=n||t===i?1:hs(t)))<0?0:t,r):[]},Fn.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},Fn.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},Fn.tap=function(e,t){return t(e),e},Fn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Pe(o);return es(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ia(e,t,{leading:r,maxWait:t,trailing:i})},Fn.thru=pa,Fn.toArray=ds,Fn.toPairs=Ds,Fn.toPairsIn=Bs,Fn.toPath=function(e){return qa(e)?Mt(e,Uo):us(e)?[e]:Pi(Lo(ys(e)))},Fn.toPlainObject=gs,Fn.transform=function(e,t,n){var r=qa(e),i=r||Ya(e)||cs(e);if(t=uo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:es(e)&&Qa(o)?Zn(We(e)):{}}return(i?Pt:wr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Fn.unary=function(e){return Oa(e,1)},Fn.union=ta,Fn.unionBy=na,Fn.unionWith=ra,Fn.uniq=function(e){return e&&e.length?li(e):[]},Fn.uniqBy=function(e,t){return e&&e.length?li(e,uo(t,2)):[]},Fn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?li(e,i,t):[]},Fn.unset=function(e,t){return null==e||fi(e,t)},Fn.unzip=ia,Fn.unzipWith=oa,Fn.update=function(e,t,n){return null==e?e:di(e,t,yi(n))},Fn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:di(e,t,yi(n),r)},Fn.values=Fs,Fn.valuesIn=function(e){return null==e?[]:en(e,Rs(e))},Fn.without=aa,Fn.words=Qs,Fn.wrap=function(e,t){return Ua(yi(t),e)},Fn.xor=sa,Fn.xorBy=ua,Fn.xorWith=ca,Fn.zip=la,Fn.zipObject=function(e,t){return mi(e||[],t||[],tr)},Fn.zipObjectDeep=function(e,t){return mi(e||[],t||[],$r)},Fn.zipWith=fa,Fn.entries=Ds,Fn.entriesIn=Bs,Fn.extend=ws,Fn.extendWith=xs,su(Fn,Fn),Fn.add=gu,Fn.attempt=Xs,Fn.camelCase=Zs,Fn.capitalize=zs,Fn.ceil=yu,Fn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ms(n))===n?n:0),t!==i&&(t=(t=ms(t))===t?t:0),sr(ms(e),t,n)},Fn.clone=function(e){return ur(e,4)},Fn.cloneDeep=function(e){return ur(e,5)},Fn.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:i)},Fn.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:i)},Fn.conformsTo=function(e,t){return null==t||cr(e,t,Is(t))},Fn.deburr=Hs,Fn.defaultTo=function(e,t){return null==e||e!==e?t:e},Fn.divide=bu,Fn.endsWith=function(e,t,n){e=ys(e),t=ci(t);var r=e.length,o=n=n===i?r:sr(hs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Fn.eq=Fa,Fn.escape=function(e){return(e=ys(e))&&Q.test(e)?e.replace(K,an):e},Fn.escapeRegExp=function(e){return(e=ys(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Fn.every=function(e,t,n){var r=qa(e)?It:hr;return n&&wo(e,t,n)&&(t=i),r(e,uo(t,3))},Fn.find=ma,Fn.findIndex=Ho,Fn.findKey=function(e,t){return Zt(e,uo(t,3),wr)},Fn.findLast=ga,Fn.findLastIndex=qo,Fn.findLastKey=function(e,t){return Zt(e,uo(t,3),xr)},Fn.floor=wu,Fn.forEach=ya,Fn.forEachRight=ba,Fn.forIn=function(e,t){return null==e?e:yr(e,uo(t,3),Rs)},Fn.forInRight=function(e,t){return null==e?e:br(e,uo(t,3),Rs)},Fn.forOwn=function(e,t){return e&&wr(e,uo(t,3))},Fn.forOwnRight=function(e,t){return e&&xr(e,uo(t,3))},Fn.get=Ss,Fn.gt=Za,Fn.gte=za,Fn.has=function(e,t){return null!=e&&mo(e,t,Or)},Fn.hasIn=Os,Fn.head=Wo,Fn.identity=ru,Fn.includes=function(e,t,n,r){e=Wa(e)?e:Fs(e),n=n&&!r?hs(n):0;var i=e.length;return n<0&&(n=Yt(i+n,0)),ss(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ht(e,t,n)>-1},Fn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:hs(n);return i<0&&(i=Yt(r+i,0)),Ht(e,t,i)},Fn.inRange=function(e,t,n){return t=ps(t),n===i?(n=t,t=0):n=ps(n),function(e,t,n){return e>=bn(t,n)&&e=-9007199254740991&&e<=h},Fn.isSet=as,Fn.isString=ss,Fn.isSymbol=us,Fn.isTypedArray=cs,Fn.isUndefined=function(e){return e===i},Fn.isWeakMap=function(e){return ts(e)&&vo(e)==j},Fn.isWeakSet=function(e){return ts(e)&&"[object WeakSet]"==Ar(e)},Fn.join=function(e,t){return null==e?"":wt.call(e,t)},Fn.kebabCase=qs,Fn.last=Jo,Fn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=hs(n))<0?Yt(r+o,0):bn(o,r-1)),t===t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):zt(e,Vt,o,!0)},Fn.lowerCase=Vs,Fn.lowerFirst=Ws,Fn.lt=ls,Fn.lte=fs,Fn.max=function(e){return e&&e.length?vr(e,ru,Sr):i},Fn.maxBy=function(e,t){return e&&e.length?vr(e,uo(t,2),Sr):i},Fn.mean=function(e){return Wt(e,ru)},Fn.meanBy=function(e,t){return Wt(e,uo(t,2))},Fn.min=function(e){return e&&e.length?vr(e,ru,Dr):i},Fn.minBy=function(e,t){return e&&e.length?vr(e,uo(t,2),Dr):i},Fn.stubArray=vu,Fn.stubFalse=mu,Fn.stubObject=function(){return{}},Fn.stubString=function(){return""},Fn.stubTrue=function(){return!0},Fn.multiply=xu,Fn.nth=function(e,t){return e&&e.length?Hr(e,hs(t)):i},Fn.noConflict=function(){return vt._===this&&(vt._=Fe),this},Fn.noop=uu,Fn.now=Sa,Fn.pad=function(e,t,n){e=ys(e);var r=(t=hs(t))?hn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return qi(ht(i),n)+e+qi(pt(i),n)},Fn.padEnd=function(e,t,n){e=ys(e);var r=(t=hs(t))?hn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=kn();return bn(e+o*(t-e+ft("1e-"+((o+"").length-1))),t)}return Yr(e,t)},Fn.reduce=function(e,t,n){var r=qa(e)?Ut:Kt,i=arguments.length<3;return r(e,uo(t,4),n,i,dr)},Fn.reduceRight=function(e,t,n){var r=qa(e)?Dt:Kt,i=arguments.length<3;return r(e,uo(t,4),n,i,pr)},Fn.repeat=function(e,t,n){return t=(n?wo(e,t,n):t===i)?1:hs(t),Kr(ys(e),t)},Fn.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fn.result=function(e,t,n){var r=-1,o=(t=bi(t,e)).length;for(o||(o=1,e=i);++rh)return[];var n=m,r=bn(e,m);t=uo(t),e-=m;for(var i=Qt(r,t);++n=a)return e;var u=n-hn(r);if(u<1)return r;var c=s?xi(s,0,u).join(""):e.slice(0,u);if(o===i)return c+r;if(s&&(u+=c.length-u),os(o)){if(e.slice(u).search(o)){var l,f=c;for(o.global||(o=Oe(o.source,ys(ve.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var d=l.index;c=c.slice(0,d===i?u:d)}}else if(e.indexOf(ci(o),u)!=u){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Fn.unescape=function(e){return(e=ys(e))&&J.test(e)?e.replace(Y,gn):e},Fn.uniqueId=function(e){var t=++Le;return ys(e)+t},Fn.upperCase=Ks,Fn.upperFirst=Js,Fn.each=ya,Fn.eachRight=ba,Fn.first=Wo,su(Fn,function(){var e={};return wr(Fn,(function(t,n){Me.call(Fn.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Fn.VERSION="4.17.21",Pt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Fn[e].placeholder=Fn})),Pt(["drop","take"],(function(e,t){qn.prototype[e]=function(n){n=n===i?1:Yt(hs(n),0);var r=this.__filtered__&&!t?new qn(this):this.clone();return r.__filtered__?r.__takeCount__=bn(n,r.__takeCount__):r.__views__.push({size:bn(n,m),type:e+(r.__dir__<0?"Right":"")}),r},qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Pt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;qn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Pt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");qn.prototype[e]=function(){return this[n](1).value()[0]}})),Pt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");qn.prototype[e]=function(){return this.__filtered__?new qn(this):this[n](1)}})),qn.prototype.compact=function(){return this.filter(ru)},qn.prototype.find=function(e){return this.filter(e).head()},qn.prototype.findLast=function(e){return this.reverse().find(e)},qn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new qn(this):this.map((function(n){return Cr(n,e,t)}))})),qn.prototype.reject=function(e){return this.filter(Ma(uo(e)))},qn.prototype.slice=function(e,t){e=hs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new qn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=hs(t))<0?n.dropRight(-t):n.take(t-e)),n)},qn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},qn.prototype.toArray=function(){return this.take(m)},wr(qn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Fn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Fn.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,u=t instanceof qn,c=s[0],l=u||qa(t),f=function(e){var t=o.apply(Fn,Lt([e],s));return r&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var d=this.__chain__,p=!!this.__actions__.length,h=a&&!d,v=u&&!p;if(!a&&l){t=v?t:new qn(this);var m=e.apply(t,s);return m.__actions__.push({func:pa,args:[f],thisArg:i}),new Hn(m,d)}return h&&v?e.apply(this,s):(m=this.thru(f),h?r?m.value()[0]:m.value():m)})})),Pt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ce[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Fn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(qa(i)?i:[],e)}return this[n]((function(n){return t.apply(qa(n)?n:[],e)}))}})),wr(qn.prototype,(function(e,t){var n=Fn[t];if(n){var r=n.name+"";Me.call(In,r)||(In[r]=[]),In[r].push({name:t,func:n})}})),In[Fi(i,2).name]=[{name:"wrapper",func:i}],qn.prototype.clone=function(){var e=new qn(this.__wrapped__);return e.__actions__=Pi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Pi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Pi(this.__views__),e},qn.prototype.reverse=function(){if(this.__filtered__){var e=new qn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},qn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=qa(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Fn.prototype.plant=function(e){for(var t,n=this;n instanceof zn;){var r=Bo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Fn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof qn){var t=e;return this.__actions__.length&&(t=new qn(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ea],thisArg:i}),new Hn(t,this.__chain__)}return this.thru(ea)},Fn.prototype.toJSON=Fn.prototype.valueOf=Fn.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Fn.prototype.first=Fn.prototype.head,Qe&&(Fn.prototype[Qe]=function(){return this}),Fn}();vt._=yn,(r=function(){return yn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},92736:function(e,t,n){var r=n(13109);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},34445:function(e,t,n){var r=n(61125),i=n(80171),o=n(98939),a=n(60925);e.exports=function(e){return o(e)?r(a(e)):i(e)}},72554:function(e){e.exports=function(){return[]}},95535:function(e){e.exports=function(){return!1}},11822:function(e,t,n){var r=n(21612);e.exports=function(e){return null==e?"":r(e)}},2985:function(e,t,n){"use strict";var r=n(56690).default,i=n(89728).default,o=n(97450),a=Symbol("max"),s=Symbol("length"),u=Symbol("lengthCalculator"),c=Symbol("allowStale"),l=Symbol("maxAge"),f=Symbol("dispose"),d=Symbol("noDisposeOnSet"),p=Symbol("lruList"),h=Symbol("cache"),v=Symbol("updateAgeOnGet"),m=function(){return 1},g=function(){function e(t){if(r(this,e),"number"===typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!==typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[a]=t.max||1/0;var n=t.length||m;if(this[u]="function"!==typeof n?m:n,this[c]=t.stale||!1,t.maxAge&&"number"!==typeof t.maxAge)throw new TypeError("maxAge must be a number");this[l]=t.maxAge||0,this[f]=t.dispose,this[d]=t.noDisposeOnSet||!1,this[v]=t.updateAgeOnGet||!1,this.reset()}return i(e,[{key:"max",get:function(){return this[a]},set:function(e){if("number"!==typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,w(this)}},{key:"allowStale",get:function(){return this[c]},set:function(e){this[c]=!!e}},{key:"maxAge",get:function(){return this[l]},set:function(e){if("number"!==typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,w(this)}},{key:"lengthCalculator",get:function(){return this[u]},set:function(e){var t=this;"function"!==typeof e&&(e=m),e!==this[u]&&(this[u]=e,this[s]=0,this[p].forEach((function(e){e.length=t[u](e.value,e.key),t[s]+=e.length}))),w(this)}},{key:"length",get:function(){return this[s]}},{key:"itemCount",get:function(){return this[p].length}},{key:"rforEach",value:function(e,t){t=t||this;for(var n=this[p].tail;null!==n;){var r=n.prev;_(this,e,n,t),n=r}}},{key:"forEach",value:function(e,t){t=t||this;for(var n=this[p].head;null!==n;){var r=n.next;_(this,e,n,t),n=r}}},{key:"keys",value:function(){return this[p].toArray().map((function(e){return e.key}))}},{key:"values",value:function(){return this[p].toArray().map((function(e){return e.value}))}},{key:"reset",value:function(){var e=this;this[f]&&this[p]&&this[p].length&&this[p].forEach((function(t){return e[f](t.key,t.value)})),this[h]=new Map,this[p]=new o,this[s]=0}},{key:"dump",value:function(){var e=this;return this[p].map((function(t){return!b(e,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}})).toArray().filter((function(e){return e}))}},{key:"dumpLru",value:function(){return this[p]}},{key:"set",value:function(e,t,n){if((n=n||this[l])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[u](t,e);if(this[h].has(e)){if(i>this[a])return x(this,this[h].get(e)),!1;var o=this[h].get(e).value;return this[f]&&(this[d]||this[f](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[s]+=i-o.length,o.length=i,this.get(e),w(this),!0}var c=new k(e,t,i,r,n);return c.length>this[a]?(this[f]&&this[f](e,t),!1):(this[s]+=c.length,this[p].unshift(c),this[h].set(e,this[p].head),w(this),!0)}},{key:"has",value:function(e){if(!this[h].has(e))return!1;var t=this[h].get(e).value;return!b(this,t)}},{key:"get",value:function(e){return y(this,e,!0)}},{key:"peek",value:function(e){return y(this,e,!1)}},{key:"pop",value:function(){var e=this[p].tail;return e?(x(this,e),e.value):null}},{key:"del",value:function(e){x(this,this[h].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var e=this;this[h].forEach((function(t,n){return y(e,n,!1)}))}}]),e}(),y=function(e,t,n){var r=e[h].get(t);if(r){var i=r.value;if(b(e,i)){if(x(e,r),!e[c])return}else n&&(e[v]&&(r.value.now=Date.now()),e[p].unshiftNode(r));return i.value}},b=function(e,t){if(!t||!t.maxAge&&!e[l])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},w=function(e){if(e[s]>e[a])for(var t=e[p].tail;e[s]>e[a]&&null!==t;){var n=t.prev;x(e,t),t=n}},x=function(e,t){if(t){var n=t.value;e[f]&&e[f](n.key,n.value),e[s]-=n.length,e[h].delete(n.key),e[p].removeNode(t)}},k=i((function e(t,n,i,o,a){r(this,e),this.key=t,this.value=n,this.length=i,this.now=o,this.maxAge=a||0})),_=function(e,t,n,r){var i=n.value;b(e,i)&&(x(e,n),e[c]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=g},23240:function(e,t,n){"use strict";var r=n(17061).default;e.exports=function(e){e.prototype[Symbol.iterator]=r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}}),e,this)}))}},97450:function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"===typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.init_by_array=function(e,t){var n,r,i;for(this.init_seed(19650218),n=1,r=0,i=this.N>t?this.N:t;i;i--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(1664525*((4294901760&o)>>>16)<<16)+1664525*(65535&o))+e[r]+r,this.mt[n]>>>=0,r++,++n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),r>=t&&(r=0)}for(i=this.N-1;i;i--){o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(1566083941*((4294901760&o)>>>16)<<16)+1566083941*(65535&o))-n,this.mt[n]>>>=0,++n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648},t.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^t[1&e];for(;n>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},t.prototype.random_int31=function(){return this.random_int()>>>1},t.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},t.prototype.random=function(){return this.random_int()*(1/4294967296)},t.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},t.prototype.random_long=function(){return(67108864*(this.random_int()>>>5)+(this.random_int()>>>6))*(1/9007199254740992)},e.exports=t},65701:function(e){function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},13265:function(e,t,n){"use strict";var r=n(74704).default,i=n(56690).default,o=n(89728).default,a=n(47700).encodeText,s=function(){function e(t,n,r,o){i(this,e),this.name=t,this.code=n,this.codeBuf=a(this.code),this.alphabet=o,this.codec=r(o)}return o(e,[{key:"encode",value:function(e){return this.codec.encode(e)}},{key:"decode",value:function(e){var t,n=r(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(this.alphabet&&this.alphabet.indexOf(i)<0)throw new Error("invalid character '".concat(i,"' in '").concat(e,"'"))}}catch(o){n.e(o)}finally{n.f()}return this.codec.decode(e)}}]),e}();e.exports=s},39278:function(e,t,n){"use strict";var r=n(17391),i=n(13265),o=n(71460).rfc4648,a=n(47700),s=a.decodeText,u=a.encodeText,c=[["identity","\0",function(){return{encode:s,decode:u}},""],["base2","0",o(1),"01"],["base8","7",o(3),"01234567"],["base10","9",r,"0123456789"],["base16","f",o(4),"0123456789abcdef"],["base16upper","F",o(4),"0123456789ABCDEF"],["base32hex","v",o(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",o(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",o(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",o(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",o(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",o(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",o(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",r,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",r,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",r,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",r,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],l=c.reduce((function(e,t){return e[t[0]]=new i(t[0],t[1],t[2],t[3]),e}),{}),f=c.reduce((function(e,t){return e[t[1]]=l[t[0]],e}),{});e.exports={names:l,codes:f}},51038:function(e,t,n){"use strict";var r=n(39278),i=n(47700),o=i.encodeText,a=i.decodeText,s=i.concat;function u(e){if(Object.prototype.hasOwnProperty.call(r.names,e))return r.names[e];if(Object.prototype.hasOwnProperty.call(r.codes,e))return r.codes[e];throw new Error("Unsupported encoding: ".concat(e))}(t=e.exports=function(e,t){if(!t)throw new Error("requires an encoded Uint8Array");var n=u(e),r=n.name,i=n.codeBuf;return function(e,t){var n=u(e);n.decode(a(t))}(r,t),s([i,t],i.length+t.length)}).encode=function(e,t){var n=u(e),r=o(n.encode(t));return s([n.codeBuf,r],n.codeBuf.length+r.length)},t.decode=function(e){e instanceof Uint8Array&&(e=a(e));var t=e[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase()),u(e[0]).decode(e.substring(1))},t.isEncoded=function(e){if(e instanceof Uint8Array&&(e=a(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return u(e[0]).name}catch(t){return!1}},t.encoding=u,t.encodingFromData=function(e){return e instanceof Uint8Array&&(e=a(e)),u(e[0])},t.names=Object.freeze(r.names),t.codes=Object.freeze(r.codes)},71460:function(e){"use strict";e.exports={rfc4648:function(e){return function(t){return{encode:function(n){return function(e,t,n){for(var r="="===t[t.length-1],i=(1<n;)o+=t[i&s>>(a-=n)];if(a&&(o+=t[i&s<=8&&(s-=8,a[c++]=255&u>>s)}if(s>=n||255&u<<8-s)throw new SyntaxError("Unexpected end of data");return a}(n,t,e)}}}}}},47700:function(e,t,n){"use strict";var r=n(74704).default,i=n(47770),o=i.TextEncoder,a=new(0,i.TextDecoder),s=new o;e.exports={decodeText:function(e){return a.decode(e)},encodeText:function(e){return s.encode(e)},concat:function(e,t){var n,i=new Uint8Array(t),o=0,a=r(e);try{for(a.s();!(n=a.n()).done;){var s=n.value;i.set(s,o),o+=s.length}}catch(u){a.e(u)}finally{a.f()}return i}}},64295:function(e,t,n){"use strict";var r=n(74704).default;e.exports=function(e,t){t||(t=e.reduce((function(e,t){return e+t.length}),0));var n,i=new Uint8Array(t),o=0,a=r(e);try{for(a.s();!(n=a.n()).done;){var s=n.value;i.set(s,o),o+=s.length}}catch(u){a.e(u)}finally{a.f()}return i}},93430:function(e,t,n){"use strict";var r=n(39278).names,i=new(0,n(47770).TextEncoder);e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if("utf8"===t||"utf-8"===t)return i.encode(e);if("ascii"===t)return function(e){for(var t=new Uint8Array(e.length),n=0;n1&&void 0!==arguments[1]?arguments[1]:"utf8";if("utf8"===t||"utf-8"===t)return i.decode(e);if("ascii"===t)return function(e){for(var t="",n=0;n=c||s>49)throw e.bytes=0,new RangeError("Could not decode varint");o=r[u++],a+=s<28?(o&n)<=t);return e.bytes=u-i,a};var t=128,n=127},68656:function(e){e.exports=function e(i,o,a){if(Number.MAX_SAFE_INTEGER&&i>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");o=o||[];var s=a=a||0;for(;i>=r;)o[a++]=255&i|t,i/=128;for(;i&n;)o[a++]=255&i|t,i>>>=7;return o[a]=0|i,e.bytes=a-s+1,o};var t=128,n=-128,r=Math.pow(2,31)},47837:function(e,t,n){e.exports={encode:n(68656),decode:n(82651),encodingLength:n(15948)}},15948:function(e){var t=Math.pow(2,7),n=Math.pow(2,14),r=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),a=Math.pow(2,42),s=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e1&&void 0!==arguments[1]?arguments[1]:"utf8",n=r[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return n.decoder.decode("".concat(n.prefix).concat(e))}},61202:function(e,t,n){"use strict";var r=n(61579);e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",n=r[t];if(!n)throw new Error('Unsupported encoding "'.concat(t,'"'));return n.encoder.encode(e).substring(1)}},61579:function(e,t,n){"use strict";var r=n(42122).default,i=n(9998).bases;function o(e,t,n,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:n},decoder:{decode:r}}}var a=o("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),s=o("ascii","a",(function(e){for(var t="a",n=0;n=c||s>49)throw e.bytes=0,new RangeError("Could not decode varint");o=r[u++],a+=s<28?(o&n)<=t);return e.bytes=u-i,a};var t=128,n=127},29599:function(e){e.exports=function e(i,o,a){if(Number.MAX_SAFE_INTEGER&&i>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");o=o||[];var s=a=a||0;for(;i>=r;)o[a++]=255&i|t,i/=128;for(;i&n;)o[a++]=255&i|t,i>>>=7;return o[a]=0|i,e.bytes=a-s+1,o};var t=128,n=-128,r=Math.pow(2,31)},44734:function(e,t,n){e.exports={encode:n(29599),decode:n(49842),encodingLength:n(18995)}},18995:function(e){var t=Math.pow(2,7),n=Math.pow(2,14),r=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),a=Math.pow(2,42),s=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e 2 bytes.");var t=i.decode(e);if(!v(t))throw new Error("multihash unknown function code: 0x".concat(t.toString(16)));e=e.slice(i.decode.bytes);var n=i.decode(e);if(n<0)throw new Error("multihash invalid length: ".concat(n));if((e=e.slice(i.decode.bytes)).length!==n)throw new Error("multihash length inconsistent: 0x".concat(a(e,"base16")));return{code:t,name:c[t],length:n,digest:e}}function p(e){var t=e;if("string"===typeof e){if(void 0===o[e])throw new Error("Unrecognized hash function named: ".concat(e));t=o[e]}if("number"!==typeof t)throw new Error("Hash function code should be a number. Got: ".concat(t));if(void 0===c[t]&&!h(t))throw new Error("Unrecognized function code: ".concat(t));return t}function h(e){return e>0&&e<16}function v(e){return!!h(e)||!!c[e]}function m(e){d(e)}e.exports={names:o,codes:Object.freeze(c),toHexString:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return a(e,"base16")},fromHexString:function(e){return s(e,"base16")},toB58String:function(e){if(!(e instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return a(r.encode("base58btc",e)).slice(1)},fromB58String:function(e){var t=e instanceof Uint8Array?a(e):e;return r.decode("z"+t)},decode:d,encode:function(e,t,n){if(!e||void 0===t)throw new Error("multihash encode requires at least two args: digest, code");var r=p(t);if(!(e instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(null==n&&(n=e.length),n&&e.length!==n)throw new Error("digest length should be equal to specified length.");var o=i.encode(r),a=i.encode(n);return u([o,a,e],o.length+a.length+e.length)},coerceCode:p,isAppCode:h,validate:m,prefix:function(e){return m(e),e.subarray(0,2)},isValidCode:v}},25636:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=r(n(21247)),o=r(n(55948));i.default.DefaultOpts.ImageClass=o.default,e.exports=i.default},69287:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(21247)),o=n(54161),a=function(){function e(e,t){void 0===t&&(t={}),this._src=e,this._opts=t,this._opts.filters=o(i.default.DefaultOpts.filters)}return e.prototype.maxColorCount=function(e){return this._opts.colorCount=e,this},e.prototype.maxDimension=function(e){return this._opts.maxDimension=e,this},e.prototype.addFilter=function(e){return this._opts.filters.push(e),this},e.prototype.removeFilter=function(e){var t=this._opts.filters.indexOf(e);return t>0&&this._opts.filters.splice(t),this},e.prototype.clearFilters=function(){return this._opts.filters=[],this},e.prototype.quality=function(e){return this._opts.quality=e,this},e.prototype.useImageClass=function(e){return this._opts.ImageClass=e,this},e.prototype.useGenerator=function(e){return this._opts.generator=e,this},e.prototype.useQuantizer=function(e){return this._opts.quantizer=e,this},e.prototype.build=function(){return new i.default(this._src,this._opts)},e.prototype.getPalette=function(e){return this.build().getPalette(e)},e.prototype.getSwatches=function(e){return this.build().getPalette(e)},e}();t.default=a},42956:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Swatch=void 0;var r=n(16241),i=n(60823),o=function(){function e(e,t){this._rgb=e,this._population=t}return e.applyFilter=function(e,t){return"function"===typeof t?i(e,(function(e){var n=e.r,r=e.g,i=e.b;return t(n,r,i,255)})):e},Object.defineProperty(e.prototype,"r",{get:function(){return this._rgb[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._rgb[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this._rgb[2]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rgb",{get:function(){return this._rgb},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hsl",{get:function(){if(!this._hsl){var e=this._rgb,t=e[0],n=e[1],i=e[2];this._hsl=r.rgbToHsl(t,n,i)}return this._hsl},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hex",{get:function(){if(!this._hex){var e=this._rgb,t=e[0],n=e[1],i=e[2];this._hex=r.rgbToHex(t,n,i)}return this._hex},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"population",{get:function(){return this._population},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return{rgb:this.rgb,population:this.population}},e.prototype.getRgb=function(){return this._rgb},e.prototype.getHsl=function(){return this.hsl},e.prototype.getPopulation=function(){return this._population},e.prototype.getHex=function(){return this.hex},e.prototype.getYiq=function(){if(!this._yiq){var e=this._rgb;this._yiq=(299*e[0]+587*e[1]+114*e[2])/1e3}return this._yiq},Object.defineProperty(e.prototype,"titleTextColor",{get:function(){return this._titleTextColor||(this._titleTextColor=this.getYiq()<200?"#fff":"#000"),this._titleTextColor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bodyTextColor",{get:function(){return this._bodyTextColor||(this._bodyTextColor=this.getYiq()<150?"#fff":"#000"),this._bodyTextColor},enumerable:!1,configurable:!0}),e.prototype.getTitleTextColor=function(){return this.titleTextColor},e.prototype.getBodyTextColor=function(){return this.bodyTextColor},e}();t.Swatch=o},59550:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r){return r>=125&&!(e>250&&t>250&&n>250)}},7547:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.combineFilters=void 0;var r=n(59550);Object.defineProperty(t,"Default",{enumerable:!0,get:function(){return r.default}}),t.combineFilters=function(e){return Array.isArray(e)&&0!==e.length?function(t,n,r,i){if(0===i)return!1;for(var o=0;o=s&&p<=u&&h>=i&&h<=o&&!function(e,t){return e.Vibrant===t||e.DarkVibrant===t||e.LightVibrant===t||e.Muted===t||e.DarkMuted===t||e.LightMuted===t}(e,t)){var v=function(e,t,n,r,i,o,a){function s(e,t){return 1-Math.abs(e-t)}return function(){for(var e=[],t=0;tf)&&(l=t,f=v)}})),l}t.default=function(e,t){t=o({},t,a);var n=function(e){var t=0;return e.forEach((function(e){t=Math.max(t,e.getPopulation())})),t}(e),u=function(e,t,n){var r={};return r.Vibrant=s(r,e,t,n.targetNormalLuma,n.minNormalLuma,n.maxNormalLuma,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.LightVibrant=s(r,e,t,n.targetLightLuma,n.minLightLuma,1,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.DarkVibrant=s(r,e,t,n.targetDarkLuma,0,n.maxDarkLuma,n.targetVibrantSaturation,n.minVibrantSaturation,1,n),r.Muted=s(r,e,t,n.targetNormalLuma,n.minNormalLuma,n.maxNormalLuma,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r.LightMuted=s(r,e,t,n.targetLightLuma,n.minLightLuma,1,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r.DarkMuted=s(r,e,t,n.targetDarkLuma,0,n.maxDarkLuma,n.targetMutesSaturation,0,n.maxMutesSaturation,n),r}(e,n,t);return function(e,t,n){if(null===e.Vibrant&&null===e.DarkVibrant&&null===e.LightVibrant){if(null===e.DarkVibrant&&null!==e.DarkMuted){var o=e.DarkMuted.getHsl(),a=o[0],s=o[1],u=o[2];u=n.targetDarkLuma,e.DarkVibrant=new r.Swatch(i.hslToRgb(a,s,u),0)}if(null===e.LightVibrant&&null!==e.LightMuted){var c=e.LightMuted.getHsl();a=c[0],s=c[1],u=c[2],u=n.targetDarkLuma,e.DarkVibrant=new r.Swatch(i.hslToRgb(a,s,u),0)}}if(null===e.Vibrant&&null!==e.DarkVibrant){var l=e.DarkVibrant.getHsl();a=l[0],s=l[1],u=l[2],u=n.targetNormalLuma,e.Vibrant=new r.Swatch(i.hslToRgb(a,s,u),0)}else if(null===e.Vibrant&&null!==e.LightVibrant){var f=e.LightVibrant.getHsl();a=f[0],s=f[1],u=f[2],u=n.targetNormalLuma,e.Vibrant=new r.Swatch(i.hslToRgb(a,s,u),0)}if(null===e.DarkVibrant&&null!==e.Vibrant){var d=e.Vibrant.getHsl();a=d[0],s=d[1],u=d[2],u=n.targetDarkLuma,e.DarkVibrant=new r.Swatch(i.hslToRgb(a,s,u),0)}if(null===e.LightVibrant&&null!==e.Vibrant){var p=e.Vibrant.getHsl();a=p[0],s=p[1],u=p[2],u=n.targetLightLuma,e.LightVibrant=new r.Swatch(i.hslToRgb(a,s,u),0)}if(null===e.Muted&&null!==e.Vibrant){var h=e.Vibrant.getHsl();a=h[0],s=h[1],u=h[2],u=n.targetMutesSaturation,e.Muted=new r.Swatch(i.hslToRgb(a,s,u),0)}if(null===e.DarkMuted&&null!==e.DarkVibrant){var v=e.DarkVibrant.getHsl();a=v[0],s=v[1],u=v[2],u=n.targetMutesSaturation,e.DarkMuted=new r.Swatch(i.hslToRgb(a,s,u),0)}if(null===e.LightMuted&&null!==e.LightVibrant){var m=e.LightVibrant.getHsl();a=m[0],s=m[1],u=m[2],u=n.targetMutesSaturation,e.LightMuted=new r.Swatch(i.hslToRgb(a,s,u),0)}}(u,0,t),u}},44379:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(61677);Object.defineProperty(t,"Default",{enumerable:!0,get:function(){return r.default}})},66802:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageBase=void 0;var n=function(){function e(){}return e.prototype.scaleDown=function(e){var t=this.getWidth(),n=this.getHeight(),r=1;if(e.maxDimension>0){var i=Math.max(t,n);i>e.maxDimension&&(r=e.maxDimension/i)}else r=1/e.quality;r<1&&this.resize(t*r,n*r,r)},e.prototype.applyFilter=function(e){var t=this.getImageData();if("function"===typeof e)for(var n=t.data,r=n.length/4,i=void 0,o=0;o0))break;var i=r.split(),o=i[0],a=i[1];if(e.push(o),a&&a.count()>0&&e.push(a),e.size()===n)break;n=e.size()}}t.default=function(e,t){if(0===e.length||t.colorCount<2||t.colorCount>256)throw new Error("Wrong MMCQ parameters");var n=o.default.build(e),r=n.hist,u=(Object.keys(r).length,new a.default((function(e,t){return e.count()-t.count()})));u.push(n),s(u,.75*t.colorCount);var c=new a.default((function(e,t){return e.count()*e.volume()-t.count()*t.volume()}));return c.contents=u.contents,s(c,t.colorCount-c.size()),function(e){var t=[];for(;e.size();){var n=e.pop(),r=n.avg();r[0],r[1],r[2];t.push(new i.Swatch(r,n.count()))}return t}(c)}},43425:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._comparator=e,this.contents=[],this._sorted=!1}return e.prototype._sort=function(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)},e.prototype.push=function(e){this.contents.push(e),this._sorted=!1},e.prototype.peek=function(e){return this._sort(),e="number"===typeof e?e:this.contents.length-1,this.contents[e]},e.prototype.pop=function(){return this._sort(),this.contents.pop()},e.prototype.size=function(){return this.contents.length},e.prototype.map=function(e){return this._sort(),this.contents.map(e)},e}();t.default=n},40083:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16241),i=function(){function e(e,t,n,r,i,o,a){this._volume=-1,this._count=-1,this.dimension={r1:e,r2:t,g1:n,g2:r,b1:i,b2:o},this.hist=a}return e.build=function(t,n){var i,o,a,s,u,c,l,f,d,p=1<<3*r.SIGBITS,h=new Uint32Array(p);i=a=u=0,o=s=c=Number.MAX_VALUE;for(var v=t.length/4,m=0;m>=r.RSHIFT,f>>=r.RSHIFT,d>>=r.RSHIFT,h[r.getColorIndex(l,f,d)]+=1,l>i&&(i=l),la&&(a=f),fu&&(u=d),d>=r.RSHIFT,n>>=r.RSHIFT,i>>=r.RSHIFT,t>=a&&t<=s&&n>=u&&n<=c&&i>=l&&i<=f},e.prototype.split=function(){var e=this.hist,t=this.dimension,n=t.r1,i=t.r2,o=t.g1,a=t.g2,s=t.b1,u=t.b2,c=this.count();if(!c)return[];if(1===c)return[this.clone()];var l,f,d=i-n+1,p=a-o+1,h=u-s+1,v=Math.max(d,p,h),m=null;l=f=0;var g=null;if(v===d){g="r",m=new Uint32Array(i+1);for(var y=n;y<=i;y++){l=0;for(var b=o;b<=a;b++)for(var w=s;w<=u;w++){l+=e[r.getColorIndex(y,b,w)]}f+=l,m[y]=f}}else if(v===p){g="g",m=new Uint32Array(a+1);for(b=o;b<=a;b++){l=0;for(y=n;y<=i;y++)for(w=s;w<=u;w++){l+=e[r.getColorIndex(y,b,w)]}f+=l,m[b]=f}}else{g="b",m=new Uint32Array(u+1);for(w=s;w<=u;w++){l=0;for(y=n;y<=i;y++)for(b=o;b<=a;b++){l+=e[r.getColorIndex(y,b,w)]}f+=l,m[w]=f}}for(var x=-1,k=new Uint32Array(m.length),_=0;_f/2&&(x=_),k[_]=f-E}var A=this;return function(e){var t=e+"1",n=e+"2",r=A.dimension[t],i=A.dimension[n],o=A.clone(),a=A.clone(),s=x-r,u=i-x;for(s<=u?(i=Math.min(i-1,~~(x+u/2)),i=Math.max(0,i)):(i=Math.max(r,~~(x-1-s/2)),i=Math.min(A.dimension[n],i));!m[i];)i++;for(var c=k[i];!c&&m[i-1];)c=k[--i];return o.dimension[n]=i,a.dimension[t]=i+1,[o,a]}(g)},e}();t.default=i},16241:function(e,t){"use strict";function n(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return null===t?null:[t[1],t[2],t[3]].map((function(e){return parseInt(e,16)}))}function r(e,t,n){return t/=255,n/=255,e=(e/=255)>.04045?Math.pow((e+.005)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.005)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.005)/1.055,2.4):n/12.92,[.4124*(e*=100)+.3576*(t*=100)+.1805*(n*=100),.2126*e+.7152*t+.0722*n,.0193*e+.1192*t+.9505*n]}function i(e,t,n){return t/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(t=t>.008856?Math.pow(t,1/3):7.787*t+16/116)-16,500*(e-t),200*(t-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]}function o(e,t,n){var o=r(e,t,n);return i(o[0],o[1],o[2])}function a(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2],u=n-o,c=r-a,l=i-s,f=Math.sqrt(r*r+i*i),d=o-n,p=Math.sqrt(a*a+s*s)-f,h=Math.sqrt(u*u+c*c+l*l),v=Math.sqrt(h)>Math.sqrt(Math.abs(d))+Math.sqrt(Math.abs(p))?Math.sqrt(h*h-d*d-p*p):0;return d/=1,p/=1*(1+.045*f),v/=1*(1+.015*f),Math.sqrt(d*d+p*p+v*v)}function s(e,t){return a(o.apply(void 0,e),o.apply(void 0,t))}Object.defineProperty(t,"__esModule",{value:!0}),t.getColorIndex=t.getColorDiffStatus=t.hexDiff=t.rgbDiff=t.deltaE94=t.rgbToCIELab=t.xyzToCIELab=t.rgbToXyz=t.hslToRgb=t.rgbToHsl=t.rgbToHex=t.hexToRgb=t.defer=t.RSHIFT=t.SIGBITS=t.DELTAE94_DIFF_STATUS=void 0,t.DELTAE94_DIFF_STATUS={NA:0,PERFECT:1,CLOSE:2,GOOD:10,SIMILAR:50},t.SIGBITS=5,t.RSHIFT=8-t.SIGBITS,t.defer=function(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return{resolve:e,reject:t,promise:n}},t.hexToRgb=n,t.rgbToHex=function(e,t,n){return"#"+((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1,7)},t.rgbToHsl=function(e,t,n){e/=255,t/=255,n/=255;var r,i,o=Math.max(e,t,n),a=Math.min(e,t,n),s=(o+a)/2;if(o===a)r=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case e:r=(t-n)/u+(t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0===t)r=i=o=n;else{var s=n<.5?n*(1+t):n+t-n*t,u=2*n-s;r=a(u,s,e+1/3),i=a(u,s,e),o=a(u,s,e-1/3)}return[255*r,255*i,255*o]},t.rgbToXyz=r,t.xyzToCIELab=i,t.rgbToCIELab=o,t.deltaE94=a,t.rgbDiff=s,t.hexDiff=function(e,t){return s(n(e),n(t))},t.getColorDiffStatus=function(e){return e-1e3&&e<1e3||k.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"===typeof e){var r=e<0?-S(-e):S(e);if(r!==e){var i=String(r),o=y.call(t,i.length+1);return b.call(i,n,"$&_")+"."+b.call(b.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,n,"$&_")}var M=n(24654),L=M.custom,U=z(L)?L:null;function D(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function B(e){return b.call(String(e),/"/g,""")}function F(e){return"[object Array]"===V(e)&&(!I||!("object"===typeof e&&I in e))}function Z(e){return"[object RegExp]"===V(e)&&(!I||!("object"===typeof e&&I in e))}function z(e){if(C)return e&&"object"===typeof e&&e instanceof Symbol;if("symbol"===typeof e)return!0;if(!e||"object"!==typeof e||!P)return!1;try{return P.call(e),!0}catch(t){}return!1}e.exports=function e(t,n,r,i){var s=n||{};if(q(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(s,"maxStringLength")&&("number"===typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!q(s,"customInspect")||s.customInspect;if("boolean"!==typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(s,"numericSeparator")&&"boolean"!==typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var v=s.numericSeparator;if("undefined"===typeof t)return"undefined";if(null===t)return"null";if("boolean"===typeof t)return t?"true":"false";if("string"===typeof t)return G(t,s);if("number"===typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return v?N(t,w):w}if("bigint"===typeof t){var k=String(t)+"n";return v?N(t,k):k}var S="undefined"===typeof s.depth?5:s.depth;if("undefined"===typeof r&&(r=0),r>=S&&S>0&&"object"===typeof t)return F(t)?"[Array]":"[Object]";var T=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"===typeof e.indent&&e.indent>0))return null;n=E.call(Array(e.indent+1)," ")}return{base:n,prev:E.call(Array(t+1),n)}}(s,r);if("undefined"===typeof i)i=[];else if(W(i,t)>=0)return"[Circular]";function L(t,n,o){if(n&&(i=A.call(i)).push(n),o){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,i)}return e(t,s,r+1,i)}if("function"===typeof t&&!Z(t)){var H=function(e){if(e.name)return e.name;var t=g.call(m.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),Y=$(t,L);return"[Function"+(H?": "+H:" (anonymous)")+"]"+(Y.length>0?" { "+E.call(Y,", ")+" }":"")}if(z(t)){var ee=C?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):P.call(t);return"object"!==typeof t||C?ee:K(ee)}if(function(e){if(!e||"object"!==typeof e)return!1;if("undefined"!==typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"===typeof e.nodeName&&"function"===typeof e.getAttribute}(t)){for(var te="<"+x.call(String(t.nodeName)),ne=t.attributes||[],re=0;re"}if(F(t)){if(0===t.length)return"[]";var ie=$(t,L);return T&&!function(e){for(var t=0;t=0)return!1;return!0}(ie)?"["+X(ie,T)+"]":"[ "+E.call(ie,", ")+" ]"}if(function(e){return"[object Error]"===V(e)&&(!I||!("object"===typeof e&&I in e))}(t)){var oe=$(t,L);return"cause"in Error.prototype||!("cause"in t)||R.call(t,"cause")?0===oe.length?"["+String(t)+"]":"{ ["+String(t)+"] "+E.call(oe,", ")+" }":"{ ["+String(t)+"] "+E.call(_.call("[cause]: "+L(t.cause),oe),", ")+" }"}if("object"===typeof t&&u){if(U&&"function"===typeof t[U]&&M)return M(t,{depth:S-r});if("symbol"!==u&&"function"===typeof t.inspect)return t.inspect()}if(function(e){if(!o||!e||"object"!==typeof e)return!1;try{o.call(e);try{c.call(e)}catch(te){return!0}return e instanceof Map}catch(t){}return!1}(t)){var ae=[];return a&&a.call(t,(function(e,n){ae.push(L(n,t,!0)+" => "+L(e,t))})),Q("Map",o.call(t),ae,T)}if(function(e){if(!c||!e||"object"!==typeof e)return!1;try{c.call(e);try{o.call(e)}catch(t){return!0}return e instanceof Set}catch(n){}return!1}(t)){var se=[];return l&&l.call(t,(function(e){se.push(L(e,t))})),Q("Set",c.call(t),se,T)}if(function(e){if(!f||!e||"object"!==typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(te){return!0}return e instanceof WeakMap}catch(t){}return!1}(t))return J("WeakMap");if(function(e){if(!d||!e||"object"!==typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(te){return!0}return e instanceof WeakSet}catch(t){}return!1}(t))return J("WeakSet");if(function(e){if(!p||!e||"object"!==typeof e)return!1;try{return p.call(e),!0}catch(t){}return!1}(t))return J("WeakRef");if(function(e){return"[object Number]"===V(e)&&(!I||!("object"===typeof e&&I in e))}(t))return K(L(Number(t)));if(function(e){if(!e||"object"!==typeof e||!O)return!1;try{return O.call(e),!0}catch(t){}return!1}(t))return K(L(O.call(t)));if(function(e){return"[object Boolean]"===V(e)&&(!I||!("object"===typeof e&&I in e))}(t))return K(h.call(t));if(function(e){return"[object String]"===V(e)&&(!I||!("object"===typeof e&&I in e))}(t))return K(L(String(t)));if(!function(e){return"[object Date]"===V(e)&&(!I||!("object"===typeof e&&I in e))}(t)&&!Z(t)){var ue=$(t,L),ce=j?j(t)===Object.prototype:t instanceof Object||t.constructor===Object,le=t instanceof Object?"":"null prototype",fe=!ce&&I&&Object(t)===t&&I in t?y.call(V(t),8,-1):le?"Object":"",de=(ce||"function"!==typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fe||le?"["+E.call(_.call([],fe||[],le||[]),": ")+"] ":"");return 0===ue.length?de+"{}":T?de+"{"+X(ue,T)+"}":de+"{ "+E.call(ue,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function q(e,t){return H.call(e,t)}function V(e){return v.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return G(y.call(e,0,t.maxStringLength),t)+r}return D(b.call(b.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Y),"single",t)}function Y(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function K(e){return"Object("+e+")"}function J(e){return e+" { ? }"}function Q(e,t,n,r){return e+" ("+t+") {"+(r?X(n,r):E.call(n,", "))+"}"}function X(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+E.call(e,","+n)+"\n"+t.prev}function $(e,t){var n=F(e),r=[];if(n){r.length=e.length;for(var i=0;i2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return b(e,s,i,o,null)}function b(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++o:a};return null==a&&null!=i.vnode&&i.vnode(s),s}function w(){return{current:null}}function x(e){return e.children}function k(e,t){this.props=e,this.context=t}function _(e,t){if(null==t)return e.__?_(e.__,e.__.__k.indexOf(e)+1):null;for(var n;tt&&s.sort(l));S.__r=0}function O(e,t,n,r,i,o,a,s,u,c,l){var f,h,m,g,y,w,k,E,A,S=0,O=r&&r.__k||p,P=O.length,R=P,j=t.length;for(n.__k=[],f=0;f0?b(g.type,g.props,g.key,g.ref?g.ref:null,g.__v):g)?(g.__=n,g.__b=n.__b+1,-1===(E=I(g,O,k=f+S,R))?m=d:(m=O[E]||d,O[E]=void 0,R--),L(e,g,m,i,o,a,s,u,c,l),y=g.__e,(h=g.ref)&&m.ref!=h&&(m.ref&&B(m.ref,null,g),l.push(h,g.__c||y,g)),null!=y&&(null==w&&(w=y),(A=m===d||null===m.__v)?-1==E&&S--:E!==k&&(E===k+1?S++:E>k?R>j-k?S+=E-k:S--:S=E(null!=u?1:0))for(;a>=0||s=0){if((u=t[a])&&i==u.key&&o===u.type)return a;a--}if(s2&&(u.children=arguments.length>3?r.call(arguments,2):n),b(e.type,u,i||e.key,o||e.ref,null)}function V(e,t){var n={__c:t="__cC"+f++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,A(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=p.slice,i={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},o=0,a=function(e){return null!=e&&void 0===e.constructor},k.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},n),this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),A(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},k.prototype.render=x,s=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},S.__r=0,f=0},98944:function(e,t,n){"use strict";n.r(t),n.d(t,{useCallback:function(){return E},useContext:function(){return A},useDebugValue:function(){return S},useEffect:function(){return b},useErrorBoundary:function(){return O},useId:function(){return T},useImperativeHandle:function(){return k},useLayoutEffect:function(){return w},useMemo:function(){return _},useReducer:function(){return y},useRef:function(){return x},useState:function(){return g}});var r,i,o,a,s=n(73856),u=0,c=[],l=[],f=s.options.__b,d=s.options.__r,p=s.options.diffed,h=s.options.__c,v=s.options.unmount;function m(e,t){s.options.__h&&s.options.__h(i,e,u||t),u=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:l}),n.__[e]}function g(e){return u=1,y(M,e)}function y(e,t,n){var o=m(r++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):M(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=i,!i.u)){var a=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter((function(e){return e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var i=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),!(!i&&o.__c.props===e)&&(!s||s.call(this,e,t,n))};i.u=!0;var s=i.shouldComponentUpdate,u=i.componentWillUpdate;i.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}u&&u.call(this,e,t,n)},i.shouldComponentUpdate=a}return o.__N||o.__}function b(e,t){var n=m(r++,3);!s.options.__s&&N(n.__H,t)&&(n.__=e,n.i=t,i.__H.__h.push(n))}function w(e,t){var n=m(r++,4);!s.options.__s&&N(n.__H,t)&&(n.__=e,n.i=t,i.__h.push(n))}function x(e){return u=5,_((function(){return{current:e}}),[])}function k(e,t,n){u=6,w((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function _(e,t){var n=m(r++,7);return N(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function E(e,t){return u=8,_((function(){return e}),t)}function A(e){var t=i.context[e.__c],n=m(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(i)),t.props.value):e.__}function S(e,t){s.options.useDebugValue&&s.options.useDebugValue(t?t(e):e)}function O(e){var t=m(r++,10),n=g();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function T(){var e=m(r++,11);if(!e.__){for(var t=i.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function P(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(R),e.__H.__h.forEach(j),e.__H.__h=[]}catch(i){e.__H.__h=[],s.options.__e(i,e.__v)}}s.options.__b=function(e){i=null,f&&f(e)},s.options.__r=function(e){d&&d(e),r=0;var t=(i=e.__c).__H;t&&(o===i?(t.__h=[],i.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=l,e.__N=e.i=void 0}))):(t.__h.forEach(R),t.__h.forEach(j),t.__h=[],r=0)),o=i},s.options.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&a===s.options.requestAnimationFrame||((a=s.options.requestAnimationFrame)||I)(P)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==l&&(e.__=e.__V),e.i=void 0,e.__V=l}))),o=i=null},s.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(R),e.__h=e.__h.filter((function(e){return!e.__||j(e)}))}catch(o){t.some((function(e){e.__h&&(e.__h=[])})),t=[],s.options.__e(o,e.__v)}})),h&&h(e,t)},s.options.unmount=function(e){v&&v(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{R(e)}catch(e){t=e}})),n.__H=void 0,t&&s.options.__e(t,n.__v))};var C="function"==typeof requestAnimationFrame;function I(e){var t,n=function(){clearTimeout(r),C&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);C&&(t=requestAnimationFrame(n))}function R(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function j(e){var t=i;e.__c=e.__(),i=t}function N(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function M(e,t){return"function"==typeof t?t(e):t}},61729:function(e,t,n){"use strict";var r=n(79165);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},75192:function(e,t,n){e.exports=n(61729)()},79165:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5609:function(e){"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC1738",i="RFC3986";e.exports={default:i,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:r,RFC3986:i}},74776:function(e,t,n){"use strict";var r=n(2816),i=n(67668),o=n(5609);e.exports={formats:o,parse:i,stringify:r}},67668:function(e,t,n){"use strict";var r=n(49837),i=Object.prototype.hasOwnProperty,o=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},u=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,n,r){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(o),c=s?o.slice(0,s.index):o,l=[];if(c){if(!n.plainObjects&&i.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var f=0;n.depth>0&&null!==(s=a.exec(o))&&f=0;--o){var a,s=e[o];if("[]"===s&&n.parseArrays)a=[].concat(i);else{a=n.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(c,10);n.parseArrays||""!==c?!isNaN(l)&&s!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(a=[])[l]=i:"__proto__"!==c&&(a[c]=i):a={0:i}}i=a}return i}(l,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!==typeof e.decoder)throw new TypeError("Decoder has to be a function.");if("undefined"!==typeof e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t="undefined"===typeof e.charset?a.charset:e.charset;return{allowDots:"undefined"===typeof e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"===typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"===typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"===typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"===typeof e.comma?e.comma:a.comma,decoder:"function"===typeof e.decoder?e.decoder:a.decoder,delimiter:"string"===typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"===typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"===typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"===typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"===typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null===e||"undefined"===typeof e)return n.plainObjects?Object.create(null):{};for(var l="string"===typeof e?function(e,t){var n,c={__proto__:null},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,f=t.parameterLimit===1/0?void 0:t.parameterLimit,d=l.split(t.delimiter,f),p=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(m=o(m)?[m]:m),i.call(c,v)?c[v]=r.combine(c[v],m):c[v]=m}return c}(e,n):e,f=n.plainObjects?Object.create(null):{},d=Object.keys(l),p=0;p0?_.join(",")||null:void 0}];else if(u(d))T=d;else{var C=Object.keys(_);T=v?C.sort(v):C}for(var I=a&&u(_)&&1===_.length?n+"[]":n,R=0;R0?x+w:""}},49837:function(e,t,n){"use strict";var r=n(5609),i=Object.prototype.hasOwnProperty,o=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r1;){var t=e.pop(),n=t.obj[t.prop];if(o(n)){for(var r=[],i=0;i=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||o===r.RFC1738&&(40===l||41===l)?u+=s.charAt(c):l<128?u+=a[l]:l<2048?u+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?u+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(c+=1,l=65536+((1023&l)<<10|1023&s.charCodeAt(c)),u+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return u},isBuffer:function(e){return!(!e||"object"!==typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var n=[],r=0;r0&&u>s&&(u=s);for(var c=0;c=0?(l=h.substr(0,v),f=h.substr(v+1)):(l=h,f=""),d=decodeURIComponent(l),p=decodeURIComponent(f),t(o,d)?Array.isArray(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o}},33033:function(e){"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,i){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"===typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+r;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(n):o+encodeURIComponent(t(e[i]))})).join(n):i?encodeURIComponent(t(i))+r+encodeURIComponent(t(e)):""}},52902:function(e,t,n){"use strict";t.decode=t.parse=n(29605),t.encode=t.stringify=n(33033)},75960:function(e){"use strict";function t(e){try{return JSON.stringify(e)}catch(t){return'"[Circular]"'}}e.exports=function(e,n,r){var i=r&&r.stringify||t;if("object"===typeof e&&null!==e){var o=n.length+1;if(1===o)return e;var a=new Array(o);a[0]=i(e);for(var s=1;s-1?f:0,e.charCodeAt(p+1)){case 100:case 102:if(l>=u)break;if(null==n[l])break;f=u)break;if(null==n[l])break;f=u)break;if(void 0===n[l])break;f",f=p+2,p++;break}c+=i(n[l]),f=p+2,p++;break;case 115:if(l>=u)break;f',(ee=te.firstChild).style.behavior="url(#default#VML)",!ee||"object"!=typeof ee.adj)return t.type=m;te=null}function ne(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)e[c](n)&&(t[n]=ne(e[n]));return t}t.svg=!(t.vml="VML"==t.type),t._Paper=d,t.fn=r=d.prototype=t.prototype,t._id=0,t.is=function(e,t){return"finite"==(t=k.call(t))?!j[c](+e):"array"==t?e instanceof Array:"null"==t&&null===e||t==typeof e&&null!==e||"object"==t&&e===Object(e)||"array"==t&&Array.isArray&&Array.isArray(e)||I.call(e).slice(8,-1).toLowerCase()==t},t.angle=function(e,n,r,i,o,a){if(null==o){var s=e-r,u=n-i;return s||u?(180+180*_.atan2(-u,-s)/T+360)%360:0}return t.angle(e,n,o,a)-t.angle(r,i,o,a)},t.rad=function(e){return e%360*T/180},t.deg=function(e){return Math.round(180*e/T%360*1e3)/1e3},t.snapTo=function(e,n,r){if(r=t.is(r,"finite")?r:10,t.is(e,C)){for(var i=e.length;i--;)if(S(e[i]-n)<=r)return e[i]}else{var o=n%(e=+e);if(oe-r)return n-o+e}return n},t.createUUID=(i=/[xy]/g,o=function(e){var t=16*_.random()|0;return("x"==e?t:3&t|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,o).toUpperCase()}),t.setWindow=function(n){e("raphael.setWindow",t,l.win,n),l.win=n,l.doc=l.win.document,t._engine.initWin&&t._engine.initWin(l.win)};var re=function(e){if(t.vml){var n,r=/^\s+|\s+$/g;try{var i=new ActiveXObject("htmlfile");i.write(""),i.close(),n=i.body}catch(e){n=createPopup().document.body}var o=n.createTextRange();re=ce((function(e){try{n.style.color=y(e).replace(r,m);var t=o.queryCommandValue("ForeColor");return"#"+("000000"+(t=(255&t)<<16|65280&t|(16711680&t)>>>16).toString(16)).slice(-6)}catch(e){return"none"}}))}else{var a=l.doc.createElement("i");a.title="Rapha\xebl Colour Picker",a.style.display="none",l.doc.body.appendChild(a),re=ce((function(e){return a.style.color=e,l.doc.defaultView.getComputedStyle(a,m).getPropertyValue("color")}))}return re(e)},ie=function(){return"hsb("+[this.h,this.s,this.b]+")"},oe=function(){return"hsl("+[this.h,this.s,this.l]+")"},ae=function(){return this.hex},se=function(e,n,r){if(null==n&&t.is(e,"object")&&"r"in e&&"g"in e&&"b"in e&&(r=e.b,n=e.g,e=e.r),null==n&&t.is(e,"string")){var i=t.getRGB(e);e=i.r,n=i.g,r=i.b}return(e>1||n>1||r>1)&&(e/=255,n/=255,r/=255),[e,n,r]},ue=function(e,n,r,i){var o={r:e*=255,g:n*=255,b:r*=255,hex:t.rgb(e,n,r),toString:ae};return t.is(i,"finite")&&(o.opacity=i),o};function ce(e,t,n){return function r(){var i=Array.prototype.slice.call(arguments,0),o=i.join("\u2400"),a=r.cache=r.cache||{},s=r.count=r.count||[];return a[c](o)?(function(e,t){for(var n=0,r=e.length;n=1e3&&delete a[s.shift()],s.push(o),a[o]=e[p](t,i),n?n(a[o]):a[o])}}function le(){return this.hex}function fe(e,t){for(var n=[],r=0,i=e.length;i-2*!t>r;r+=2){var o=[{x:+e[r-2],y:+e[r-1]},{x:+e[r],y:+e[r+1]},{x:+e[r+2],y:+e[r+3]},{x:+e[r+4],y:+e[r+5]}];t?r?i-4==r?o[3]={x:+e[0],y:+e[1]}:i-2==r&&(o[2]={x:+e[0],y:+e[1]},o[3]={x:+e[2],y:+e[3]}):o[0]={x:+e[i-2],y:+e[i-1]}:i-4==r?o[3]=o[2]:r||(o[0]={x:+e[r],y:+e[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}t.color=function(e){var n;return t.is(e,"object")&&"h"in e&&"s"in e&&"b"in e?(n=t.hsb2rgb(e),e.r=n.r,e.g=n.g,e.b=n.b,e.hex=n.hex):t.is(e,"object")&&"h"in e&&"s"in e&&"l"in e?(n=t.hsl2rgb(e),e.r=n.r,e.g=n.g,e.b=n.b,e.hex=n.hex):(t.is(e,"string")&&(e=t.getRGB(e)),t.is(e,"object")&&"r"in e&&"g"in e&&"b"in e?(n=t.rgb2hsl(e),e.h=n.h,e.s=n.s,e.l=n.l,n=t.rgb2hsb(e),e.v=n.b):(e={hex:"none"}).r=e.g=e.b=e.h=e.s=e.v=e.l=-1),e.toString=ae,e},t.hsb2rgb=function(e,t,n,r){var i,o,a,s,u;return this.is(e,"object")&&"h"in e&&"s"in e&&"b"in e&&(n=e.b,t=e.s,r=e.o,e=e.h),s=(u=n*t)*(1-S((e=(e*=360)%360/60)%2-1)),i=o=a=n-u,ue(i+=[u,s,0,0,s,u][e=~~e],o+=[s,u,u,s,0,0][e],a+=[0,0,s,u,u,s][e],r)},t.hsl2rgb=function(e,t,n,r){var i,o,a,s,u;return this.is(e,"object")&&"h"in e&&"s"in e&&"l"in e&&(n=e.l,t=e.s,e=e.h),(e>1||t>1||n>1)&&(e/=360,t/=100,n/=100),s=(u=2*t*(n<.5?n:1-n))*(1-S((e=(e*=360)%360/60)%2-1)),i=o=a=n-u/2,ue(i+=[u,s,0,0,s,u][e=~~e],o+=[s,u,u,s,0,0][e],a+=[0,0,s,u,u,s][e],r)},t.rgb2hsb=function(e,t,n){var r,i;return e=(n=se(e,t,n))[0],t=n[1],n=n[2],{h:((0==(i=(r=E(e,t,n))-A(e,t,n))?null:r==e?(t-n)/i:r==t?(n-e)/i+2:(e-t)/i+4)+360)%6*60/360,s:0==i?0:i/r,b:r,toString:ie}},t.rgb2hsl=function(e,t,n){var r,i,o,a;return e=(n=se(e,t,n))[0],t=n[1],n=n[2],r=((i=E(e,t,n))+(o=A(e,t,n)))/2,{h:((0==(a=i-o)?null:i==e?(t-n)/a:i==t?(n-e)/a+2:(e-t)/a+4)+360)%6*60/360,s:0==a?0:r<.5?a/(2*r):a/(2-2*r),l:r,toString:oe}},t._path2string=function(){return this.join(",").replace(H,"$1")},t._preload=function(e,t){var n=l.doc.createElement("img");n.style.cssText="position:absolute;left:-9999em;top:-9999em",n.onload=function(){t.call(this),this.onload=null,l.doc.body.removeChild(this)},n.onerror=function(){l.doc.body.removeChild(this)},l.doc.body.appendChild(n),n.src=e},t.getRGB=ce((function(e){if(!e||(e=y(e)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:le};if("none"==e)return{r:-1,g:-1,b:-1,hex:"none",toString:le};!z[c](e.toLowerCase().substring(0,2))&&"#"!=e.charAt()&&(e=re(e));var n,r,i,o,a,s,u=e.match(R);return u?(u[2]&&(i=U(u[2].substring(5),16),r=U(u[2].substring(3,5),16),n=U(u[2].substring(1,3),16)),u[3]&&(i=U((a=u[3].charAt(3))+a,16),r=U((a=u[3].charAt(2))+a,16),n=U((a=u[3].charAt(1))+a,16)),u[4]&&(s=u[4][b](Z),n=L(s[0]),"%"==s[0].slice(-1)&&(n*=2.55),r=L(s[1]),"%"==s[1].slice(-1)&&(r*=2.55),i=L(s[2]),"%"==s[2].slice(-1)&&(i*=2.55),"rgba"==u[1].toLowerCase().slice(0,4)&&(o=L(s[3])),s[3]&&"%"==s[3].slice(-1)&&(o/=100)),u[5]?(s=u[5][b](Z),n=L(s[0]),"%"==s[0].slice(-1)&&(n*=2.55),r=L(s[1]),"%"==s[1].slice(-1)&&(r*=2.55),i=L(s[2]),"%"==s[2].slice(-1)&&(i*=2.55),("deg"==s[0].slice(-3)||"\xb0"==s[0].slice(-1))&&(n/=360),"hsba"==u[1].toLowerCase().slice(0,4)&&(o=L(s[3])),s[3]&&"%"==s[3].slice(-1)&&(o/=100),t.hsb2rgb(n,r,i,o)):u[6]?(s=u[6][b](Z),n=L(s[0]),"%"==s[0].slice(-1)&&(n*=2.55),r=L(s[1]),"%"==s[1].slice(-1)&&(r*=2.55),i=L(s[2]),"%"==s[2].slice(-1)&&(i*=2.55),("deg"==s[0].slice(-3)||"\xb0"==s[0].slice(-1))&&(n/=360),"hsla"==u[1].toLowerCase().slice(0,4)&&(o=L(s[3])),s[3]&&"%"==s[3].slice(-1)&&(o/=100),t.hsl2rgb(n,r,i,o)):((u={r:n,g:r,b:i,toString:le}).hex="#"+(16777216|i|r<<8|n<<16).toString(16).slice(1),t.is(o,"finite")&&(u.opacity=o),u)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:le}}),t),t.hsb=ce((function(e,n,r){return t.hsb2rgb(e,n,r).hex})),t.hsl=ce((function(e,n,r){return t.hsl2rgb(e,n,r).hex})),t.rgb=ce((function(e,t,n){function r(e){return e+.5|0}return"#"+(16777216|r(n)|r(t)<<8|r(e)<<16).toString(16).slice(1)})),t.getColor=function(e){var t=this.getColor.start=this.getColor.start||{h:0,s:1,b:e||.75},n=this.hsb2rgb(t.h,t.s,t.b);return t.h+=.075,t.h>1&&(t.h=0,t.s-=.2,t.s<=0&&(this.getColor.start={h:0,s:1,b:t.b})),n.hex},t.getColor.reset=function(){delete this.start},t.parsePathString=function(e){if(!e)return null;var n=de(e);if(n.arr)return be(n.arr);var r={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},i=[];return t.is(e,C)&&t.is(e[0],C)&&(i=be(e)),i.length||y(e).replace(q,(function(e,t,n){var o=[],a=t.toLowerCase();if(n.replace(W,(function(e,t){t&&o.push(+t)})),"m"==a&&o.length>2&&(i.push([t][h](o.splice(0,2))),a="l",t="m"==t?"l":"L"),"r"==a)i.push([t][h](o));else for(;o.length>=r[a]&&(i.push([t][h](o.splice(0,r[a]))),r[a]););})),i.toString=t._path2string,n.arr=be(i),i},t.parseTransformString=ce((function(e){if(!e)return null;var n=[];return t.is(e,C)&&t.is(e[0],C)&&(n=be(e)),n.length||y(e).replace(V,(function(e,t,r){var i=[];k.call(t),r.replace(W,(function(e,t){t&&i.push(+t)})),n.push([t][h](i))})),n.toString=t._path2string,n}),this,(function(e){if(!e)return e;for(var t=[],n=0;n1?1:u<0?0:u)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,p=0;p<12;p++){var h=c*l[p]+c,v=pe(h,e,n,i,a),m=pe(h,t,r,o,s),g=v*v+m*m;d+=f[p]*_.sqrt(g)}return c*d}function ve(e,t,n,r,i,o,a,s){if(!(E(e,n)E(i,a)||E(t,r)E(o,s))){var u=(e-n)*(o-s)-(t-r)*(i-a);if(u){var c=((e*r-t*n)*(i-a)-(e-n)*(i*s-o*a))/u,l=((e*r-t*n)*(o-s)-(t-r)*(i*s-o*a))/u,f=+c.toFixed(2),d=+l.toFixed(2);if(!(f<+A(e,n).toFixed(2)||f>+E(e,n).toFixed(2)||f<+A(i,a).toFixed(2)||f>+E(i,a).toFixed(2)||d<+A(t,r).toFixed(2)||d>+E(t,r).toFixed(2)||d<+A(o,s).toFixed(2)||d>+E(o,s).toFixed(2)))return{x:c,y:l}}}}function me(e,n,r){var i=t.bezierBBox(e),o=t.bezierBBox(n);if(!t.isBBoxIntersect(i,o))return r?0:[];for(var a=he.apply(0,e),s=he.apply(0,n),u=E(~~(a/5),1),c=E(~~(s/5),1),l=[],f=[],d={},p=r?0:[],h=0;h=0&&O<=1.001&&T>=0&&T<=1.001&&(r?p++:p.push({x:_.x,y:_.y,t1:A(O,1),t2:A(T,1)}))}}return p}function ge(e,n,r){e=t._path2curve(e),n=t._path2curve(n);for(var i,o,a,s,u,c,l,f,d,p,h=r?0:[],v=0,m=e.length;vy||g=e.x&&t<=e.x2&&n>=e.y&&n<=e.y2},t.isBBoxIntersect=function(e,n){var r=t.isPointInsideBBox;return r(n,e.x,e.y)||r(n,e.x2,e.y)||r(n,e.x,e.y2)||r(n,e.x2,e.y2)||r(e,n.x,n.y)||r(e,n.x2,n.y)||r(e,n.x,n.y2)||r(e,n.x2,n.y2)||(e.xn.x||n.xe.x)&&(e.yn.y||n.ye.y)},t.pathIntersection=function(e,t){return ge(e,t)},t.pathIntersectionNumber=function(e,t){return ge(e,t,1)},t.isPointInsidePath=function(e,n,r){var i=t.pathBBox(e);return t.isPointInsideBBox(i,n,r)&&ge(e,[["M",n,r],["H",i.x2+10]],1)%2==1},t._removedFactory=function(t){return function(){e("raphael.log",null,"Rapha\xebl: you are calling to method \u201c"+t+"\u201d of removed object",t)}};var ye=t.pathBBox=function(e){var t=de(e);if(t.bbox)return ne(t.bbox);if(!e)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var n,r=0,i=0,o=[],a=[],s=0,u=(e=Oe(e)).length;s1&&(r*=w=_.sqrt(w),i*=w);var x=r*r,k=i*i,E=(a==s?-1:1)*_.sqrt(S((x*k-x*y*y-k*g*g)/(x*y*y+k*g*g))),A=E*r*y/i+(t+u)/2,O=E*-i*g/r+(n+c)/2,P=_.asin(((n-O)/i).toFixed(9)),C=_.asin(((c-O)/i).toFixed(9));(P=tC&&(P-=2*T),!s&&C>P&&(C-=2*T)}var I=C-P;if(S(I)>d){var R=C,j=u,N=c;C=P+d*(s&&C>P?1:-1),v=e(u=A+r*_.cos(C),c=O+i*_.sin(C),r,i,o,0,s,j,N,[C,R,A,O])}I=C-P;var M=_.cos(P),L=_.sin(P),U=_.cos(C),D=_.sin(C),B=_.tan(I/4),F=4/3*r*B,Z=4/3*i*B,z=[t,n],H=[t+F*L,n-Z*M],q=[u+F*D,c-Z*U],V=[u,c];if(H[0]=2*z[0]-H[0],H[1]=2*z[1]-H[1],l)return[H,q,V][h](v);for(var W=[],G=0,Y=(v=[H,q,V][h](v).join()[b](",")).length;G"1e12"&&(d=.5),S(h)>"1e12"&&(h=.5),d>0&&d<1&&(u=Ae(e,t,n,r,i,o,a,s,d),m.push(u.x),v.push(u.y)),h>0&&h<1&&(u=Ae(e,t,n,r,i,o,a,s,h),m.push(u.x),v.push(u.y)),c=o-2*r+t-(s-2*o+r),f=t-r,d=(-(l=2*(r-t)-2*(o-r))+_.sqrt(l*l-4*c*f))/2/c,h=(-l-_.sqrt(l*l-4*c*f))/2/c,S(d)>"1e12"&&(d=.5),S(h)>"1e12"&&(h=.5),d>0&&d<1&&(u=Ae(e,t,n,r,i,o,a,s,d),m.push(u.x),v.push(u.y)),h>0&&h<1&&(u=Ae(e,t,n,r,i,o,a,s,h),m.push(u.x),v.push(u.y)),{min:{x:A[p](0,m),y:A[p](0,v)},max:{x:E[p](0,m),y:E[p](0,v)}}})),Oe=t._path2curve=ce((function(e,t){var n=!t&&de(e);if(!t&&n.curve)return be(n.curve);for(var r=xe(e),i=t&&xe(t),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=function(e,t,n){var r,i;if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in{T:1,Q:1})&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"][h](Ee[p](0,[t.x,t.y][h](e.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*t.x-t.bx,i=2*t.y-t.by):(r=t.x,i=t.y),e=["C",r,i][h](e.slice(1));break;case"T":"Q"==n||"T"==n?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"][h](_e(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"][h](_e(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"][h](ke(t.x,t.y,e[1],e[2]));break;case"H":e=["C"][h](ke(t.x,t.y,e[1],t.y));break;case"V":e=["C"][h](ke(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"][h](ke(t.x,t.y,t.X,t.Y))}return e},u=function(e,t){if(e[t].length>7){e[t].shift();for(var n=e[t];n.length;)l[t]="A",i&&(f[t]="A"),e.splice(t++,0,["C"][h](n.splice(0,6)));e.splice(t,1),g=E(r.length,i&&i.length||0)}},c=function(e,t,n,o,a){e&&t&&"M"==e[a][0]&&"M"!=t[a][0]&&(t.splice(a,0,["M",o.x,o.y]),n.bx=0,n.by=0,n.x=e[a][1],n.y=e[a][2],g=E(r.length,i&&i.length||0))},l=[],f=[],d="",v="",m=0,g=E(r.length,i&&i.length||0);m.01;)c=he(e,t,n,r,i,o,a,s,f+=(ci){if(n&&!d.start){if(f+=["C"+(l=Ge(a,s,u[1],u[2],u[3],u[4],u[5],u[6],i-p)).start.x,l.start.y,l.m.x,l.m.y,l.x,l.y],o)return f;d.start=f,f=["M"+l.x,l.y+"C"+l.n.x,l.n.y,l.end.x,l.end.y,u[5],u[6]].join(),p+=c,a=+u[5],s=+u[6];continue}if(!e&&!n)return{x:(l=Ge(a,s,u[1],u[2],u[3],u[4],u[5],u[6],i-p)).x,y:l.y,alpha:l.alpha}}p+=c,a=+u[5],s=+u[6]}f+=u.shift()+u}return d.end=f,(l=e?p:n?d:t.findDotsAtSegment(a,s,u[0],u[1],u[2],u[3],u[4],u[5],1)).alpha&&(l={x:l.x,y:l.y,alpha:l.alpha}),l}},Ke=Ye(1),Je=Ye(),Qe=Ye(0,1);t.getTotalLength=Ke,t.getPointAtLength=Je,t.getSubpath=function(e,t,n){if(this.getTotalLength(e)-n<1e-6)return Qe(e,t).end;var r=Qe(e,n,1);return t?Qe(r,t).end:r},He.getTotalLength=function(){var e=this.getPath();if(e)return this.node.getTotalLength?this.node.getTotalLength():Ke(e)},He.getPointAtLength=function(e){var t=this.getPath();if(t)return Je(t,e)},He.getPath=function(){var e,n=t._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return n&&(e=n(this)),e},He.getSubpath=function(e,n){var r=this.getPath();if(r)return t.getSubpath(r,e,n)};var Xe=t.easing_formulas={linear:function(e){return e},"<":function(e){return O(e,1.7)},">":function(e){return O(e,.48)},"<>":function(e){var t=.48-e/1.04,n=_.sqrt(.1734+t*t),r=n-t,i=-n-t,o=O(S(r),1/3)*(r<0?-1:1)+O(S(i),1/3)*(i<0?-1:1)+.5;return 3*(1-o)*o*o+o*o*o},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},elastic:function(e){return e==!!e?e:O(2,-10*e)*_.sin(2*T*(e-.075)/.3)+1},bounce:function(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}};Xe.easeIn=Xe["ease-in"]=Xe["<"],Xe.easeOut=Xe["ease-out"]=Xe[">"],Xe.easeInOut=Xe["ease-in-out"]=Xe["<>"],Xe["back-in"]=Xe.backIn,Xe["back-out"]=Xe.backOut;var $e=[],et=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,16)},tt=function n(){for(var r=+new Date,i=0;i<$e.length;i++){var o=$e[i];if(!o.el.removed&&!o.paused){var a,s,u=r-o.start,l=o.ms,f=o.easing,d=o.from,p=o.diff,v=o.to,m=(o.t,o.el),y={},b={};if(o.initstatus?(u=(o.initstatus*o.anim.top-o.prev)/(o.percent-o.prev)*l,o.status=o.initstatus,delete o.initstatus,o.stop&&$e.splice(i--,1)):o.status=(o.prev+(o.percent-o.prev)*(u/l))/o.anim.top,!(u<0))if(u1&&!o.next){for(s in v)v[c](s)&&(b[s]=o.totalOrigin[s]);o.el.attr(b),ot(o.anim,o.el,o.anim.percents[0],null,o.totalOrigin,o.repeat-1)}o.next&&!o.stop&&ot(o.anim,o.el,o.next,null,o.totalOrigin,o.repeat)}}}$e.length&&et(n)},nt=function(e){return e>255?255:e<0?0:e};function rt(e,t,n,r,i,o){var a=3*t,s=3*(r-t)-a,u=1-a-s,c=3*n,l=3*(i-n)-c,f=1-c-l;function d(e){return((u*e+s)*e+a)*e}return function(e,t){var n=function(e,t){var n,r,i,o,c,l;for(i=e,l=0;l<8;l++){if(o=d(i)-e,S(o)(r=1))return r;for(;no?n=i:r=i,i=(r-n)/2+n}return i}(e,t);return((f*n+l)*n+c)*n}(e,1/(200*o))}function it(e,t){var n=[],r={};if(this.ms=t,this.times=1,e){for(var i in e)e[c](i)&&(r[L(i)]=e[i],n.push(L(i)));n.sort(Y)}this.anim=r,this.top=n[n.length-1],this.percents=n}function ot(n,r,i,o,s,u){i=L(i);var l,f,d,p,v,m,g=n.ms,w={},x={},k={};if(o)for(E=0,A=$e.length;Eo*n.top){i=n.percents[E],v=n.percents[E-1]||0,g=g/n.top*(i-v),p=n.percents[E+1],l=n.anim[i];break}o&&r.attr(n.anim[n.percents[E]])}if(l){if(f)f.initstatus=o,f.start=new Date-f.ms*o;else{for(var S in l)if(l[c](S)&&(F[c](S)||r.paper.customAttributes[c](S)))switch(w[S]=r.attr(S),null==w[S]&&(w[S]=B[S]),x[S]=l[S],F[S]){case P:k[S]=(x[S]-w[S])/g;break;case"colour":w[S]=t.getRGB(w[S]);var O=t.getRGB(x[S]);k[S]={r:(O.r-w[S].r)/g,g:(O.g-w[S].g)/g,b:(O.b-w[S].b)/g};break;case"path":var T=Oe(w[S],x[S]),C=T[1];for(w[S]=T[0],k[S]=[],E=0,A=w[S].length;Eu&&(u=f)}!e[u+="%"].callback&&(e[u].callback=i)}return new it(e,n)},He.animate=function(e,n,r,i){if(this.removed)return i&&i.call(this),this;var o=e instanceof it?e:t.animation(e,n,r,i);return ot(o,this,o.percents[0],null,this.attr()),this},He.setTime=function(e,t){return e&&null!=t&&this.status(e,A(t,e.ms)/e.ms),this},He.status=function(e,t){var n,r,i=[],o=0;if(null!=t)return ot(e,this,-1,A(t,1)),this;for(n=$e.length;o1)for(var r=0,i=n.length;r.5)-1;u(d-.5,2)+u(p-.5,2)>.25&&(p=o.sqrt(.25-u(d-.5,2))*i+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*i)}return f}))).split(/\s*\-\s*/),"linear"==c){var w=i.shift();if(w=-r(w),isNaN(w))return null;var x=[0,0,o.cos(e.rad(w)),o.sin(e.rad(w))],k=1/(a(s(x[2]),s(x[3]))||1);x[2]*=k,x[3]*=k,x[2]<0&&(x[0]=-x[2],x[2]=0),x[3]<0&&(x[1]=-x[3],x[3]=0)}var _=e._parseDots(i);if(!_)return null;if(l=l.replace(/[\(\)\s,\xb0#]/g,"_"),t.gradient&&l!=t.gradient.id&&(v.defs.removeChild(t.gradient),delete t.gradient),!t.gradient){b=m(c+"Gradient",{id:l}),t.gradient=b,m(b,"radial"==c?{fx:d,fy:p}:{x1:x[0],y1:x[1],x2:x[2],y2:x[3],gradientTransform:t.matrix.invert()}),v.defs.appendChild(b);for(var E=0,A=_.length;E1?j.opacity/100:j.opacity});case"stroke":j=e.getRGB(v),u.setAttribute(h,j.hex),"stroke"==h&&j[t]("opacity")&&m(u,{"stroke-opacity":j.opacity>1?j.opacity/100:j.opacity}),"stroke"==h&&r._.arrows&&("startString"in r._.arrows&&w(r,r._.arrows.startString),"endString"in r._.arrows&&w(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=n(v).charAt())&&g(r,v);break;case"opacity":l.gradient&&!l[t]("stroke-opacity")&&m(u,{"stroke-opacity":v>1?v/100:v});case"fill-opacity":if(l.gradient){(N=e._g.doc.getElementById(u.getAttribute("fill").replace(/^url\(#|\)$/g,f)))&&(M=N.getElementsByTagName("stop"),m(M[M.length-1],{"stop-opacity":v}));break}default:"font-size"==h&&(v=i(v,10)+"px");var L=h.replace(/(\-.)/g,(function(e){return e.substring(1).toUpperCase()}));u.style[L]=v,r._.dirty=1,u.setAttribute(h,v)}}E(r,o),u.style.visibility=d},E=function(r,o){if("text"==r.type&&(o[t]("text")||o[t]("font")||o[t]("font-size")||o[t]("x")||o[t]("y"))){var a=r.attrs,s=r.node,u=s.firstChild?i(e._g.doc.defaultView.getComputedStyle(s.firstChild,f).getPropertyValue("font-size"),10):10;if(o[t]("text")){for(a.text=o.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,l=n(o.text).split("\n"),d=[],p=0,h=l.length;p"));var Y=W.getBoundingClientRect();O.W=v.w=(Y.right-Y.left)/100,O.H=v.h=(Y.bottom-Y.top)/100,O.X=v.x,O.Y=v.y+O.H/2,("x"in u||"y"in u)&&(O.path.v=e.format("m{0},{1}l{2},{1}",o(v.x*y),o(v.y*y),o(v.x*y)+1));for(var K=["x","y","text","font","font-family","font-weight","font-style","font-size"],J=0,Q=K.length;J.25&&(n=i.sqrt(.25-s(t-.5,2))*(2*(n>.5)-1)+.5),c=t+f+n),d}))).split(/\s*\-\s*/),"linear"==u){var l=o.shift();if(l=-r(l),isNaN(l))return null}var p=e._parseDots(o);if(!p)return null;if(t=t.shape||t.node,p.length){t.removeChild(a),a.on=!0,a.method="none",a.color=p[0].color,a.color2=p[p.length-1].color;for(var h=[],v=0,m=p.length;v')}}catch(e){_=function(e){return t.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},e._engine.initWin(e._g.win),e._engine.create=function(){var t=e._getContainer.apply(0,arguments),n=t.container,r=t.height,i=t.width,o=t.x,a=t.y;if(!n)throw new Error("VML container not found.");var s=new e._Paper,u=s.canvas=e._g.doc.createElement("div"),c=u.style;return o=o||0,a=a||0,i=i||512,r=r||342,s.width=i,s.height=r,i==+i&&(i+="px"),r==+r&&(r+="px"),s.coordsize=216e5+f+216e5,s.coordorigin="0 0",s.span=e._g.doc.createElement("span"),s.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",u.appendChild(s.span),c.cssText=e.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",i,r),1==n?(e._g.doc.body.appendChild(u),c.left=o+"px",c.top=a+"px",c.position="absolute"):n.firstChild?n.insertBefore(u,n.firstChild):n.appendChild(u),s.renderfix=function(){},s},e.prototype.clear=function(){e.eve("raphael.clear",this),this.canvas.innerHTML=d,this.span=e._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},e.prototype.remove=function(){for(var t in e.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[t]="function"==typeof this[t]?e._removedFactory(t):null;return!0};var P=e.st;for(var C in T)T[t](C)&&!P[t](C)&&(P[C]=function(e){return function(){var t=arguments;return this.forEach((function(n){n[e].apply(n,t)}))}}(C))}}.apply(t,r))||(e.exports=i)}])},46225:function(e,t,n){"use strict";var r,i=n(47313),o=(r=i)&&"object"===typeof r&&"default"in r?r.default:r,a=new(n(61663)),s=a.getBrowser(),u=(a.getCPU(),a.getDevice()),c=a.getEngine(),l=a.getOS(),f=a.getUA(),d=function(e){return e||(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none")},p=function(){return!("undefined"===typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},h=function(e){var t=p();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};function v(e){return v="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function m(e,t){for(var n=0;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var E="mobile",A="tablet",S="smarttv",O="console",T="wearable",P=void 0,C={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},I={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},R={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},j=function(e,t,n,r){return function(e){for(var t=1;t1)&&!window.MSStream}(),ge=D(),ye=h("iPhone"),be=h("iPod"),we=function(){var e=p(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"===typeof t&&/electron/.test(t)}(),xe=M(),ke=U()&&!M(),_e=l.name===I.Windows,Ee=l.name===I.MAC_OS,Ae=s.name===C.MIUI,Se=s.name===C.SamsungBrowser;t.tq=q},30534:function(e,t,n){"use strict";var r=n(47313),i=n(62224);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n