Skip to content

Instantly share code, notes, and snippets.

@wcjohnson11
Created November 18, 2022 19:47
Show Gist options
  • Save wcjohnson11/ca65ae17e3c971506351c2aa31118dbe to your computer and use it in GitHub Desktop.
Save wcjohnson11/ca65ae17e3c971506351c2aa31118dbe to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
/*! For license information please see main.578547cc.js.LICENSE.txt */
!function(){var e={91466:function(e,t,r){"use strict";var n=r(48064).default,a=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;var i=r(60952),o=r(24976),c=r(26089),s=r(26268),f=r(31383),u=r(18892),d=r(31807),l={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.LINK_API_URL||"https://www.walletlink.org",h={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.SDK_VERSION||r(40626).i8||"unknown",b=function(){function e(t){var r,a,i;n(this,e),this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;var c,d=t.linkAPIUrl||l;if(c=t.uiConstructor?t.uiConstructor:function(e){return new s.WalletSDKUI(e)},"undefined"===typeof t.overrideIsMetaMask?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=null===(r=t.overrideIsCoinbaseWallet)||void 0===r||r,this._overrideIsCoinbaseBrowser=null!==(a=t.overrideIsCoinbaseBrowser)&&void 0!==a&&a,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===(i=t.reloadOnDisconnect)||void 0===i||i;var b=new URL(d),p="".concat(b.protocol,"//").concat(b.host);this._storage=new o.ScopedLocalStorage("-walletlink:".concat(p)),this._storage.setItem("version",e.VERSION),this.walletExtension||this.coinbaseBrowser||(this._relayEventManager=new u.WalletSDKRelayEventManager,this._relay=new f.WalletSDKRelay({linkAPIUrl:d,version:h,darkMode:!!t.darkMode,uiConstructor:c,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger}),this.setAppInfo(t.appName,t.appLogoUrl),t.headlessMode||this._relay.attachUI())}return a(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,r=this.walletExtension;if(r)return this.isCipherProvider(r)||r.setProviderInfo(e,t),!1===this._reloadOnDisconnect&&"function"===typeof r.disableReloadOnDisconnect&&r.disableReloadOnDisconnect(),r;var n=this.coinbaseBrowser;if(n)return n;var a=this._relay;if(!a||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||a.setConnectDisabled(!0),new c.CoinbaseWalletProvider({relayProvider:function(){return Promise.resolve(a)},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 r;this._appName=e||"DApp",this._appLogoUrl=t||(0,d.getFavicon)();var n=this.walletExtension;n?this.isCipherProvider(n)||n.setAppInfo(this._appName,this._appLogoUrl):null===(r=this._relay)||void 0===r||r.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,i.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 r=null!==(e=window.ethereum)&&void 0!==e?e:null===(t=window.top)||void 0===t?void 0:t.ethereum;if(!r)return;return"isCoinbaseBrowser"in r&&r.isCoinbaseBrowser?r:void 0}catch(n){return}}},{key:"isCipherProvider",value:function(e){return"boolean"===typeof e.isCipher&&e.isCipher}}]),e}();t.CoinbaseWalletSDK=b,b.VERSION=h},60952:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.walletLogo=void 0;t.walletLogo=function(e,t){var r;switch(e){case"standard":default:return r=t,"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(r,"' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E ");case"circle":return r=t,"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='".concat(t,"' height='").concat(r,"' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E");case"text":return r=(.1*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(r,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E");case"textWithLogo":return r=(.25*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(r,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E");case"textLight":return r=(.1*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(r,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E");case"textWithLogoLight":return r=(.25*t).toFixed(2),"data:image/svg+xml,%3Csvg width='".concat(t,"' height='").concat(r,"' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E")}}},49751:function(e,t,r){"use strict";var n=r(48064).default,a=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.LinkFlow=void 0;var i=r(45963),o=r(68134),c=r(85819),s=function(){function e(t){n(this,e),this.extensionUI$=new o.BehaviorSubject({}),this.subscriptions=new o.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 a(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,i.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,i.render)((0,i.h)(c.TryExtensionLinkDialog,{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=s},7905:function(e,t,r){"use strict";var n=r(19778).Buffer,a=r(94534).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=r(45963),c=r(90632),s=i(r(58765));t.QRCode=function(e){var t=(0,c.useState)(""),r=a(t,2),i=r[0],f=r[1];return(0,c.useEffect)((function(){var t,r,a=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!==(r=e.height)&&void 0!==r?r:256,padding:0,image:e.image}),i=n.from(a.svg(),"utf8").toString("base64");f("data:image/svg+xml;base64,".concat(i))})),i?(0,o.h)("img",{src:i,alt:"QR Code"}):null}},17310: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}"},29266:function(e,t,r){"use strict";var n=r(94534).default,a=r(48064).default,i=r(18231).default,o=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 c=o(r(28182)),s=r(45963),f=r(90632),u=o(r(17310)),d=function(){function e(t){a(this,e),this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=t.darkMode}return i(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,r=this.nextItemKey++;return this.items.set(r,e),this.render(),function(){t.items.delete(r),t.render()}}},{key:"clear",value:function(){this.items.clear(),this.render()}},{key:"render",value:function(){this.root&&(0,s.render)((0,s.h)("div",null,(0,s.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map((function(e){var r=n(e,2),a=r[0],i=r[1];return(0,s.h)(t.SnackbarInstance,Object.assign({},i,{key:a}))})))),this.root)}}]),e}();t.Snackbar=d;t.SnackbarContainer=function(e){return(0,s.h)("div",{class:(0,c.default)("-cbwsdk-snackbar-container")},(0,s.h)("style",null,u.default),(0,s.h)("div",{class:"-cbwsdk-snackbar"},e.children))};t.SnackbarInstance=function(e){var t=e.autoExpand,r=e.message,a=e.menuItems,i=(0,f.useState)(!0),o=n(i,2),u=o[0],d=o[1],l=(0,f.useState)(null!==t&&void 0!==t&&t),h=n(l,2),b=h[0],p=h[1];(0,f.useEffect)((function(){var e=[window.setTimeout((function(){d(!1)}),1),window.setTimeout((function(){p(!0)}),1e4)];return function(){e.forEach(window.clearTimeout)}}));return(0,s.h)("div",{class:(0,c.default)("-cbwsdk-snackbar-instance",u&&"-cbwsdk-snackbar-instance-hidden",b&&"-cbwsdk-snackbar-instance-expanded")},(0,s.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:function(){p(!b)}},(0,s.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,s.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},r),(0,s.h)("div",{class:"-gear-container"},!b&&(0,s.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,s.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),a&&a.length>0&&(0,s.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},a.map((function(e,t){return(0,s.h)("div",{class:(0,c.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,s.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,s.h)("span",{class:(0,c.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info))}))))}},78663: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)}}"},73689:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Spinner=void 0;var a=r(45963),i=n(r(78663));t.Spinner=function(e){var t,r=null!==(t=e.size)&&void 0!==t?t:64,n=e.color||"#000";return(0,a.h)("div",{class:"-cbwsdk-spinner"},(0,a.h)("style",null,i.default),(0,a.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,a.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))}},63789:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='.-cbwsdk-css-reset .-cbwsdk-extension-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-extension-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box{display:flex;position:relative;max-width:500px;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top{display:flex;flex-direction:row;border-radius:8px;overflow:hidden;min-height:300px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top.dark{color:#fff;background-color:#000;box-shadow:0 4px 16px rgba(255,255,255,.05)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top.light{background-color:#fff}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-subtext{margin-top:15px;font-size:12px;line-height:1.5}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-install-region{display:flex;flex-basis:50%;flex-direction:column;justify-content:center;padding:32px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-install-region button{display:block;border-radius:8px;background-color:#1652f0;color:#fff;width:90%;min-width:fit-content;height:44px;margin-top:16px;font-size:16px;padding-left:16px;padding-right:16px;cursor:pointer;font-weight:500;text-align:center}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-install-region button.dark{background-color:#3773f5}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-info-region{display:flex;flex-basis:50%;flex-direction:column;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-info-region.light{background-color:#fafbfc}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-info-region.dark{background-color:#141519}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description{display:flex;flex-direction:row;align-items:center;padding-top:14px;padding-bottom:14px;padding-left:24px;padding-right:32px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description-icon-wrapper{display:block;position:relative;width:40px;height:40px;flex-shrink:0;flex-grow:0;border-radius:20px;background-color:#fff;box-shadow:0px 0px 8px rgba(0,0,0,.04),0px 16px 24px rgba(0,0,0,.06)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description-icon-wrapper img{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description-text{margin-left:16px;flex-grow:1;font-size:13px;line-height:19px;align-self:center}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description-text.light{color:#000}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-top-description-text.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom{display:flex;flex-direction:row;overflow:hidden;border-radius:8px;margin-top:8px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom.light{background-color:#fff}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom.dark{background-color:#000;box-shadow:0 4px 16px rgba(255,255,255,.05)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-description-region{display:flex;flex-direction:column;justify-content:center;padding:32px;flex-grow:1}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-description{font-size:13px;line-height:19px;margin-top:12px;color:#aaa}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-description.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-description.dark a{color:#3773f5}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-description a{font-size:inherit;line-height:inherit;color:#1652f0;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-region{position:relative;flex-shrink:0;display:flex;flex-direction:column;justify-content:center;padding-left:24px;padding-right:24px;padding-top:16px;padding-bottom:16px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-wrapper{position:relative;display:block;padding:8px;border-radius:8px;box-shadow:0px 4px 12px rgba(0,0,0,.1);background-color:#fff}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-wrapper img{display:block}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-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-extension-dialog-box-bottom-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-connecting.light>p{color:#000}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-connecting.dark{background-color:rgba(20,21,25,.9)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-bottom-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel{position:absolute;-webkit-appearance:none;display:flex;align-items:center;justify-content:center;top:16px;right:16px;width:24px;height:24px;border-radius:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel.light{background-color:#fafbfc}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel.dark{background-color:#141519}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x.light::before,.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x.light::after{background-color:#000}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x.dark::before,.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x.dark::after{background-color:#fff}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x::before,.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x::after{content:"";position:absolute;display:block;top:-1px;left:-7px;width:14px;height:1px;transition:background-color .2s}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x::before{transform:rotate(45deg)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel-x::after{transform:rotate(135deg)}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel:hover .-cbwsdk-link-dialog-box-cancel-x-a,.-cbwsdk-css-reset .-cbwsdk-extension-dialog-box-cancel:hover .-cbwsdk-link-dialog-box-cancel-x-b{background-color:#000}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-extension-dialog-container-hidden{display:none}.-cbwsdk-css-reset .-cbwsdk-extension-dialog h2{display:block;text-align:left;font-size:22px;font-weight:600;line-height:28px}.-cbwsdk-css-reset .-cbwsdk-extension-dialog h2.light{color:#000}.-cbwsdk-css-reset .-cbwsdk-extension-dialog h2.dark{color:#fff}'},85819:function(e,t,r){"use strict";var n=r(94534).default,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TryExtensionLinkDialog=void 0;var i=a(r(28182)),o=r(45963),c=r(90632),s=r(31807),f=r(25365),u=a(r(10286)),d=a(r(63398)),l=a(r(35882)),h=a(r(81943)),b=r(7905),p=r(73689),m=a(r(63789));t.TryExtensionLinkDialog=function(e){var t=e.isOpen,r=e.darkMode,a=(0,c.useState)(!t),s=n(a,2),f=s[0],u=s[1],d=(0,c.useState)(!t),l=n(d,2),h=l[0],b=l[1];(0,c.useEffect)((function(){var e=[window.setTimeout((function(){b(!t)}),10)];return t?u(!1):e.push(window.setTimeout((function(){u(!0)}),360)),function(){e.forEach(window.clearTimeout)}}),[e.isOpen]);var p=r?"dark":"light";return(0,o.h)("div",{class:(0,i.default)("-cbwsdk-extension-dialog-container",f&&"-cbwsdk-extension-dialog-container-hidden")},(0,o.h)("style",null,m.default),(0,o.h)("div",{class:(0,i.default)("-cbwsdk-extension-dialog-backdrop",p,h&&"-cbwsdk-extension-dialog-backdrop-hidden")}),(0,o.h)("div",{class:"-cbwsdk-extension-dialog"},(0,o.h)("div",{class:(0,i.default)("-cbwsdk-extension-dialog-box",h&&"-cbwsdk-extension-dialog-box-hidden")},(0,o.h)(x,{darkMode:r,onInstallClick:function(){window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")}}),e.connectDisabled?null:(0,o.h)(g,{darkMode:r,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId}),e.onCancel&&(0,o.h)(y,{darkMode:r,onClick:e.onCancel}))))};var x=function(e){var t=e.darkMode,r=e.onInstallClick,a=(0,c.useState)(!1),s=n(a,2),f=s[0],h=s[1],b=(0,c.useCallback)((function(){f?window.location.reload():(r(),h(!0))}),[r,f]),p=t?"dark":"light";return(0,o.h)("div",{class:(0,i.default)("-cbwsdk-extension-dialog-box-top",p)},(0,o.h)("div",{class:"-cbwsdk-extension-dialog-box-top-install-region"},(0,o.h)("h2",{class:p},"Try the Coinbase Wallet extension"),f&&(0,o.h)("div",{class:"-cbwsdk-extension-dialog-box-top-subtext"},"After installing Coinbase Wallet, refresh the page and connect again."),(0,o.h)("button",{type:"button",onClick:b},f?"Refresh":"Install")),(0,o.h)("div",{class:(0,i.default)("-cbwsdk-extension-dialog-box-top-info-region",p)},(0,o.h)(v,{darkMode:t,icon:d.default,text:"Connect to crypto apps with one click"}),(0,o.h)(v,{darkMode:t,icon:l.default,text:"Your private key is stored securely"}),(0,o.h)(v,{darkMode:t,icon:u.default,text:"Works with Ethereum, Polygon, and more"})))},g=function(e){var t=(0,s.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),r=e.darkMode?"dark":"light";return(0,o.h)("div",{"data-testid":"scan-qr-box",class:(0,i.default)("-cbwsdk-extension-dialog-box-bottom",r)},(0,o.h)("div",{class:"-cbwsdk-extension-dialog-box-bottom-description-region"},(0,o.h)("h2",{class:r},"Or scan to connect"),(0,o.h)("body",{class:(0,i.default)("-cbwsdk-extension-dialog-box-bottom-description",r)},"Open"," ",(0,o.h)("a",{href:"https://wallet.coinbase.com/",target:"_blank",rel:"noopener noreferrer"},"Coinbase Wallet")," ","on your mobile phone and scan")),(0,o.h)("div",{class:"-cbwsdk-extension-dialog-box-bottom-qr-region"},(0,o.h)("div",{class:"-cbwsdk-extension-dialog-box-bottom-qr-wrapper"},(0,o.h)(b.QRCode,{content:t,width:150,height:150,fgColor:"#000",bgColor:"transparent",image:{svg:h.default,width:34,height:34}})),(0,o.h)("input",{type:"hidden",name:"cbwsdk-version",value:f.LIB_VERSION}),(0,o.h)("input",{type:"hidden",value:t}),!e.isConnected&&(0,o.h)("div",{"data-testid":"connecting-spinner",class:(0,i.default)("-cbwsdk-extension-dialog-box-bottom-qr-connecting",r)},(0,o.h)(p.Spinner,{size:36,color:e.darkMode?"#FFF":"#000"}),(0,o.h)("p",null,"Connecting..."))))},v=function(e){var t=e.darkMode?"dark":"light";return(0,o.h)("div",{class:"-cbwsdk-extension-dialog-box-top-description"},(0,o.h)("div",{class:"-cbwsdk-extension-dialog-box-top-description-icon-wrapper"},(0,o.h)("img",{src:e.icon})),(0,o.h)("body",{class:(0,i.default)("-cbwsdk-extension-dialog-box-top-description-text",t)},e.text))},y=function(e){var t=e.darkMode?"dark":"light";return(0,o.h)("button",{type:"button",class:(0,i.default)("-cbwsdk-extension-dialog-box-cancel",t),onClick:e.onClick},(0,o.h)("div",{class:(0,i.default)("-cbwsdk-extension-dialog-box-cancel-x",t)}))}},81943:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="50" cy="50" r="50" fill="white"/>\n<circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>\n<circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>\n</svg>\n\n'},10286:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTggMEMzLjU4IDAgMCAzLjU4IDAgOHMzLjU4IDggOCA4IDgtMy41OCA4LTgtMy41OC04LTgtOFptNS45MSA3aC0xLjk0Yy0uMS0xLjU3LS40Mi0zLS45MS00LjE1IDEuNDguODggMi41NSAyLjM4IDIuODUgNC4xNVpNOCAxNGMtLjQ1IDAtMS43Mi0xLjc3LTEuOTUtNWgzLjljLS4yMyAzLjIzLTEuNSA1LTEuOTUgNVpNNi4wNSA3QzYuMjggMy43NyA3LjU1IDIgOCAyYy40NSAwIDEuNzIgMS43NyAxLjk1IDVoLTMuOVpNNC45NCAyLjg1QzQuNDYgNCA0LjEzIDUuNDMgNC4wMyA3SDIuMDljLjMtMS43NyAxLjM3LTMuMjcgMi44NS00LjE1Wk0yLjA5IDloMS45NGMuMSAxLjU3LjQyIDMgLjkxIDQuMTVBNS45OTggNS45OTggMCAwIDEgMi4wOSA5Wm04Ljk3IDQuMTVjLjQ4LTEuMTUuODEtMi41OC45MS00LjE1aDEuOTRhNS45OTggNS45OTggMCAwIDEtMi44NSA0LjE1WiIgZmlsbD0iIzE2NTJGMCIvPjwvc3ZnPg=="},63398:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTciIGhlaWdodD0iMTciIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1LjYzNSAyLjExN2EzLjg4OSAzLjg4OSAwIDAgMC01LjUyMSAwTDYuODkgNS4zMzVBMy44OTQgMy44OTQgMCAwIDAgNS44IDguNzM5Yy4wODMuNTA2LjI2OCAxLjAxMS41NTMgMS40NjYuMTUxLjI1My4zMzYuNDcyLjUzNy42OTFsLjYyMS42MjQgMS4xNDEtMS4xNDYtLjYyLS42MjRhMi4xMDUgMi4xMDUgMCAwIDEtLjQ4Ny0uNzQxIDIuMzQgMi4zNCAwIDAgMSAuNTAzLTIuNTFsMy4yMDYtMy4yMmEyLjI5MyAyLjI5MyAwIDAgMSAzLjIzOSAwYy44OS44OTQuODkgMi4zNDMgMCAzLjI1M2wtMS41MjcgMS41MzNjLjIzNC42NC4zMzUgMS4zMzEuMzAyIDIuMDA1bDIuMzgzLTIuMzkyYzEuNTEtMS41MzQgMS40OTMtNC4wMjgtLjAxNy01LjU2MVoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBkPSJNMTEuMjcxIDcuNzQ1YTMuMTMgMy4xMyAwIDAgMC0uNTU0LS42OWwtLjYyLS42MjQtMS4xNDIgMS4xNDYuNjIxLjYyM2MuMjE4LjIyLjM4Ni40ODkuNDg3Ljc1OC4zMzUuODI2LjE2NyAxLjgyLS41MDQgMi40OTRsLTMuMjA1IDMuMjE5YTIuMjkzIDIuMjkzIDAgMCAxLTMuMjQgMCAyLjMxNiAyLjMxNiAwIDAgMSAwLTMuMjUybDEuNTI4LTEuNTM0YTQuODE1IDQuODE1IDAgMCAxLS4yODUtMi4wMDVsLTIuMzgzIDIuMzkzYTMuOTI3IDMuOTI3IDAgMCAwIDAgNS41NDQgMy45MDkgMy45MDkgMCAwIDAgNS41MzggMGwzLjIwNS0zLjIxOWEzLjk1OCAzLjk1OCAwIDAgMCAxLjA5MS0zLjQwNCA0LjIxMSA0LjIxMSAwIDAgMC0uNTM3LTEuNDQ5WiIgZmlsbD0iIzE2NTJGMCIvPjwvc3ZnPg=="},35882:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEgN3Y5aDE0VjdIMVptNy41IDQuMzlWMTRoLTF2LTIuNjFjLS40NC0uMTktLjc1LS42My0uNzUtMS4xNGExLjI1IDEuMjUgMCAwIDEgMi41IDBjMCAuNTEtLjMxLjk1LS43NSAxLjE0Wk01LjY3IDZWNC4zM0M1LjY3IDMuMDUgNi43MSAyIDggMnMyLjMzIDEuMDUgMi4zMyAyLjMzVjZoMlY0LjMzQzEyLjMzIDEuOTQgMTAuMzkgMCA4IDBTMy42NyAxLjk0IDMuNjcgNC4zM1Y2aDJaIiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"},7447: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)}},95311: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"}},11527:function(e,t,r){"use strict";var n=r(48064).default,a=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;var i,o=r(68134),c=r(4476);!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(i=t.ConnectionState||(t.ConnectionState={}));var s=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:WebSocket;n(this,e),this.WebSocketClass=r,this.webSocket=null,this.connectionStateSubject=new o.BehaviorSubject(i.DISCONNECTED),this.incomingDataSubject=new o.Subject,this.url=t.replace(/^http/,"ws")}return a(e,[{key:"connect",value:function(){var e=this;return this.webSocket?(0,o.throwError)(new Error("webSocket object is not null")):new o.Observable((function(t){var r;try{e.webSocket=r=new e.WebSocketClass(e.url)}catch(n){return void t.error(n)}e.connectionStateSubject.next(i.CONNECTING),r.onclose=function(r){e.clearWebSocket(),t.error(new Error("websocket error ".concat(r.code,": ").concat(r.reason))),e.connectionStateSubject.next(i.DISCONNECTED)},r.onopen=function(r){t.next(),t.complete(),e.connectionStateSubject.next(i.CONNECTED)},r.onmessage=function(t){e.incomingDataSubject.next(t.data)}})).pipe((0,c.take)(1))}},{key:"disconnect",value:function(){var e=this.webSocket;if(e){this.clearWebSocket(),this.connectionStateSubject.next(i.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,c.flatMap)((function(e){var t;try{t=JSON.parse(e)}catch(r){return(0,o.empty)()}return(0,o.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=s},67494: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}},77594:function(e,t,r){"use strict";var n=r(38181).default,a=r(48064).default,i=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKConnection=void 0;var o=r(68134),c=r(4476),s=r(76388),f=r(93352),u=r(7447),d=r(95311),l=r(11527),h=r(67494),b=1e4,p=function(){function e(t,r,n,i){var u=this,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:WebSocket;a(this,e),this.sessionId=t,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new o.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,f.IntNumber)(1),this.connectedSubject=new o.BehaviorSubject(!1),this.linkedSubject=new o.BehaviorSubject(!1),this.sessionConfigSubject=new o.ReplaySubject(1);var p=new l.RxWebSocket(n+"/rpc",h);this.ws=p,this.subscriptions.add(p.connectionState$.pipe((0,c.tap)((function(e){var r;return null===(r=u.diagnostic)||void 0===r?void 0:r.log(d.EVENTS.CONNECTED_STATE_CHANGE,{state:e,sessionIdHash:s.Session.hash(t)})})),(0,c.skip)(1),(0,c.filter)((function(e){return e===l.ConnectionState.DISCONNECTED&&!u.destroyed})),(0,c.delay)(5e3),(0,c.filter)((function(e){return!u.destroyed})),(0,c.flatMap)((function(e){return p.connect()})),(0,c.retry)()).subscribe()),this.subscriptions.add(p.connectionState$.pipe((0,c.skip)(2),(0,c.switchMap)((function(e){return(0,o.iif)((function(){return e===l.ConnectionState.CONNECTED}),u.authenticate().pipe((0,c.tap)((function(e){return u.sendIsLinked()})),(0,c.tap)((function(e){return u.sendGetSessionConfig()})),(0,c.map)((function(e){return!0}))),(0,o.of)(!1))})),(0,c.distinctUntilChanged)(),(0,c.catchError)((function(e){return(0,o.of)(!1)}))).subscribe((function(e){return u.connectedSubject.next(e)}))),this.subscriptions.add(p.connectionState$.pipe((0,c.skip)(1),(0,c.switchMap)((function(e){return(0,o.iif)((function(){return e===l.ConnectionState.CONNECTED}),(0,o.timer)(0,b))}))).subscribe((function(e){return 0===e?u.updateLastHeartbeat():u.heartbeat()}))),this.subscriptions.add(p.incomingData$.pipe((0,c.filter)((function(e){return"h"===e}))).subscribe((function(e){return u.updateLastHeartbeat()}))),this.subscriptions.add(p.incomingJSONData$.pipe((0,c.filter)((function(e){return["IsLinkedOK","Linked"].includes(e.type)}))).subscribe((function(e){var r,n=e;null===(r=u.diagnostic)||void 0===r||r.log(d.EVENTS.LINKED,{sessionIdHash:s.Session.hash(t),linked:n.linked,type:e.type,onlineGuests:n.onlineGuests}),u.linkedSubject.next(n.linked||n.onlineGuests>0)}))),this.subscriptions.add(p.incomingJSONData$.pipe((0,c.filter)((function(e){return["GetSessionConfigOK","SessionConfigUpdated"].includes(e.type)}))).subscribe((function(e){var r,n=e;null===(r=u.diagnostic)||void 0===r||r.log(d.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:s.Session.hash(t),metadata_keys:n&&n.metadata?Object.keys(n.metadata):void 0}),u.sessionConfigSubject.next({webhookId:n.webhookId,webhookUrl:n.webhookUrl,metadata:n.metadata})})))}return i(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(d.EVENTS.STARTED_CONNECTING,{sessionIdHash:s.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(d.EVENTS.DISCONNECTED,{sessionIdHash:s.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,c.filter)((function(e){return e})),(0,c.take)(1),(0,c.map)((function(){})))}},{key:"linked$",get:function(){return this.linkedSubject.asObservable()}},{key:"onceLinked$",get:function(){return this.linked$.pipe((0,c.filter)((function(e){return e})),(0,c.take)(1),(0,c.map)((function(){})))}},{key:"sessionConfig$",get:function(){return this.sessionConfigSubject.asObservable()}},{key:"incomingEvent$",get:function(){return this.ws.incomingJSONData$.pipe((0,c.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,c.map)((function(e){return e})))}},{key:"setSessionMetadata",value:function(e,t){var r=this,a=(0,u.ClientMessageSetSessionConfig)({id:(0,f.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:n({},e,t)});return this.onceConnected$.pipe((0,c.flatMap)((function(e){return r.makeRequest(a)})),(0,c.map)((function(e){if((0,h.isServerMessageFail)(e))throw new Error(e.error||"failed to set session metadata")})))}},{key:"publishEvent",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=(0,u.ClientMessagePublishEvent)({id:(0,f.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:t,callWebhook:n});return this.onceLinked$.pipe((0,c.flatMap)((function(e){return r.makeRequest(a)})),(0,c.map)((function(e){if((0,h.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,r=e.id;try{this.sendData(e)}catch(n){return(0,o.throwError)(n)}return this.ws.incomingJSONData$.pipe((0,c.timeoutWith)(t,(0,o.throwError)(new Error("request ".concat(r," timed out")))),(0,c.filter)((function(e){return e.id===r})),(0,c.take)(1))}},{key:"authenticate",value:function(){var e=(0,u.ClientMessageHostSession)({id:(0,f.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,c.map)((function(e){if((0,h.isServerMessageFail)(e))throw new Error(e.error||"failed to authentcate")})))}},{key:"sendIsLinked",value:function(){var e=(0,u.ClientMessageIsLinked)({id:(0,f.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}},{key:"sendGetSessionConfig",value:function(){var e=(0,u.ClientMessageGetSessionConfig)({id:(0,f.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}]),e}();t.WalletSDKConnection=p},25419:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;var n=r(91466),a=r(26089),i=r(91466);Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return i.CoinbaseWalletSDK}});var o=r(26089);Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return o.CoinbaseWalletProvider}}),t.default=n.CoinbaseWalletSDK,"undefined"!==typeof window&&(window.CoinbaseWalletSDK=n.CoinbaseWalletSDK,window.CoinbaseWalletProvider=a.CoinbaseWalletProvider,window.WalletLink=n.CoinbaseWalletSDK,window.WalletLinkProvider=a.CoinbaseWalletProvider)},24976:function(e,t,r){"use strict";var n=r(48064).default,a=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ScopedLocalStorage=void 0;var i=function(){function e(t){n(this,e),this.scope=t}return a(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=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);"string"===typeof n&&n.startsWith(e)&&t.push(n)}t.forEach((function(e){return localStorage.removeItem(e)}))}},{key:"scopedKey",value:function(e){return"".concat(this.scope,":").concat(e)}}]),e}();t.ScopedLocalStorage=i},86297:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;bottom:auto;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;direction:ltr;display:block;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;left:auto;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";right:auto;tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;top:auto;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;width:auto;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset *{box-sizing:border-box;display:initial;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'},96100:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.injectCssReset=void 0;var a=n(r(86297));t.injectCssReset=function(){var e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(a.default)),document.documentElement.appendChild(e)}},26089:function(e,t,r){"use strict";var n=r(19778).Buffer,a=r(48485).default,i=r(7433).default,o=r(95830).default,c=r(48064).default,s=r(18231).default,f=r(24587).default,u=r(89137).default,d=r(53744).default,l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=void 0;var h=l(r(67109)),b=l(r(87044)),p=r(56216),m=r(95311),x=r(76388),g=r(84715),v=r(31807),y=l(r(76465)),w=r(15142),M=r(98377),k=r(68374),A="DefaultChainId",I="DefaultJsonRpcUrl",E=[1,10,137,61,56,250,42161,100,43114,3,4,5,42,69,80001,97,4002,421611,43113],S=function(e){u(r,e);var t=d(r);function r(e){var n,a,i;c(this,r),(n=t.call(this))._filterPolyfill=new w.FilterPolyfill(f(n)),n._subscriptionManager=new k.SubscriptionManager(f(n)),n._relay=null,n._addresses=[],n.hasMadeFirstChainChangedEmission=!1,n._send=n.send.bind(f(n)),n._sendAsync=n.sendAsync.bind(f(n)),n.setProviderInfo=n.setProviderInfo.bind(f(n)),n.updateProviderInfo=n.updateProviderInfo.bind(f(n)),n.getChainId=n.getChainId.bind(f(n)),n.setAppInfo=n.setAppInfo.bind(f(n)),n.enable=n.enable.bind(f(n)),n.close=n.close.bind(f(n)),n.send=n.send.bind(f(n)),n.sendAsync=n.sendAsync.bind(f(n)),n.request=n.request.bind(f(n)),n._setAddresses=n._setAddresses.bind(f(n)),n.scanQRCode=n.scanQRCode.bind(f(n)),n.genericRequest=n.genericRequest.bind(f(n)),n._chainIdFromOpts=e.chainId,n._jsonRpcUrlFromOpts=e.jsonRpcUrl,n._overrideIsMetaMask=e.overrideIsMetaMask,n._relayProvider=e.relayProvider,n._storage=e.storage,n._relayEventManager=e.relayEventManager,n.diagnostic=e.diagnosticLogger,n.reloadOnDisconnect=!0,n.isCoinbaseWallet=null===(a=e.overrideIsCoinbaseWallet)||void 0===a||a,n.isCoinbaseBrowser=null!==(i=e.overrideIsCoinbaseBrowser)&&void 0!==i&&i,n.qrUrl=e.qrUrl,n.supportsAddressSwitching=e.supportsAddressSwitching,n.isLedger=e.isLedger;var o=n.getChainId(),s=(0,v.prepend0x)(o.toString(16));n.emit("connect",{chainIdStr:s});var u=n._storage.getItem(g.LOCAL_STORAGE_ADDRESSES_KEY);if(u){var d=u.split(" ");""!==d[0]&&(n._addresses=d.map((function(e){return(0,v.ensureAddressString)(e)})),n.emit("accountsChanged",d))}return n._subscriptionManager.events.on("notification",(function(e){n.emit("message",{type:e.method,data:e.params})})),n._addresses.length>0&&n.initializeRelay(),window.addEventListener("message",(function(e){var t;if("walletLinkMessage"===e.data.type){if("defaultChainChanged"===e.data.data.action||"dappChainSwitched"===e.data.data.action){var r=e.data.data.chainId,a=null!==(t=e.data.data.jsonRpcUrl)&&void 0!==t?t:n.jsonRpcUrl;n.updateProviderInfo(a,Number(r))}"addressChanged"===e.data.data.action&&n._setAddresses([e.data.data.address])}})),n}return s(r,[{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,v.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(I))&&void 0!==e?e:this._jsonRpcUrlFromOpts},set:function(e){this._storage.setItem(I,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._jsonRpcUrlFromOpts,this._chainIdFromOpts)}},{key:"updateProviderInfo",value:function(e,t){this.jsonRpcUrl=e;var r=this.getChainId();this._storage.setItem(A,t.toString(10)),!((0,v.ensureIntNumber)(t)!==r)&&this.hasMadeFirstChainChangedEmission||(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}},{key:"watchAsset",value:function(){var e=o(i().mark((function e(t,r,n,a,o,c){var s,f;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return s=e.sent,e.next=5,s.watchAsset(t,r,n,a,o,null===c||void 0===c?void 0:c.toString()).promise;case 5:return f=e.sent,e.abrupt("return",!!f.result);case 7:case"end":return e.stop()}}),e,this)})));return function(t,r,n,a,i,o){return e.apply(this,arguments)}}()},{key:"addEthereumChain",value:function(){var e=o(i().mark((function e(t,r,n,a,o,c){var s,f,u,d,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((0,v.ensureIntNumber)(t)!==this.getChainId()){e.next=2;break}return e.abrupt("return",!1);case 2:return e.next=4,this.initializeRelay();case 4:if(u=e.sent,d=u.inlineAddEthereumChain(t.toString()),this._isAuthorized()||d){e.next=9;break}return e.next=9,u.requestEthereumAccounts().promise;case 9:return e.next=11,u.addEthereumChain(t.toString(),r,o,n,a,c).promise;case 11:return l=e.sent,!0===(null===(s=l.result)||void 0===s?void 0:s.isApproved)&&this.updateProviderInfo(r[0],t),e.abrupt("return",!0===(null===(f=l.result)||void 0===f?void 0:f.isApproved));case 14:case"end":return e.stop()}}),e,this)})));return function(t,r,n,a,i,o){return e.apply(this,arguments)}}()},{key:"switchEthereumChain",value:function(){var e=o(i().mark((function e(t){var r,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return E.includes(t)&&this.updateProviderInfo(this.jsonRpcUrl,t),e.next=3,this.initializeRelay();case 3:return r=e.sent,e.next=6,r.switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;case 6:if(!(n=e.sent).errorCode){e.next=9;break}throw p.ethErrors.provider.custom({code:n.errorCode});case 9:(a=n.result).isApproved&&a.rpcUrl.length>0&&this.updateProviderInfo(a.rpcUrl,t);case 11: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(r){return r.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(m.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?x.Session.hash(this._relay.session.id):void 0}),!(this._addresses.length>0)){e.next=3;break}return e.abrupt("return",a(this._addresses));case 3:return e.next=5,this._send(M.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){var r=this;if("string"===typeof e){var n={jsonrpc:"2.0",id:0,method:e,params:Array.isArray(t)?t:void 0!==t?[t]:[]};return this._sendRequestAsync(n).then((function(e){return e.result}))}if("function"===typeof t){var a=e,i=t;return this._sendAsync(a,i)}if(Array.isArray(e))return e.map((function(e){return r._sendRequest(e)}));var o=e;return this._sendRequest(o)}},{key:"sendAsync",value:function(){var e=o(i().mark((function e(t,r){var n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"===typeof r){e.next=2;break}throw new Error("callback is required");case 2:if(!Array.isArray(t)){e.next=6;break}return n=r,this._sendMultipleRequestsAsync(t).then((function(e){return n(null,e)})).catch((function(e){return n(e,null)})),e.abrupt("return");case 6:return a=r,e.abrupt("return",this._sendRequestAsync(t).then((function(e){return a(null,e)})).catch((function(e){return a(e,null)})));case 8:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"request",value:function(){var e=o(i().mark((function e(t){var r,n,a,o,c;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 p.ethErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});case 2:if(r=t.method,n=t.params,"string"===typeof r&&0!==r.length){e.next=5;break}throw p.ethErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});case 5:if(void 0===n||Array.isArray(n)||"object"===typeof n&&null!==n){e.next=7;break}throw p.ethErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});case 7:return a=void 0===n?[]:n,o=this._relayEventManager.makeRequestId(),e.next=11,this._sendRequestAsync({method:r,params:a,jsonrpc:"2.0",id:o});case 11:return c=e.sent,e.abrupt("return",c.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 r,n;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,v.ensureRegExpString)(t)).promise;case 5:if("string"===typeof(n=e.sent).result){e.next=8;break}throw new Error("result was not a string");case 8:return e.abrupt("return",n.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,r){var n,a;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.genericRequest(t,r).promise;case 5:if("string"===typeof(a=e.sent).result){e.next=8;break}throw new Error("result was not a string");case 8:return e.abrupt("return",a.result);case 9:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"selectProvider",value:function(){var e=o(i().mark((function e(t){var r,n;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(n=e.sent).result){e.next=8;break}throw new Error("result was not a string");case 8:return e.abrupt("return",n.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},r=e.method;if(t.result=this._handleSynchronousMethods(e),void 0===t.result)throw new Error("Coinbase Wallet does not support calling ".concat(r," synchronously without ")+"a callback. Please provide a callback parameter to call ".concat(r," ")+"asynchronously.");return t}},{key:"_setAddresses",value:function(e,t){if(!Array.isArray(e))throw new Error("addresses is not an array");var r=e.map((function(e){return(0,v.ensureAddressString)(e)}));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&!1===this.supportsAddressSwitching&&!t||(this._addresses=r,this.emit("accountsChanged",this._addresses),this._storage.setItem(g.LOCAL_STORAGE_ADDRESSES_KEY,r.join(" "))))}},{key:"_sendRequestAsync",value:function(e){var t=this;return new Promise((function(r,n){try{var a=t._handleSynchronousMethods(e);if(void 0!==a)return r({jsonrpc:"2.0",id:e.id,result:a});var i=t._handleAsynchronousFilterMethods(e);if(void 0!==i)return void i.then((function(t){return r(Object.assign(Object.assign({},t),{id:e.id}))})).catch((function(e){return n(e)}));var o=t._handleSubscriptionMethods(e);if(void 0!==o)return void o.then((function(t){return r({jsonrpc:"2.0",id:e.id,result:t.result})})).catch((function(e){return n(e)}))}catch(c){return n(c)}t._handleAsynchronousMethods(e).then((function(t){return t&&r(Object.assign(Object.assign({},t),{id:e.id}))})).catch((function(e){return n(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,r=e.params||[];switch(t){case M.JSONRPCMethod.eth_accounts:return this._eth_accounts();case M.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case M.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(r);case M.JSONRPCMethod.net_version:return this._net_version();case M.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}},{key:"_handleAsynchronousMethods",value:function(){var e=o(i().mark((function e(t){var r,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.method,n=t.params||[],e.t0=r,e.next=e.t0===M.JSONRPCMethod.eth_requestAccounts?5:e.t0===M.JSONRPCMethod.eth_sign?6:e.t0===M.JSONRPCMethod.eth_ecRecover?7:e.t0===M.JSONRPCMethod.personal_sign?8:e.t0===M.JSONRPCMethod.personal_ecRecover?9:e.t0===M.JSONRPCMethod.eth_signTransaction?10:e.t0===M.JSONRPCMethod.eth_sendRawTransaction?11:e.t0===M.JSONRPCMethod.eth_sendTransaction?12:e.t0===M.JSONRPCMethod.eth_signTypedData_v1?13:e.t0===M.JSONRPCMethod.eth_signTypedData_v2?14:e.t0===M.JSONRPCMethod.eth_signTypedData_v3?15:e.t0===M.JSONRPCMethod.eth_signTypedData_v4||e.t0===M.JSONRPCMethod.eth_signTypedData?16:e.t0===M.JSONRPCMethod.cbWallet_arbitrary?17:e.t0===M.JSONRPCMethod.wallet_addEthereumChain?18:e.t0===M.JSONRPCMethod.wallet_switchEthereumChain?19:e.t0===M.JSONRPCMethod.wallet_watchAsset?20:21;break;case 5:return e.abrupt("return",this._eth_requestAccounts());case 6:return e.abrupt("return",this._eth_sign(n));case 7:return e.abrupt("return",this._eth_ecRecover(n));case 8:return e.abrupt("return",this._personal_sign(n));case 9:return e.abrupt("return",this._personal_ecRecover(n));case 10:return e.abrupt("return",this._eth_signTransaction(n));case 11:return e.abrupt("return",this._eth_sendRawTransaction(n));case 12:return e.abrupt("return",this._eth_sendTransaction(n));case 13:return e.abrupt("return",this._eth_signTypedData_v1(n));case 14:return e.abrupt("return",this._throwUnsupportedMethodError());case 15:return e.abrupt("return",this._eth_signTypedData_v3(n));case 16:return e.abrupt("return",this._eth_signTypedData_v4(n));case 17:return e.abrupt("return",this._cbwallet_arbitrary(n));case 18:return e.abrupt("return",this._wallet_addEthereumChain(n));case 19:return e.abrupt("return",this._wallet_switchEthereumChain(n));case 20:return e.abrupt("return",this._wallet_watchAsset(n));case 21:return e.next=23,this.initializeRelay();case 23:return a=e.sent,e.abrupt("return",a.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,r=e.params||[];switch(t){case M.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(r);case M.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case M.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case M.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(r);case M.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(r)}}},{key:"_handleSubscriptionMethods",value:function(e){switch(e.method){case M.JSONRPCMethod.eth_subscribe:case M.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}},{key:"_isKnownAddress",value:function(e){try{var t=(0,v.ensureAddressString)(e);return this._addresses.map((function(e){return(0,v.ensureAddressString)(e)})).includes(t)}catch(r){}return!1}},{key:"_ensureKnownAddress",value:function(e){var t;if(!this._isKnownAddress(e))throw null===(t=this.diagnostic)||void 0===t||t.log(m.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}},{key:"_prepareTransactionParams",value:function(e){var t=e.from?(0,v.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");return this._ensureKnownAddress(t),{fromAddress:t,toAddress:e.to?(0,v.ensureAddressString)(e.to):null,weiValue:null!=e.value?(0,v.ensureBN)(e.value):new b.default(0),data:e.data?(0,v.ensureBuffer)(e.data):n.alloc(0),nonce:null!=e.nonce?(0,v.ensureIntNumber)(e.nonce):null,gasPriceInWei:null!=e.gasPrice?(0,v.ensureBN)(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?(0,v.ensureBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,v.ensureBN)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,v.ensureBN)(e.gas):null,chainId:this.getChainId()}}},{key:"_isAuthorized",value:function(){return this._addresses.length>0}},{key:"_requireAuthorization",value:function(){if(!this._isAuthorized())throw p.ethErrors.provider.unauthorized({})}},{key:"_throwUnsupportedMethodError",value:function(){throw p.ethErrors.provider.unsupportedMethod({})}},{key:"_signEthereumMessage",value:function(){var e=o(i().mark((function e(t,r,n,a){var o,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._ensureKnownAddress(r),e.prev=1,e.next=4,this.initializeRelay();case 4:return o=e.sent,e.next=7,o.signEthereumMessage(t,r,n,a).promise;case 7:return c=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:c.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 p.ethErrors.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,r,n,a){return e.apply(this,arguments)}}()},{key:"_ethereumAddressFromSignedMessage",value:function(){var e=o(i().mark((function e(t,r,n){var a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initializeRelay();case 2:return a=e.sent,e.next=5,a.ethereumAddressFromSignedMessage(t,r,n).promise;case 5:return o=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:o.result});case 7:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"_eth_accounts",value:function(){return a(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,v.hexStringFromIntNumber)(this.getChainId())}},{key:"getChainId",value:function(){var e=this._storage.getItem(A);if(!e)return(0,v.ensureIntNumber)(this._chainIdFromOpts);var t=parseInt(e,10);return(0,v.ensureIntNumber)(t)}},{key:"_eth_requestAccounts",value:function(){var e=o(i().mark((function e(){var t,r,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this.diagnostic)||void 0===t||t.log(m.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?x.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 n=e.sent,e.next=9,n.requestEthereumAccounts().promise;case 9:r=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 p.ethErrors.provider.userRejectedRequest("User denied account authorization");case 16:throw e.t0;case 17:if(r.result){e.next=19;break}throw new Error("accounts received is empty");case 19:if(this._setAddresses(r.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,v.ensureAddressString)(e[0]),r=(0,v.ensureBuffer)(e[1]);return this._signEthereumMessage(r,t,!1)}},{key:"_eth_ecRecover",value:function(e){var t=(0,v.ensureBuffer)(e[0]),r=(0,v.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!1)}},{key:"_personal_sign",value:function(e){this._requireAuthorization();var t=(0,v.ensureBuffer)(e[0]),r=(0,v.ensureAddressString)(e[1]);return this._signEthereumMessage(t,r,!0)}},{key:"_personal_ecRecover",value:function(e){var t=(0,v.ensureBuffer)(e[0]),r=(0,v.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!0)}},{key:"_eth_signTransaction",value:function(){var e=o(i().mark((function e(t){var r,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),r=this._prepareTransactionParams(t[0]||{}),e.prev=2,e.next=5,this.initializeRelay();case 5:return n=e.sent,e.next=8,n.signEthereumTransaction(r).promise;case 8:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a.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 p.ethErrors.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 r,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,v.ensureBuffer)(t[0]),e.next=3,this.initializeRelay();case 3:return n=e.sent,e.next=6,n.submitEthereumTransaction(r,this.getChainId()).promise;case 6:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a.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 r,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),r=this._prepareTransactionParams(t[0]||{}),e.prev=2,e.next=5,this.initializeRelay();case 5:return n=e.sent,e.next=8,n.signAndSubmitEthereumTransaction(r).promise;case 8:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a.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 p.ethErrors.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 r,n,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),r=(0,v.ensureParsedJSONObject)(t[0]),n=(0,v.ensureAddressString)(t[1]),this._ensureKnownAddress(n),a=y.default.hashForSignTypedDataLegacy({data:r}),o=JSON.stringify(r,null,2),e.abrupt("return",this._signEthereumMessage(a,n,!1,o));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 r,n,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),r=(0,v.ensureAddressString)(t[0]),n=(0,v.ensureParsedJSONObject)(t[1]),this._ensureKnownAddress(r),a=y.default.hashForSignTypedData_v3({data:n}),o=JSON.stringify(n,null,2),e.abrupt("return",this._signEthereumMessage(a,r,!1,o));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 r,n,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._requireAuthorization(),r=(0,v.ensureAddressString)(t[0]),n=(0,v.ensureParsedJSONObject)(t[1]),this._ensureKnownAddress(r),a=y.default.hashForSignTypedData_v4({data:n}),o=JSON.stringify(n,null,2),e.abrupt("return",this._signEthereumMessage(a,r,!1,o));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 r,n,a;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t[0],"string"===typeof(n=t[1])){e.next=4;break}throw new Error("parameter must be a string");case 4:if("object"===typeof r&&null!==r){e.next=6;break}throw new Error("parameter must be an object");case 6:return e.next=8,this.genericRequest(r,n);case 8:return a=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:a});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 r,n,a,o,c,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=t[0],0!==(null===(r=c.rpcUrls)||void 0===r?void 0:r.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(c.chainName&&""!==c.chainName.trim()){e.next=5;break}throw p.ethErrors.provider.custom({code:0,message:"chainName is a required field"});case 5:if(c.nativeCurrency){e.next=7;break}throw p.ethErrors.provider.custom({code:0,message:"nativeCurrency is a required field"});case 7:return s=parseInt(c.chainId,16),e.next=10,this.addEthereumChain(s,null!==(n=c.rpcUrls)&&void 0!==n?n:[],null!==(a=c.blockExplorerUrls)&&void 0!==a?a:[],c.chainName,null!==(o=c.iconUrls)&&void 0!==o?o:[],c.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 r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t[0],e.next=3,this.switchEthereumChain(parseInt(r.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 r,n,a,o,c,s,f,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=Array.isArray(t)?t[0]:t).type){e.next=3;break}throw p.ethErrors.rpc.invalidParams({message:"Type is required"});case 3:if("ERC20"===(null===r||void 0===r?void 0:r.type)){e.next=5;break}throw p.ethErrors.rpc.invalidParams({message:"Asset of type '".concat(r.type,"' is not supported")});case 5:if(null===r||void 0===r?void 0:r.options){e.next=7;break}throw p.ethErrors.rpc.invalidParams({message:"Options are required"});case 7:if(null===r||void 0===r?void 0:r.options.address){e.next=9;break}throw p.ethErrors.rpc.invalidParams({message:"Address is required"});case 9:return n=this.getChainId(),a=r.options,o=a.address,c=a.symbol,s=a.image,f=a.decimals,e.next=13,this.watchAsset(r.type,o,c,f,s,n);case 13:return u=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:u});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,v.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(t)}},{key:"_eth_newFilter",value:function(){var e=o(i().mark((function e(t){var r,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t[0],e.next=3,this._filterPolyfill.newFilter(r);case 3:return n=e.sent,e.abrupt("return",{jsonrpc:"2.0",id:0,result:n});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,v.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(t)}},{key:"_eth_getFilterLogs",value:function(e){var t=(0,v.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,r){return e._setAddresses(t,r)})),t.setChainCallback((function(t,r){e.updateProviderInfo(r,parseInt(t,10))})),t.setDappDefaultChainCallback(e._chainIdFromOpts),e._relay=t,t}))}}]),r}(h.default);t.CoinbaseWalletProvider=S},15142:function(e,t,r){"use strict";var n=r(48485).default,a=r(7433).default,i=r(95830).default,o=r(48064).default,c=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.filterFromParam=t.FilterPolyfill=void 0;var s=r(93352),f=r(31807),u={jsonrpc:"2.0",id:0},d=function(){function e(t){o(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,s.IntNumber)(1),this.provider=t}return c(e,[{key:"newFilter",value:function(){var e=i(a().mark((function e(t){var r,n,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=l(t),n=this.makeFilterId(),e.next=4,this.setInitialCursorPosition(n,r.fromBlock);case 4:return i=e.sent,console.log("Installing new log filter(".concat(n,"):"),r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),e.abrupt("return",(0,f.hexStringFromIntNumber)(n));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"newBlockFilter",value:function(){var e=i(a().mark((function e(){var t,r;return a().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 r=e.sent,console.log("Installing new block filter (".concat(t,") with initial cursor position:"),r),this.blockFilters.add(t),this.setFilterTimeout(t),e.abrupt("return",(0,f.hexStringFromIntNumber)(t));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"newPendingTransactionFilter",value:function(){var e=i(a().mark((function e(){var t,r;return a().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 r=e.sent,console.log("Installing new block filter (".concat(t,") with initial cursor position:"),r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),e.abrupt("return",(0,f.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,f.intNumberFromHexString)(e);return console.log("Uninstalling filter (".concat(t,")")),this.deleteFilter(t),!0}},{key:"getFilterChanges",value:function(e){var t=(0,f.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=i(a().mark((function e(t){var r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(0,f.intNumberFromHexString)(t),n=this.logFilters.get(r)){e.next=4;break}return e.abrupt("return",m());case 4:return e.abrupt("return",this.sendAsyncPromise(Object.assign(Object.assign({},u),{method:"eth_getLogs",params:[h(n)]})));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"makeFilterId",value:function(){return(0,s.IntNumber)(++this.nextFilterId)}},{key:"sendAsyncPromise",value:function(e){var t=this;return new Promise((function(r,n){t.provider.sendAsync(e,(function(e,t){return e?n(e):Array.isArray(t)||null==t?n(new Error("unexpected response received: ".concat(JSON.stringify(t)))):void r(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=i(a().mark((function e(t){var r,i,o,c,d,l,b,p;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.logFilters.get(t),(i=this.cursors.get(t))&&r){e.next=4;break}return e.abrupt("return",m());case 4:return e.next=6,this.getCurrentBlockHeight();case 6:if(o=e.sent,c="latest"===r.toBlock?o:r.toBlock,!(i>o)){e.next=10;break}return e.abrupt("return",x());case 10:if(!(i>r.toBlock)){e.next=12;break}return e.abrupt("return",x());case 12:return console.log("Fetching logs from ".concat(i," to ").concat(c," for filter ").concat(t)),e.next=15,this.sendAsyncPromise(Object.assign(Object.assign({},u),{method:"eth_getLogs",params:[h(Object.assign(Object.assign({},r),{fromBlock:i,toBlock:c}))]}));case 15:return d=e.sent,Array.isArray(d.result)&&(l=d.result.map((function(e){return(0,f.intNumberFromHexString)(e.blockNumber||"0x0")})),(b=Math.max.apply(Math,n(l)))&&b>i&&(p=(0,s.IntNumber)(b+1),console.log("Moving cursor position for filter (".concat(t,") from ").concat(i," to ").concat(p)),this.cursors.set(t,p))),e.abrupt("return",d);case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getBlockFilterChanges",value:function(){var e=i(a().mark((function e(t){var r,n,i,o,c=this;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.cursors.get(t)){e.next=3;break}return e.abrupt("return",m());case 3:return e.next=5,this.getCurrentBlockHeight();case 5:if(n=e.sent,!(r>n)){e.next=8;break}return e.abrupt("return",x());case 8:return console.log("Fetching blocks from ".concat(r," to ").concat(n," for filter (").concat(t,")")),e.next=11,Promise.all((0,f.range)(r,n+1).map((function(e){return c.getBlockHashByNumber((0,s.IntNumber)(e))})));case 11:return i=e.sent.filter((function(e){return!!e})),o=(0,s.IntNumber)(r+i.length),console.log("Moving cursor position for filter (".concat(t,") from ").concat(r," to ").concat(o)),this.cursors.set(t,o),e.abrupt("return",Object.assign(Object.assign({},u),{result:i}));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getPendingTransactionFilterChanges",value:function(){var e=i(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve(x()));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"setInitialCursorPosition",value:function(){var e=i(a().mark((function e(t,r){var n,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getCurrentBlockHeight();case 2:return n=e.sent,i="number"===typeof r&&r>n?r:n,this.cursors.set(t,i),e.abrupt("return",i);case 6:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"setFilterTimeout",value:function(e){var t=this,r=this.timeouts.get(e);r&&window.clearTimeout(r);var n=window.setTimeout((function(){console.log("Filter (".concat(e,") timed out")),t.deleteFilter(e)}),3e5);this.timeouts.set(e,n)}},{key:"getCurrentBlockHeight",value:function(){var e=i(a().mark((function e(){var t,r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},u),{method:"eth_blockNumber",params:[]}));case 2:return t=e.sent,r=t.result,e.abrupt("return",(0,f.intNumberFromHexString)((0,f.ensureHexString)(r)));case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getBlockHashByNumber",value:function(){var e=i(a().mark((function e(t){var r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendAsyncPromise(Object.assign(Object.assign({},u),{method:"eth_getBlockByNumber",params:[(0,f.hexStringFromIntNumber)(t),!1]}));case 2:if(!(r=e.sent).result||"string"!==typeof r.result.hash){e.next=5;break}return e.abrupt("return",(0,f.ensureHexString)(r.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 l(e){return{fromBlock:b(e.fromBlock),toBlock:b(e.toBlock),addresses:void 0===e.address?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}function h(e){var t={fromBlock:p(e.fromBlock),toBlock:p(e.toBlock),topics:e.topics};return null!==e.addresses&&(t.address=e.addresses),t}function b(e){if(void 0===e||"latest"===e||"pending"===e)return"latest";if("earliest"===e)return(0,s.IntNumber)(0);if((0,f.isHexString)(e))return(0,f.intNumberFromHexString)(e);throw new Error("Invalid block option: ".concat(String(e)))}function p(e){return"latest"===e?e:(0,f.hexStringFromIntNumber)(e)}function m(){return Object.assign(Object.assign({},u),{error:{code:-32e3,message:"filter not found"}})}function x(){return Object.assign(Object.assign({},u),{result:[]})}t.FilterPolyfill=d,t.filterFromParam=l},98377: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={}))},68374:function(e,t,r){"use strict";var n=r(7433).default,a=r(95830).default,i=r(48064).default,o=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionManager=void 0;var c=r(60372),s=r(43992),f=function(){},u=function(){function e(t){i(this,e);var r=new c({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),n=s({blockTracker:r,provider:t}),a=n.events,o=n.middleware;this.events=a,this.subscriptionMiddleware=o}return o(e,[{key:"handleRequest",value:function(){var e=a(n().mark((function e(t){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={},e.next=3,this.subscriptionMiddleware(t,r,f,f);case 3:return e.abrupt("return",r);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=u},26268:function(e,t,r){"use strict";var n=r(48064).default,a=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKUI=void 0;var i=r(49751),o=r(29266),c=r(96100),s=function(){function e(t){n(this,e),this.standalone=null,this.attached=!1,this.snackbar=new o.Snackbar({darkMode:t.darkMode}),this.linkFlow=new i.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 a(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,c.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",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",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:"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=s},66513:function(e,t,r){"use strict";var n=r(18231).default,a=r(48064).default,i=r(89137).default,o=r(53744).default,c=r(12682).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletUIError=void 0;var s=function(e){i(r,e);var t=o(r);function r(e,n){var i;return a(this,r),(i=t.call(this,e)).message=e,i.errorCode=n,i}return n(r)}(c(Error));t.WalletUIError=s,s.UserRejectedRequest=new s("User rejected request"),s.SwitchEthereumChainUnsupportedChainId=new s("Unsupported chainId",4902)},30701: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={}))},76388:function(e,t,r){"use strict";var n=r(48064).default,a=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;var i=r(68134),o=r(4476),c=r(85730),s=r(31807),f="session:id",u="session:secret",d="session:linked",l=function(){function e(t,r,a,i){n(this,e),this._storage=t,this._id=r||(0,s.randomBytesHex)(16),this._secret=a||(0,s.randomBytesHex)(32),this._key=(new c.sha256).update("".concat(this._id,", ").concat(this._secret," WalletLink")).digest("hex"),this._linked=!!i}return a(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(f,this._id),this._storage.setItem(u,this._secret),this.persistLinked(),this}},{key:"persistLinked",value:function(){this._storage.setItem(d,this._linked?"1":"0")}}],[{key:"load",value:function(t){var r=t.getItem(f),n=t.getItem(d),a=t.getItem(u);return r&&a?new e(t,r,a,"1"===n):null}},{key:"persistedSessionIdChange$",get:function(){return(0,i.fromEvent)(window,"storage").pipe((0,o.filter)((function(e){return e.key===f})),(0,o.map)((function(e){return{oldValue:e.oldValue||null,newValue:e.newValue||null}})))}},{key:"hash",value:function(e){return(new c.sha256).update(e).digest("hex")}}]),e}();t.Session=l},31383:function(e,t,r){"use strict";var n=r(94534).default,a=r(48064).default,i=r(18231).default,o=r(89137).default,c=r(53744).default,s=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),f=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__decorate||function(e,t,r,n){var a,i=arguments.length,o=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(o=(i<3?a(o):i>3?a(t,r,o):a(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},d=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return f(t,e),t},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelay=void 0;var h=l(r(144)),b=r(56216),p=r(68134),m=r(4476),x=r(95311),g=r(77594),v=r(66513),y=r(93352),w=r(31807),M=d(r(28595)),k=r(76388),A=r(84715),I=r(14393),E=r(65421),S=r(4398),_=r(30826),N=r(36098),j=function(e){o(r,e);var t=c(r);function r(e){var n,i;a(this,r),(n=t.call(this)).accountsCallback=null,n.chainCallback=null,n.dappDefaultChainSubject=new p.BehaviorSubject(1),n.dappDefaultChain=1,n.appName="",n.appLogoUrl=null,n.subscriptions=new p.Subscription,n.linkAPIUrl=e.linkAPIUrl,n.storage=e.storage,n.options=e;var o=n.subscribe(),c=o.session,s=o.ui,f=o.connection;if(n._session=c,n.connection=f,n.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");return e.eventListener?n.diagnostic={log:e.eventListener.onEvent}:n.diagnostic=e.diagnosticLogger,n._reloadOnDisconnect=null===(i=e.reloadOnDisconnect)||void 0===i||i,n.ui=s,n}return i(r,[{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(),a=new g.WalletSDKConnection(t.id,t.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(a.sessionConfig$.subscribe({next:function(t){e.onSessionConfigChanged(t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(x.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(a.incomingEvent$.pipe((0,m.filter)((function(e){return"Web3Response"===e.event}))).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(a.linked$.pipe((0,m.skip)(1),(0,m.tap)((function(t){var r;e.isLinked=t;var n=e.storage.getItem(A.LOCAL_STORAGE_ADDRESSES_KEY);if(t&&(e.session.linked=t),e.isUnlinkedErrorState=!1,n){var a=n.split(" "),i="true"===e.storage.getItem("IsStandaloneSigning");if(""!==a[0]&&!t&&e.session.linked&&!i){e.isUnlinkedErrorState=!0;var o=e.getSessionIdHash();null===(r=e.diagnostic)||void 0===r||r.log(x.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:o})}}}))).subscribe()),this.subscriptions.add(a.sessionConfig$.pipe((0,m.filter)((function(e){return!!e.metadata&&"1"===e.metadata.__destroyed}))).subscribe((function(){var t,r=a.isDestroyed;return null===(t=e.diagnostic)||void 0===t||t.log(x.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:r,sessionIdHash:e.getSessionIdHash()}),e.resetAndReload()}))),this.subscriptions.add(a.sessionConfig$.pipe((0,m.filter)((function(e){return e.metadata&&void 0!==e.metadata.WalletUsername}))).pipe((0,m.mergeMap)((function(e){return M.decrypt(e.metadata.WalletUsername,t.secret)}))).subscribe({next:function(t){e.storage.setItem(A.WALLET_USER_NAME_KEY,t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(x.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(a.sessionConfig$.pipe((0,m.filter)((function(e){return e.metadata&&void 0!==e.metadata.AppVersion}))).pipe((0,m.mergeMap)((function(e){return M.decrypt(e.metadata.AppVersion,t.secret)}))).subscribe({next:function(t){e.storage.setItem(A.APP_VERSION_KEY,t)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(x.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(a.sessionConfig$.pipe((0,m.filter)((function(e){return e.metadata&&void 0!==e.metadata.ChainId&&void 0!==e.metadata.JsonRpcUrl}))).pipe((0,m.mergeMap)((function(e){return(0,p.zip)(M.decrypt(e.metadata.ChainId,t.secret),M.decrypt(e.metadata.JsonRpcUrl,t.secret))}))).pipe((0,m.distinctUntilChanged)()).subscribe({next:function(t){var r=n(t,2),a=r[0],i=r[1];e.chainCallback&&e.chainCallback(a,i)},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(x.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(a.sessionConfig$.pipe((0,m.filter)((function(e){return e.metadata&&void 0!==e.metadata.EthereumAddress}))).pipe((0,m.mergeMap)((function(e){return M.decrypt(e.metadata.EthereumAddress,t.secret)}))).subscribe({next:function(t){e.accountsCallback&&e.accountsCallback([t]),r.accountRequestCallbackIds.size>0&&(Array.from(r.accountRequestCallbackIds.values()).forEach((function(r){var n=(0,N.Web3ResponseMessage)({id:r,response:(0,_.RequestEthereumAccountsResponse)([t])});e.invokeCallback(Object.assign(Object.assign({},n),{id:r}))})),r.accountRequestCallbackIds.clear())},error:function(){var t;null===(t=e.diagnostic)||void 0===t||t.log(x.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}}));var i=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:t,connected$:a.connected$,chainId$:this.dappDefaultChainSubject});return a.connect(),{session:t,ui:i,connection:a}}},{key:"attachUI",value:function(){this.ui.attach()}},{key:"resetAndReload",value:function(){var e=this;this.connection.setSessionMetadata("__destroyed","1").pipe((0,m.timeout)(1e3),(0,m.catchError)((function(e){return(0,p.of)(null)}))).subscribe((function(t){var r,n,a,i=e.ui.isStandalone();try{e.subscriptions.unsubscribe()}catch(d){null===(r=e.diagnostic)||void 0===r||r.log(x.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}null===(n=e.diagnostic)||void 0===n||n.log(x.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:e.getSessionIdHash()}),e.connection.destroy();var o=k.Session.load(e.storage);if((null===o||void 0===o?void 0:o.id)===e._session.id?e.storage.clear():o&&(null===(a=e.diagnostic)||void 0===a||a.log(x.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:e.getSessionIdHash(),storedSessionIdHash:k.Session.hash(o.id)})),e._reloadOnDisconnect)e.ui.reloadUI();else{e.accountsCallback&&e.accountsCallback([],!0);var c=e.subscribe(),s=c.session,f=c.ui,u=c.connection;e._session=s,e.connection=u,e.ui=f,i&&e.ui.setStandalone&&e.ui.setStandalone(!0),e.attachUI()}}),(function(t){var r;null===(r=e.diagnostic)||void 0===r||r.log(x.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,r,n){return this.sendRequest({method:I.Web3Method.signEthereumMessage,params:{message:(0,w.hexStringFromBuffer)(e,!0),address:t,addPrefix:r,typedDataJson:n||null}})}},{key:"ethereumAddressFromSignedMessage",value:function(e,t,r){return this.sendRequest({method:I.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,w.hexStringFromBuffer)(e,!0),signature:(0,w.hexStringFromBuffer)(t,!0),addPrefix:r}})}},{key:"signEthereumTransaction",value:function(e){return this.sendRequest({method:I.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:I.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:I.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,w.hexStringFromBuffer)(e,!0),chainId:t}})}},{key:"scanQRCode",value:function(e){return this.sendRequest({method:I.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:I.Web3Method.generic,params:{action:t,data:e}})}},{key:"sendGenericMessage",value:function(e){return this.sendRequest(e)}},{key:"sendRequest",value:function(e){var t=this,r=null,n=(0,w.randomBytesHex)(8),a=function(a){t.publishWeb3RequestCanceledEvent(n),t.handleErrorResponse(n,e.method,a),null===r||void 0===r||r()};return{promise:new Promise((function(i,o){t.ui.isStandalone()||(r=t.ui.showConnecting({isUnlinkedErrorState:t.isUnlinkedErrorState,onCancel:a,onResetConnection:t.resetAndReload})),t.relayEventManager.callbacks.set(n,(function(e){if(null===r||void 0===r||r(),e.errorMessage)return o(new Error(e.errorMessage));i(e)})),t.ui.isStandalone()?t.sendRequestStandalone(n,e):t.publishWeb3RequestEvent(n,e)})),cancel:a}}},{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 r,n=this,a=(0,S.Web3RequestMessage)({id:e,request:t}),i=k.Session.load(this.storage);null===(r=this.diagnostic)||void 0===r||r.log(x.EVENTS.WEB3_REQUEST,{eventId:a.id,method:"relay::".concat(a.request.method),sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?k.Session.hash(i.id):"",isSessionMismatched:((null===i||void 0===i?void 0:i.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",a,!0).subscribe({next:function(e){var t;null===(t=n.diagnostic)||void 0===t||t.log(x.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:a.id,method:"relay::".concat(a.request.method),sessionIdHash:n.getSessionIdHash(),storedSessionIdHash:i?k.Session.hash(i.id):"",isSessionMismatched:((null===i||void 0===i?void 0:i.id)!==n._session.id).toString()})},error:function(e){n.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:a.id,response:{method:a.request.method,errorMessage:e.message}}))}}))}},{key:"publishWeb3RequestCanceledEvent",value:function(e){var t=(0,E.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",t,!1).subscribe())}},{key:"publishEvent",value:function(e,t,r){var n=this,a=this.session.secret;return new p.Observable((function(e){M.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin})),a).then((function(t){e.next(t),e.complete()}))})).pipe((0,m.mergeMap)((function(t){return n.connection.publishEvent(e,t,r)})))}},{key:"handleIncomingEvent",value:function(e){var t=this;try{this.subscriptions.add(M.decrypt(e.data,this.session.secret).pipe((0,m.map)((function(e){return JSON.parse(e)}))).subscribe({next:function(e){var r=(0,N.isWeb3ResponseMessage)(e)?e:null;r&&t.handleWeb3ResponseMessage(r)},error:function(){var e;null===(e=t.diagnostic)||void 0===e||e.log(x.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch(r){return}}},{key:"handleWeb3ResponseMessage",value:function(e){var t,n=this,a=e.response;if(null===(t=this.diagnostic)||void 0===t||t.log(x.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:"relay::".concat(a.method),sessionIdHash:this.getSessionIdHash()}),(0,_.isRequestEthereumAccountsResponse)(a))return r.accountRequestCallbackIds.forEach((function(t){return n.invokeCallback(Object.assign(Object.assign({},e),{id:t}))})),void r.accountRequestCallbackIds.clear();this.invokeCallback(e)}},{key:"handleErrorResponse",value:function(e,t,r,n){this.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:e,response:(0,_.ErrorResponse)(t,(null!==r&&void 0!==r?r:v.WalletUIError.UserRejectedRequest).message,n)}))}},{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:I.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},n=(0,w.randomBytesHex)(8),a=function(r){e.publishWeb3RequestCanceledEvent(n),e.handleErrorResponse(n,t.method,r)};return{promise:new Promise((function(i,o){var c;e.relayEventManager.callbacks.set(n,(function(t){if(e.ui.hideRequestEthereumAccounts(),t.errorMessage)return o(new Error(t.errorMessage));i(t)}));var s=(null===(c=null===window||void 0===window?void 0:window.navigator)||void 0===c?void 0:c.userAgent)||null;if(s&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(s)){var f;try{f=(0,w.isInIFrame)()&&window.top?window.top.location:window.location}catch(d){f=window.location}f.href="https://go.cb-w.com/xoXnYwQimhb?cb_url=".concat(encodeURIComponent(f.href))}else{if(e.ui.inlineAccountsResponse()){e.ui.requestEthereumAccounts({onCancel:a,onAccounts:function(t){e.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:n,response:(0,_.RequestEthereumAccountsResponse)(t)}))}})}else{var u=b.ethErrors.provider.userRejectedRequest("User denied account authorization");e.ui.requestEthereumAccounts({onCancel:function(){return a(u)}})}r.accountRequestCallbackIds.add(n),e.ui.inlineAccountsResponse()||e.ui.isStandalone()||e.publishWeb3RequestEvent(n,t)}})),cancel:a}}},{key:"selectProvider",value:function(e){var t=this,r={method:I.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,w.randomBytesHex)(8);return{cancel:function(e){t.publishWeb3RequestCanceledEvent(n),t.handleErrorResponse(n,r.method,e)},promise:new Promise((function(r,a){t.relayEventManager.callbacks.set(n,(function(e){if(e.errorMessage)return a(new Error(e.errorMessage));r(e)}));t.ui.selectProvider&&t.ui.selectProvider({onApprove:function(e){t.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:n,response:(0,_.SelectProviderResponse)(e)}))},onCancel:function(e){t.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:n,response:(0,_.SelectProviderResponse)(y.ProviderType.Unselected)}))},providerOptions:e})}))}}},{key:"watchAsset",value:function(e,t,r,n,a,i){var o=this,c={method:I.Web3Method.watchAsset,params:{type:e,options:{address:t,symbol:r,decimals:n,image:a},chainId:i}},s=null,f=(0,w.randomBytesHex)(8),u=function(e){o.publishWeb3RequestCanceledEvent(f),o.handleErrorResponse(f,c.method,e),null===s||void 0===s||s()};return this.ui.inlineWatchAsset()||(s=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload})),{cancel:u,promise:new Promise((function(u,d){o.relayEventManager.callbacks.set(f,(function(e){if(null===s||void 0===s||s(),e.errorMessage)return d(new Error(e.errorMessage));u(e)}));o.ui.inlineWatchAsset()&&o.ui.watchAsset({onApprove:function(){o.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:f,response:(0,_.WatchAssetReponse)(!0)}))},onCancel:function(e){o.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:f,response:(0,_.WatchAssetReponse)(!1)}))},type:e,address:t,symbol:r,decimals:n,image:a,chainId:i}),o.ui.inlineWatchAsset()||o.ui.isStandalone()||o.publishWeb3RequestEvent(f,c)}))}}},{key:"addEthereumChain",value:function(e,t,r,n,a,i){var o=this,c={method:I.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:t,blockExplorerUrls:n,chainName:a,iconUrls:r,nativeCurrency:i}},s=null,f=(0,w.randomBytesHex)(8),u=function(e){o.publishWeb3RequestCanceledEvent(f),o.handleErrorResponse(f,c.method,e),null===s||void 0===s||s()};return this.ui.inlineAddEthereumChain(e)||(s=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload})),{promise:new Promise((function(t,r){o.relayEventManager.callbacks.set(f,(function(e){if(null===s||void 0===s||s(),e.errorMessage)return r(new Error(e.errorMessage));t(e)}));o.ui.inlineAddEthereumChain(e)&&o.ui.addEthereumChain({onCancel:function(e){o.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:f,response:(0,_.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:function(e){o.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:f,response:(0,_.AddEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),o.ui.inlineAddEthereumChain(e)||o.ui.isStandalone()||o.publishWeb3RequestEvent(f,c)})),cancel:u}}},{key:"switchEthereumChain",value:function(e,t){var r=this,n={method:I.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:t})},a=(0,w.randomBytesHex)(8);return{promise:new Promise((function(e,t){r.relayEventManager.callbacks.set(a,(function(r){return r.errorMessage&&r.errorCode?t(b.ethErrors.provider.custom({code:r.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):r.errorMessage?t(new Error(r.errorMessage)):void e(r)}));r.ui.switchEthereumChain({onCancel:function(e){if("number"===typeof e){var t=e;r.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:a,response:(0,_.ErrorResponse)(I.Web3Method.switchEthereumChain,v.WalletUIError.SwitchEthereumChainUnsupportedChainId.message,t)}))}else e instanceof v.WalletUIError?r.handleErrorResponse(a,I.Web3Method.switchEthereumChain,e,e.errorCode):r.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:a,response:(0,_.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},onApprove:function(e){r.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:a,response:(0,_.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:e})}))},chainId:n.params.chainId,address:n.params.address}),r.ui.inlineSwitchEthereumChain()||r.ui.isStandalone()||r.publishWeb3RequestEvent(a,n)})),cancel:function(e){r.publishWeb3RequestCanceledEvent(a),r.handleErrorResponse(a,n.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 r=this,n=function(n){r.handleErrorResponse(e,t.method,n)},a=function(t){r.handleWeb3ResponseMessage((0,N.Web3ResponseMessage)({id:e,response:t}))};switch(t.method){case I.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:t,onSuccess:a,onCancel:n});break;case I.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:t,onSuccess:a,onCancel:n});break;case I.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:t,onSuccess:a,onCancel:n});break;case I.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:t,onSuccess:a});break;default:n()}}},{key:"onSessionConfigChanged",value:function(e){}}]),r}(A.WalletSDKRelayAbstract);j.accountRequestCallbackIds=new Set,u([h.default],j.prototype,"resetAndReload",null),u([h.default],j.prototype,"handleIncomingEvent",null),t.WalletSDKRelay=j},84715:function(e,t,r){"use strict";var n=r(7433).default,a=r(95830).default,i=r(48064).default,o=r(18231).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 c=r(56216);t.WALLET_USER_NAME_KEY="walletUsername",t.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",t.APP_VERSION_KEY="AppVersion";var s=function(){function e(){i(this,e)}return o(e,[{key:"makeEthereumJSONRPCRequest",value:function(){var e=a(n().mark((function e(t,r){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}throw new Error("Error: No jsonRpcUrl provided");case 2:return e.abrupt("return",window.fetch(r,{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 c.ethErrors.rpc.parse({});var t=e,r=t.error;if(r)throw(0,c.serializeError)(r);return t})));case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()}]),e}();t.WalletSDKRelayAbstract=s},18892:function(e,t,r){"use strict";var n=r(48064).default,a=r(18231).default;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletSDKRelayEventManager=void 0;var i=r(31807),o=function(){function e(){n(this,e),this._nextRequestId=0,this.callbacks=new Map}return a(e,[{key:"makeRequestId",value:function(){this._nextRequestId=(this._nextRequestId+1)%2147483647;var e=this._nextRequestId,t=(0,i.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}]),e}();t.WalletSDKRelayEventManager=o},14393: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={}))},65421:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3RequestCanceledMessage=void 0;var n=r(30701);t.Web3RequestCanceledMessage=function(e){return{type:n.RelayMessageType.WEB3_REQUEST_CANCELED,id:e}}},4398:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Web3RequestMessage=void 0;var n=r(30701);t.Web3RequestMessage=function(e){return Object.assign({type:n.RelayMessageType.WEB3_REQUEST},e)}},30826:function(e,t,r){"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.ErrorResponse=void 0;var n=r(14393);t.ErrorResponse=function(e,t,r){return{method:e,errorMessage:t,errorCode:r}},t.AddEthereumChainResponse=function(e){return{method:n.Web3Method.addEthereumChain,result:e}},t.SwitchEthereumChainResponse=function(e){return{method:n.Web3Method.switchEthereumChain,result:e}},t.RequestEthereumAccountsResponse=function(e){return{method:n.Web3Method.requestEthereumAccounts,result:e}},t.WatchAssetReponse=function(e){return{method:n.Web3Method.watchAsset,result:e}},t.SelectProviderResponse=function(e){return{method:n.Web3Method.selectProvider,result:e}},t.isRequestEthereumAccountsResponse=function(e){return e&&e.method===n.Web3Method.requestEthereumAccounts},t.SignEthereumMessageResponse=function(e){return{method:n.Web3Method.signEthereumMessage,result:e}},t.SignEthereumTransactionResponse=function(e){return{method:n.Web3Method.signEthereumTransaction,result:e}},t.SubmitEthereumTransactionResponse=function(e){return{method:n.Web3Method.submitEthereumTransaction,result:e}},t.EthereumAddressFromSignedMessageResponse=function(e){return{method:n.Web3Method.ethereumAddressFromSignedMessage,result:e}}},36098:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWeb3ResponseMessage=t.Web3ResponseMessage=void 0;var n=r(30701);t.Web3ResponseMessage=function(e){return Object.assign({type:n.RelayMessageType.WEB3_RESPONSE},e)},t.isWeb3ResponseMessage=function(e){return e&&e.type===n.RelayMessageType.WEB3_RESPONSE}},28595:function(e,t,r){"use strict";var n=r(7433).default,a=r(48485).default,i=r(95830).default;Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=void 0;var o=r(68134),c=r(31807);function s(){return(s=i(n().mark((function e(t,r){var i,o,s,f,u,d,l,h,b;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(64===r.length){e.next=2;break}throw Error("secret must be 256 bits");case 2:return i=crypto.getRandomValues(new Uint8Array(12)),e.next=5,crypto.subtle.importKey("raw",(0,c.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]);case 5:return o=e.sent,s=new TextEncoder,e.next=9,window.crypto.subtle.encrypt({name:"AES-GCM",iv:i},o,s.encode(t));case 9:return f=e.sent,16,u=f.slice(f.byteLength-16),d=f.slice(0,f.byteLength-16),l=new Uint8Array(u),h=new Uint8Array(d),b=new Uint8Array([].concat(a(i),a(l),a(h))),e.abrupt("return",(0,c.uint8ArrayToHex)(b));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 o.Observable((function(r){i(n().mark((function i(){var o,s,f,u,d,l,h,b,p;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,crypto.subtle.importKey("raw",(0,c.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]);case 2:return o=n.sent,s=(0,c.hexStringToUint8Array)(e),f=s.slice(0,12),u=s.slice(12,28),d=s.slice(28),l=new Uint8Array([].concat(a(d),a(u))),h={name:"AES-GCM",iv:new Uint8Array(f)},n.prev=9,n.next=12,window.crypto.subtle.decrypt(h,o,l);case 12:b=n.sent,p=new TextDecoder,r.next(p.decode(b)),r.complete(),n.next=21;break;case 18:n.prev=18,n.t0=n.catch(9),r.error(n.t0);case 21:case"end":return n.stop()}}),i,null,[[9,18]])})))()}))}},93352:function(e,t){"use strict";function r(){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=r,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={}))},31807:function(e,t,r){"use strict";var n=r(19778).Buffer,a=r(38181).default,i=r(48485).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 c=o(r(87044)),s=r(75847),f=r(93352),u=/^[0-9]*$/,d=/^[a-f0-9]*$/;function l(e){return i(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}function h(e){return e.startsWith("0x")||e.startsWith("0X")}function b(e){return h(e)?e.slice(2):e}function p(e){return h(e)?"0x"+e.slice(2):"0x"+e}function m(e){if("string"!==typeof e)return!1;var t=b(e).toLowerCase();return d.test(t)}function x(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("string"===typeof e){var r=b(e).toLowerCase();if(d.test(r))return(0,f.HexString)(t?"0x"+r:r)}throw new Error('"'.concat(String(e),'" is not a hexadecimal string'))}function g(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=x(e,!1);return r.length%2===1&&(r=(0,f.HexString)("0"+r)),t?(0,f.HexString)("0x"+r):r}function v(e){if("number"===typeof e&&Number.isInteger(e))return(0,f.IntNumber)(e);if("string"===typeof e){if(u.test(e))return(0,f.IntNumber)(Number(e));if(m(e))return(0,f.IntNumber)(new c.default(g(e,!1),16).toNumber())}throw new Error("Not an integer: ".concat(String(e)))}function y(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 l(crypto.getRandomValues(new Uint8Array(e)))},t.uint8ArrayToHex=l,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],r=e.toString("hex");return(0,f.HexString)(t?"0x"+r:r)},t.bigIntStringFromBN=function(e){return(0,f.BigIntString)(e.toString(10))},t.intNumberFromHexString=function(e){return(0,f.IntNumber)(new c.default(g(e,!1),16).toNumber())},t.hexStringFromIntNumber=function(e){return(0,f.HexString)("0x"+new c.default(e).toString(16))},t.has0xPrefix=h,t.strip0x=b,t.prepend0x=p,t.isHexString=m,t.ensureHexString=x,t.ensureEvenLengthHexString=g,t.ensureAddressString=function(e){if("string"===typeof e){var t=b(e).toLowerCase();if(m(t)&&40===t.length)return(0,f.AddressString)(p(t))}throw new Error("Invalid Ethereum address: ".concat(String(e)))},t.ensureBuffer=function(e){if(n.isBuffer(e))return e;if("string"===typeof e){if(m(e)){var t=g(e,!1);return n.from(t,"hex")}return n.from(e,"utf8")}throw new Error("Not binary data: ".concat(String(e)))},t.ensureIntNumber=v,t.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,f.RegExpString)(e.toString());throw new Error("Not a RegExp: ".concat(String(e)))},t.ensureBN=function(e){if(null!==e&&(c.default.isBN(e)||y(e)))return new c.default(e.toString(10),10);if("number"===typeof e)return new c.default(v(e));if("string"===typeof e){if(u.test(e))return new c.default(e,10);if(m(e))return new c.default(g(e,!1),16)}throw new Error("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 new Error("Not a JSON string or an object: ".concat(String(e)))},t.isBigNumber=y,t.range=function(e,t){return Array.from({length:t-e},(function(t,r){return e+r}))},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,r=t.protocol,n=t.host,a=e?e.getAttribute("href"):null;return!a||a.startsWith("javascript:")?null:a.startsWith("http://")||a.startsWith("https://")||a.startsWith("data:")?a:a.startsWith("//")?r+a:"".concat(r,"//").concat(n).concat(a)},t.createQrUrl=function(e,t,r,n,i,o){var c,f=n?"parent-id":"id",u=(0,s.stringify)((a(c={},f,e),a(c,"secret",t),a(c,"server",r),a(c,"v",i),a(c,"chainId",o),c));return"".concat(r,"/#/link?").concat(u)},t.isInIFrame=function(){try{return null!==window.frameElement}catch(e){return!1}}},45007:function(e,t,r){var n=r(19778).Buffer,a=r(31531),i=r(87044);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 c(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 f(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function u(e){var t=typeof e;if("string"===t)return a.isHexString(e)?new i(a.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 d(e,t){var r,o,l,h;if("address"===e)return d("uint160",u(t));if("bool"===e)return d("uint8",t?1:0);if("string"===e)return d("bytes",new n(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"!==(r=f(e))&&0!==r&&t.length>r)throw new Error("Elements exceed array size: "+r);for(h in l=[],e=e.slice(0,e.lastIndexOf("[")),"string"===typeof t&&(t=JSON.parse(t)),t)l.push(d(e,t[h]));if("dynamic"===r){var b=d("uint256",t.length);l.unshift(b)}return n.concat(l)}if("bytes"===e)return t=new n(t),l=n.concat([d("uint256",t.length),t]),t.length%32!==0&&(l=n.concat([l,a.zeros(32-t.length%32)])),l;if(e.startsWith("bytes")){if((r=c(e))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return a.setLengthRight(t,32)}if(e.startsWith("uint")){if((r=c(e))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((o=u(t)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+o.bitLength());if(o<0)throw new Error("Supplied uint is negative");return o.toArrayLike(n,"be",32)}if(e.startsWith("int")){if((r=c(e))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((o=u(t)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+o.bitLength());return o.toTwos(256).toArrayLike(n,"be",32)}if(e.startsWith("ufixed")){if(r=s(e),(o=u(t))<0)throw new Error("Supplied ufixed is negative");return d("uint256",o.mul(new i(2).pow(new i(r[1]))))}if(e.startsWith("fixed"))return r=s(e),d("int256",u(t).mul(new i(2).pow(new i(r[1]))));throw new Error("Unsupported or invalid type: "+e)}function l(e){return"string"===e||"bytes"===e||"dynamic"===f(e)}function h(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,i,s=[],f=0;f<e.length;f++){var d=o(e[f]),l=t[f];if("bytes"===d)s.push(l);else if("string"===d)s.push(new n(l,"utf8"));else if("bool"===d)s.push(new n(l?"01":"00","hex"));else if("address"===d)s.push(a.setLength(l,20));else if(d.startsWith("bytes")){if((r=c(d))<1||r>32)throw new Error("Invalid bytes<N> width: "+r);s.push(a.setLengthRight(l,r))}else if(d.startsWith("uint")){if((r=c(d))%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if((i=u(l)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+i.bitLength());s.push(i.toArrayLike(n,"be",r/8))}else{if(!d.startsWith("int"))throw new Error("Unsupported or invalid type: "+d);if((r=c(d))%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if((i=u(l)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+i.bitLength());s.push(i.toTwos(r).toArrayLike(n,"be",r/8))}}return n.concat(s)}e.exports={rawEncode:function(e,t){var r=[],a=[],i=32*e.length;for(var c in e){var s=o(e[c]),f=d(s,t[c]);l(s)?(r.push(d("uint256",i)),a.push(f),i+=f.length):r.push(f)}return n.concat(r.concat(a))},solidityPack:h,soliditySHA3:function(e,t){return a.keccak(h(e,t))}}},76465:function(e,t,r){var n=r(19778).Buffer,a=r(89504).default,i=r(94534).default,o=r(31531),c=r(45007),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"]},f={encodeData:function(e,t,r){var s=this,f=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],u=["bytes32"],d=[this.hashType(e,r)];if(f){var l,h=function e(t,a,u){if(void 0!==r[a])return["bytes32",null==u?"0x0000000000000000000000000000000000000000000000000000000000000000":o.keccak(s.encodeData(a,u,r,f))];if(void 0===u)throw new Error("missing value for field ".concat(t," of type ").concat(a));if("bytes"===a)return["bytes32",o.keccak(u)];if("string"===a)return"string"===typeof u&&(u=n.from(u,"utf8")),["bytes32",o.keccak(u)];if(a.lastIndexOf("]")===a.length-1){var d=a.slice(0,a.lastIndexOf("[")),l=u.map((function(r){return e(t,d,r)}));return["bytes32",o.keccak(c.rawEncode(l.map((function(e){return i(e,1)[0]})),l.map((function(e){return i(e,2)[1]}))))]}return[a,u]},b=a(r[e]);try{for(b.s();!(l=b.n()).done;){var p=l.value,m=h(p.name,p.type,t[p.name]),x=i(m,2),g=x[0],v=x[1];u.push(g),d.push(v)}}catch(A){b.e(A)}finally{b.f()}}else{var y,w=a(r[e]);try{for(w.s();!(y=w.n()).done;){var M=y.value,k=t[M.name];if(void 0!==k)if("bytes"===M.type)u.push("bytes32"),k=o.keccak(k),d.push(k);else if("string"===M.type)u.push("bytes32"),"string"===typeof k&&(k=n.from(k,"utf8")),k=o.keccak(k),d.push(k);else if(void 0!==r[M.type])u.push("bytes32"),k=o.keccak(this.encodeData(M.type,k,r,f)),d.push(k);else{if(M.type.lastIndexOf("]")===M.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");u.push(M.type),d.push(k)}}}catch(A){w.e(A)}finally{w.f()}}return c.rawEncode(u,d)},encodeType:function(e,t){var r="",n=this.findTypeDependencies(e,t).filter((function(t){return t!==e}));n=[e].concat(n.sort());var i,o=a(n);try{for(o.s();!(i=o.n()).done;){var c=i.value;if(!t[c])throw new Error("No type definition specified: "+c);r+=c+"("+t[c].map((function(e){var t=e.name;return e.type+" "+t})).join(",")+")"}}catch(s){o.e(s)}finally{o.f()}return r},findTypeDependencies:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e=e.match(/^\w*/)[0],r.includes(e)||void 0===t[e])return r;r.push(e);var n,i=a(t[e]);try{for(i.s();!(n=i.n()).done;){var o,c=n.value,s=a(this.findTypeDependencies(c.type,t,r));try{for(s.s();!(o=s.n()).done;){var f=o.value;!r.includes(f)&&r.push(f)}}catch(u){s.e(u)}finally{s.f()}}}catch(u){i.e(u)}finally{i.f()}return r},hashStruct:function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return o.keccak(this.encodeData(e,t,r,n))},hashType:function(e,t){return o.keccak(this.encodeType(e,t))},sanitizeData:function(e){var t={};for(var r in s.properties)e[r]&&(t[r]=e[r]);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],r=this.sanitizeData(e),a=[n.from("1901","hex")];return a.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),"EIP712Domain"!==r.primaryType&&a.push(this.hashStruct(r.primaryType,r.message,r.types,t)),o.keccak(n.concat(a))}};e.exports={TYPED_MESSAGE_SCHEMA:s,TypedDataUtils:f,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 r=e.map((function(e){return"bytes"===e.type?o.toBuffer(e.value):e.value})),n=e.map((function(e){return e.type})),a=e.map((function(e){if(!e.name)throw t;return e.type+" "+e.name}));return c.soliditySHA3(["bytes32","bytes32"],[c.soliditySHA3(new Array(e.length).fill("string"),a),c.soliditySHA3(n,r)])}(e.data)},hashForSignTypedData_v3:function(e){return f.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return f.hash(e.data)}}},31531:function(e,t,r){var n=r(19778).Buffer,a=r(51321),i=r(87044);function o(e){return n.allocUnsafe(e).fill(0)}function c(e,t,r){var n=o(t);return e=s(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function s(e){if(!n.isBuffer(e))if(Array.isArray(e))e=n.from(e);else if("string"===typeof e)e=f(e)?n.from((t=u(e)).length%2?"0"+t:t,"hex"):n.from(e);else if("number"===typeof e)e=intToBuffer(e);else if(null===e||void 0===e)e=n.allocUnsafe(0);else if(i.isBN(e))e=e.toArrayLike(n);else{if(!e.toArray)throw new Error("invalid type");e=n.from(e.toArray())}var t;return e}function f(e){return"string"===typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)}function u(e){return"string"===typeof e&&e.startsWith("0x")?e.slice(2):e}e.exports={zeros:o,setLength:c,setLengthRight:function(e,t){return c(e,t,!0)},isHexString:f,stripHexPrefix:u,toBuffer:s,bufferToHex:function(e){return"0x"+(e=s(e)).toString("hex")},keccak:function(e,t){return e=s(e),t||(t=256),a("keccak"+t).update(e).digest()}}},58765:function(e){function t(e){this.mode=n.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var a=[],i=this.data.charCodeAt(t);i>65536?(a[0]=240|(1835008&i)>>>18,a[1]=128|(258048&i)>>>12,a[2]=128|(4032&i)>>>6,a[3]=128|63&i):i>2048?(a[0]=224|(61440&i)>>>12,a[1]=128|(4032&i)>>>6,a[2]=128|63&i):i>128?(a[0]=192|(1984&i)>>>6,a[1]=128|63&i):a[0]=i,this.parsedData.push(a)}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 r(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,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}},r.prototype={addData:function(e){var r=new t(e);this.dataList.push(r),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var a=0;a<this.moduleCount;a++)this.modules[n][a]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=r.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(this.modules[e+r][t+n]=0<=r&&r<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=n&&n<=4)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=m.getLostPoint(this);(0==r||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r);this.make();for(var a=0;a<this.modules.length;a++)for(var i=1*a,o=0;o<this.modules[a].length;o++){var c=1*o;this.modules[a][o]&&(n.beginFill(0,100),n.moveTo(c,i),n.lineTo(c+1,i),n.lineTo(c+1,i+1),n.lineTo(c,i+1),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=m.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],a=e[r];if(null==this.modules[n][a])for(var i=-2;i<=2;i++)for(var o=-2;o<=2;o++)this.modules[n+i][a+o]=-2==i||2==i||-2==o||2==o||0==i&&0==o}},setupTypeNumber:function(e){for(var t=m.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&1==(t>>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(r=0;r<18;r++){n=!e&&1==(t>>r&1);this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=m.getBCHTypeInfo(r),a=0;a<15;a++){var i=!e&&1==(n>>a&1);a<6?this.modules[a][8]=i:a<8?this.modules[a+1][8]=i:this.modules[this.moduleCount-15+a][8]=i}for(a=0;a<15;a++){i=!e&&1==(n>>a&1);a<8?this.modules[8][this.moduleCount-a-1]=i:a<9?this.modules[8][15-a-1+1]=i:this.modules[8][15-a-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,a=7,i=0,o=this.moduleCount-1;o>0;o-=2)for(6==o&&o--;;){for(var c=0;c<2;c++)if(null==this.modules[n][o-c]){var s=!1;i<e.length&&(s=1==(e[i]>>>a&1)),m.getMask(t,n,o-c)&&(s=!s),this.modules[n][o-c]=s,-1==--a&&(i++,a=7)}if((n+=r)<0||this.moduleCount<=n){n-=r,r=-r;break}}}},r.PAD0=236,r.PAD1=17,r.createData=function(e,t,n){for(var a=y.getRSBlocks(e,t),i=new w,o=0;o<n.length;o++){var c=n[o];i.put(c.mode,4),i.put(c.getLength(),m.getLengthInBits(c.mode,e)),c.write(i)}var s=0;for(o=0;o<a.length;o++)s+=a[o].dataCount;if(i.getLengthInBits()>8*s)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+8*s+")");for(i.getLengthInBits()+4<=8*s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*s)&&(i.put(r.PAD0,8),!(i.getLengthInBits()>=8*s));)i.put(r.PAD1,8);return r.createBytes(i,a)},r.createBytes=function(e,t){for(var r=0,n=0,a=0,i=new Array(t.length),o=new Array(t.length),c=0;c<t.length;c++){var s=t[c].dataCount,f=t[c].totalCount-s;n=Math.max(n,s),a=Math.max(a,f),i[c]=new Array(s);for(var u=0;u<i[c].length;u++)i[c][u]=255&e.buffer[u+r];r+=s;var d=m.getErrorCorrectPolynomial(f),l=new v(i[c],d.getLength()-1).mod(d);o[c]=new Array(d.getLength()-1);for(u=0;u<o[c].length;u++){var h=u+l.getLength()-o[c].length;o[c][u]=h>=0?l.get(h):0}}var b=0;for(u=0;u<t.length;u++)b+=t[u].totalCount;var p=new Array(b),x=0;for(u=0;u<n;u++)for(c=0;c<t.length;c++)u<i[c].length&&(p[x++]=i[c][u]);for(u=0;u<a;u++)for(c=0;c<t.length;c++)u<o[c].length&&(p[x++]=o[c][u]);return p};for(var n={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},a=1,i=0,o=3,c=2,s=0,f=1,u=2,d=3,l=4,h=5,b=6,p=7,m={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;m.getBCHDigit(t)-m.getBCHDigit(m.G15)>=0;)t^=m.G15<<m.getBCHDigit(t)-m.getBCHDigit(m.G15);return(e<<10|t)^m.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;m.getBCHDigit(t)-m.getBCHDigit(m.G18)>=0;)t^=m.G18<<m.getBCHDigit(t)-m.getBCHDigit(m.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return m.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case s:return(t+r)%2==0;case f:return t%2==0;case u:return r%3==0;case d:return(t+r)%3==0;case l:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case h:return t*r%2+t*r%3==0;case b:return(t*r%2+t*r%3)%2==0;case p:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new v([1],0),r=0;r<e;r++)t=t.multiply(new v([1,x.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case n.MODE_NUMBER:return 10;case n.MODE_ALPHA_NUM:return 9;case n.MODE_8BIT_BYTE:case n.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case n.MODE_NUMBER:return 12;case n.MODE_ALPHA_NUM:return 11;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case n.MODE_NUMBER:return 14;case n.MODE_ALPHA_NUM:return 13;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var a=0;a<t;a++){for(var i=0,o=e.isDark(n,a),c=-1;c<=1;c++)if(!(n+c<0||t<=n+c))for(var s=-1;s<=1;s++)a+s<0||t<=a+s||0==c&&0==s||o==e.isDark(n+c,a+s)&&i++;i>5&&(r+=3+i-5)}for(n=0;n<t-1;n++)for(a=0;a<t-1;a++){var f=0;e.isDark(n,a)&&f++,e.isDark(n+1,a)&&f++,e.isDark(n,a+1)&&f++,e.isDark(n+1,a+1)&&f++,0!=f&&4!=f||(r+=3)}for(n=0;n<t;n++)for(a=0;a<t-6;a++)e.isDark(n,a)&&!e.isDark(n,a+1)&&e.isDark(n,a+2)&&e.isDark(n,a+3)&&e.isDark(n,a+4)&&!e.isDark(n,a+5)&&e.isDark(n,a+6)&&(r+=40);for(a=0;a<t;a++)for(n=0;n<t-6;n++)e.isDark(n,a)&&!e.isDark(n+1,a)&&e.isDark(n+2,a)&&e.isDark(n+3,a)&&e.isDark(n+4,a)&&!e.isDark(n+5,a)&&e.isDark(n+6,a)&&(r+=40);var u=0;for(a=0;a<t;a++)for(n=0;n<t;n++)e.isDark(n,a)&&u++;return r+=10*(Math.abs(100*u/t/t-50)/5)}},x={glog:function(e){if(e<1)throw new Error("glog("+e+")");return x.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return x.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},g=0;g<8;g++)x.EXP_TABLE[g]=1<<g;for(g=8;g<256;g++)x.EXP_TABLE[g]=x.EXP_TABLE[g-4]^x.EXP_TABLE[g-5]^x.EXP_TABLE[g-6]^x.EXP_TABLE[g-8];for(g=0;g<255;g++)x.LOG_TABLE[x.EXP_TABLE[g]]=g;function v(e,t){if(void 0==e.length)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&0==e[r];)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}function y(e,t){this.totalCount=e,this.dataCount=t}function w(){this.buffer=[],this.length=0}v.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=x.gexp(x.glog(this.get(r))+x.glog(e.get(n)));return new v(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=x.glog(this.get(0))-x.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(n=0;n<e.getLength();n++)r[n]^=x.gexp(x.glog(e.get(n))+t);return new v(r,0).mod(e)}},y.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],y.getRSBlocks=function(e,t){var r=y.getRsBlockTable(e,t);if(void 0==r)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,a=[],i=0;i<n;i++)for(var o=r[3*i+0],c=r[3*i+1],s=r[3*i+2],f=0;f<o;f++)a.push(new y(c,s));return a},y.getRsBlockTable=function(e,t){switch(t){case a:return y.RS_BLOCK_TABLE[4*(e-1)+0];case i:return y.RS_BLOCK_TABLE[4*(e-1)+1];case o:return y.RS_BLOCK_TABLE[4*(e-1)+2];case c:return y.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},w.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var r=0;r<t;r++)this.putBit(1==(e>>>t-r-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 M=[[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 k(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 n=this.options.content,s=function(e,t){for(var r=function(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}(e),n=1,a=0,i=0,o=M.length;i<=o;i++){var c=M[i];if(!c)throw new Error("Content too long: expected "+a+" but got "+r);switch(t){case"L":a=c[0];break;case"M":a=c[1];break;case"Q":a=c[2];break;case"H":a=c[3];break;default:throw new Error("Unknwon error correction level: "+t)}if(r<=a)break;n++}if(n>M.length)throw new Error("Content too long");return n}(n,this.options.ecl),f=function(e){switch(e){case"L":return a;case"M":return i;case"Q":return o;case"H":return c;default:throw new Error("Unknwon error correction level: "+e)}}(this.options.ecl);this.qrcode=new r(s,f),this.qrcode.addData(n),this.qrcode.make()}k.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;"undefined"==typeof e&&(e={container:t.container||"svg"});for(var n="undefined"==typeof t.pretty||!!t.pretty,a=n?" ":"",i=n?"\r\n":"",o=t.width,c=t.height,s=r.length,f=o/(s+2*t.padding),u=c/(s+2*t.padding),d="undefined"!=typeof t.join&&!!t.join,l="undefined"!=typeof t.swap&&!!t.swap,h="undefined"==typeof t.xmlDeclaration||!!t.xmlDeclaration,b="undefined"!=typeof t.predefined&&!!t.predefined,p=b?a+'<defs><path id="qrmodule" d="M0 0 h'+u+" v"+f+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+i:"",m=a+'<rect x="0" y="0" width="'+o+'" height="'+c+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+i,x="",g="",v=0;v<s;v++)for(var y=0;y<s;y++){if(r[y][v]){var w=y*f+t.padding*f,M=v*u+t.padding*u;if(l){var k=w;w=M,M=k}if(d){var A=f+w,I=u+M;w=Number.isInteger(w)?Number(w):w.toFixed(2),M=Number.isInteger(M)?Number(M):M.toFixed(2),A=Number.isInteger(A)?Number(A):A.toFixed(2),g+="M"+w+","+M+" V"+(I=Number.isInteger(I)?Number(I):I.toFixed(2))+" H"+A+" V"+M+" H"+w+" Z "}else x+=b?a+'<use x="'+w.toString()+'" y="'+M.toString()+'" href="#qrmodule" />'+i:a+'<rect x="'+w.toString()+'" y="'+M.toString()+'" width="'+f+'" height="'+u+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+i}}d&&(x=a+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+g+'" />');var E="";if(void 0!==this.options.image&&this.options.image.svg){var S=o*this.options.image.width/100,_=c*this.options.image.height/100,N=c/2-_/2;E+='<svg x="'.concat(o/2-S/2,'" y="').concat(N,'" width="').concat(S,'" height="').concat(_,'" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">'),E+=this.options.image.svg+i,E+="</svg>"}var j="";switch(e.container){case"svg":h&&(j+='<?xml version="1.0" standalone="yes"?>'+i),j+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+c+'">'+i,j+=p+m+x,j+=E,j+="</svg>";break;case"svg-viewbox":h&&(j+='<?xml version="1.0" standalone="yes"?>'+i),j+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+c+'">'+i,j+=p+m+x,j+=E,j+="</svg>";break;case"g":j+='<g width="'+o+'" height="'+c+'">'+i,j+=p+m+x,j+=E,j+="</g>";break;default:j+=(p+m+x+E).replace(/^\s+/,"")}return j},e.exports=k},25365:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LIB_VERSION=void 0,t.LIB_VERSION="3.5.3"},87044:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(12769).Buffer}catch(_){}function c(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,r){var n=c(e,r);return r-1>=t&&(n|=c(e,r-1)<<4),n}function f(e,t,r,a){for(var i=0,o=0,c=Math.min(e.length,r),s=t;s<c;s++){var f=e.charCodeAt(s)-48;i*=a,o=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&o<a,"Invalid character"),i+=o}return i}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a<e.length&&(16===t?this._parseHex(e,a,r):(this._parseBase(e,t,a),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var i,o,c=0;if("be"===r)for(a=e.length-1,i=0;a>=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(a=0,i=0;a<e.length;a+=3)o=e[a]|e[a+1]<<8|e[a+2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,i=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,s=0,u=r;u<c;u+=n)s=f(e,u,u+n,t),this.imuln(a),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==o){var d=1;for(s=f(e,u,e.length,t),u=0;u<o;u++)d*=t;this.imuln(d),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){u(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(_){i.prototype.inspect=d}else i.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","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"],h=[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],b=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,i=0,o=0;o<this.length;o++){var c=this.words[o],s=(16777215&(c<<a|i)).toString(16);i=c>>>24-a&16777215,(a+=2)>=26&&(a-=26,o--),r=0!==i||o!==this.length-1?l[6-s.length]+s+r:s+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=h[e],u=b[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modrn(u).toString(e);r=(d=d.idivn(u)).isZero()?p+r:l[f-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,s=o/67108864|0;r.words[0]=c;for(var f=1;f<n;f++){for(var u=s>>>26,d=67108863&s,l=Math.min(f,t.length-1),h=Math.max(0,f-e.length+1);h<=l;h++){var b=f-h|0;u+=(o=(a=0|e.words[b])*(i=0|t.words[h])+d)/67108864|0,d=67108863&o}r.words[f]=0|d,s=0|u}return 0!==s?r.words[f]=0|s:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,a),o},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===i?(r<e.length&&(e[r++]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a<t;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<a:this.words[r]&~(1<<a),this._strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&t,a=t>>>26;for(;0!==a&&i<r.length;i++)t=(0|r.words[i])+a,this.words[i]=67108863&t,a=t>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.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 r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)i=(t=(0|r.words[o])-(0|n.words[o])+i)>>26,this.words[o]=67108863&t;for(;0!==i&&o<r.length;o++)i=(t=(0|r.words[o])+i)>>26,this.words[o]=67108863&t;if(0===i&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,a,i,o=e.words,c=t.words,s=r.words,f=0,u=0|o[0],d=8191&u,l=u>>>13,h=0|o[1],b=8191&h,p=h>>>13,m=0|o[2],x=8191&m,g=m>>>13,v=0|o[3],y=8191&v,w=v>>>13,M=0|o[4],k=8191&M,A=M>>>13,I=0|o[5],E=8191&I,S=I>>>13,_=0|o[6],N=8191&_,j=_>>>13,C=0|o[7],T=8191&C,L=C>>>13,D=0|o[8],O=8191&D,P=D>>>13,R=0|o[9],B=8191&R,z=R>>>13,U=0|c[0],Z=8191&U,F=U>>>13,Y=0|c[1],G=8191&Y,H=Y>>>13,W=0|c[2],q=8191&W,Q=W>>>13,V=0|c[3],J=8191&V,K=V>>>13,X=0|c[4],$=8191&X,ee=X>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],se=8191&ce,fe=ce>>>13,ue=0|c[8],de=8191&ue,le=ue>>>13,he=0|c[9],be=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(d,Z))|0)+((8191&(a=(a=Math.imul(d,F))+Math.imul(l,Z)|0))<<13)|0;f=((i=Math.imul(l,F))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(b,Z),a=(a=Math.imul(b,F))+Math.imul(p,Z)|0,i=Math.imul(p,F);var xe=(f+(n=n+Math.imul(d,G)|0)|0)+((8191&(a=(a=a+Math.imul(d,H)|0)+Math.imul(l,G)|0))<<13)|0;f=((i=i+Math.imul(l,H)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,Z),a=(a=Math.imul(x,F))+Math.imul(g,Z)|0,i=Math.imul(g,F),n=n+Math.imul(b,G)|0,a=(a=a+Math.imul(b,H)|0)+Math.imul(p,G)|0,i=i+Math.imul(p,H)|0;var ge=(f+(n=n+Math.imul(d,q)|0)|0)+((8191&(a=(a=a+Math.imul(d,Q)|0)+Math.imul(l,q)|0))<<13)|0;f=((i=i+Math.imul(l,Q)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(y,Z),a=(a=Math.imul(y,F))+Math.imul(w,Z)|0,i=Math.imul(w,F),n=n+Math.imul(x,G)|0,a=(a=a+Math.imul(x,H)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,H)|0,n=n+Math.imul(b,q)|0,a=(a=a+Math.imul(b,Q)|0)+Math.imul(p,q)|0,i=i+Math.imul(p,Q)|0;var ve=(f+(n=n+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,K)|0)+Math.imul(l,J)|0))<<13)|0;f=((i=i+Math.imul(l,K)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(k,Z),a=(a=Math.imul(k,F))+Math.imul(A,Z)|0,i=Math.imul(A,F),n=n+Math.imul(y,G)|0,a=(a=a+Math.imul(y,H)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,H)|0,n=n+Math.imul(x,q)|0,a=(a=a+Math.imul(x,Q)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,Q)|0,n=n+Math.imul(b,J)|0,a=(a=a+Math.imul(b,K)|0)+Math.imul(p,J)|0,i=i+Math.imul(p,K)|0;var ye=(f+(n=n+Math.imul(d,$)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,$)|0))<<13)|0;f=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(E,Z),a=(a=Math.imul(E,F))+Math.imul(S,Z)|0,i=Math.imul(S,F),n=n+Math.imul(k,G)|0,a=(a=a+Math.imul(k,H)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,H)|0,n=n+Math.imul(y,q)|0,a=(a=a+Math.imul(y,Q)|0)+Math.imul(w,q)|0,i=i+Math.imul(w,Q)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,K)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0,n=n+Math.imul(b,$)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(f+(n=n+Math.imul(d,re)|0)|0)+((8191&(a=(a=a+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;f=((i=i+Math.imul(l,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(N,Z),a=(a=Math.imul(N,F))+Math.imul(j,Z)|0,i=Math.imul(j,F),n=n+Math.imul(E,G)|0,a=(a=a+Math.imul(E,H)|0)+Math.imul(S,G)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(k,q)|0,a=(a=a+Math.imul(k,Q)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,Q)|0,n=n+Math.imul(y,J)|0,a=(a=a+Math.imul(y,K)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,K)|0,n=n+Math.imul(x,$)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(b,re)|0,a=(a=a+Math.imul(b,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var Me=(f+(n=n+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(l,ie)|0))<<13)|0;f=((i=i+Math.imul(l,oe)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(T,Z),a=(a=Math.imul(T,F))+Math.imul(L,Z)|0,i=Math.imul(L,F),n=n+Math.imul(N,G)|0,a=(a=a+Math.imul(N,H)|0)+Math.imul(j,G)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(E,q)|0,a=(a=a+Math.imul(E,Q)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,Q)|0,n=n+Math.imul(k,J)|0,a=(a=a+Math.imul(k,K)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(y,$)|0,a=(a=a+Math.imul(y,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(b,ie)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var ke=(f+(n=n+Math.imul(d,se)|0)|0)+((8191&(a=(a=a+Math.imul(d,fe)|0)+Math.imul(l,se)|0))<<13)|0;f=((i=i+Math.imul(l,fe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,Z),a=(a=Math.imul(O,F))+Math.imul(P,Z)|0,i=Math.imul(P,F),n=n+Math.imul(T,G)|0,a=(a=a+Math.imul(T,H)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,H)|0,n=n+Math.imul(N,q)|0,a=(a=a+Math.imul(N,Q)|0)+Math.imul(j,q)|0,i=i+Math.imul(j,Q)|0,n=n+Math.imul(E,J)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(k,$)|0,a=(a=a+Math.imul(k,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,a=(a=a+Math.imul(y,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,oe)|0,n=n+Math.imul(b,se)|0,a=(a=a+Math.imul(b,fe)|0)+Math.imul(p,se)|0,i=i+Math.imul(p,fe)|0;var Ae=(f+(n=n+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;f=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,Z),a=(a=Math.imul(B,F))+Math.imul(z,Z)|0,i=Math.imul(z,F),n=n+Math.imul(O,G)|0,a=(a=a+Math.imul(O,H)|0)+Math.imul(P,G)|0,i=i+Math.imul(P,H)|0,n=n+Math.imul(T,q)|0,a=(a=a+Math.imul(T,Q)|0)+Math.imul(L,q)|0,i=i+Math.imul(L,Q)|0,n=n+Math.imul(N,J)|0,a=(a=a+Math.imul(N,K)|0)+Math.imul(j,J)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(E,$)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(k,re)|0,a=(a=a+Math.imul(k,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(y,ie)|0,a=(a=a+Math.imul(y,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,se)|0,a=(a=a+Math.imul(x,fe)|0)+Math.imul(g,se)|0,i=i+Math.imul(g,fe)|0,n=n+Math.imul(b,de)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(p,de)|0,i=i+Math.imul(p,le)|0;var Ie=(f+(n=n+Math.imul(d,be)|0)|0)+((8191&(a=(a=a+Math.imul(d,pe)|0)+Math.imul(l,be)|0))<<13)|0;f=((i=i+Math.imul(l,pe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,G),a=(a=Math.imul(B,H))+Math.imul(z,G)|0,i=Math.imul(z,H),n=n+Math.imul(O,q)|0,a=(a=a+Math.imul(O,Q)|0)+Math.imul(P,q)|0,i=i+Math.imul(P,Q)|0,n=n+Math.imul(T,J)|0,a=(a=a+Math.imul(T,K)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(N,$)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(E,re)|0,a=(a=a+Math.imul(E,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(k,ie)|0,a=(a=a+Math.imul(k,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,n=n+Math.imul(y,se)|0,a=(a=a+Math.imul(y,fe)|0)+Math.imul(w,se)|0,i=i+Math.imul(w,fe)|0,n=n+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(g,de)|0,i=i+Math.imul(g,le)|0;var Ee=(f+(n=n+Math.imul(b,be)|0)|0)+((8191&(a=(a=a+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;f=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,Q))+Math.imul(z,q)|0,i=Math.imul(z,Q),n=n+Math.imul(O,J)|0,a=(a=a+Math.imul(O,K)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,K)|0,n=n+Math.imul(T,$)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(N,re)|0,a=(a=a+Math.imul(N,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,oe)|0,n=n+Math.imul(k,se)|0,a=(a=a+Math.imul(k,fe)|0)+Math.imul(A,se)|0,i=i+Math.imul(A,fe)|0,n=n+Math.imul(y,de)|0,a=(a=a+Math.imul(y,le)|0)+Math.imul(w,de)|0,i=i+Math.imul(w,le)|0;var Se=(f+(n=n+Math.imul(x,be)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(g,be)|0))<<13)|0;f=((i=i+Math.imul(g,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,J),a=(a=Math.imul(B,K))+Math.imul(z,J)|0,i=Math.imul(z,K),n=n+Math.imul(O,$)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(N,ie)|0,a=(a=a+Math.imul(N,oe)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,oe)|0,n=n+Math.imul(E,se)|0,a=(a=a+Math.imul(E,fe)|0)+Math.imul(S,se)|0,i=i+Math.imul(S,fe)|0,n=n+Math.imul(k,de)|0,a=(a=a+Math.imul(k,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var _e=(f+(n=n+Math.imul(y,be)|0)|0)+((8191&(a=(a=a+Math.imul(y,pe)|0)+Math.imul(w,be)|0))<<13)|0;f=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,$),a=(a=Math.imul(B,ee))+Math.imul(z,$)|0,i=Math.imul(z,ee),n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(N,se)|0,a=(a=a+Math.imul(N,fe)|0)+Math.imul(j,se)|0,i=i+Math.imul(j,fe)|0,n=n+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,le)|0;var Ne=(f+(n=n+Math.imul(k,be)|0)|0)+((8191&(a=(a=a+Math.imul(k,pe)|0)+Math.imul(A,be)|0))<<13)|0;f=((i=i+Math.imul(A,pe)|0)+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,re),a=(a=Math.imul(B,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(T,se)|0,a=(a=a+Math.imul(T,fe)|0)+Math.imul(L,se)|0,i=i+Math.imul(L,fe)|0,n=n+Math.imul(N,de)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,le)|0;var je=(f+(n=n+Math.imul(E,be)|0)|0)+((8191&(a=(a=a+Math.imul(E,pe)|0)+Math.imul(S,be)|0))<<13)|0;f=((i=i+Math.imul(S,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(B,ie),a=(a=Math.imul(B,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(O,se)|0,a=(a=a+Math.imul(O,fe)|0)+Math.imul(P,se)|0,i=i+Math.imul(P,fe)|0,n=n+Math.imul(T,de)|0,a=(a=a+Math.imul(T,le)|0)+Math.imul(L,de)|0,i=i+Math.imul(L,le)|0;var Ce=(f+(n=n+Math.imul(N,be)|0)|0)+((8191&(a=(a=a+Math.imul(N,pe)|0)+Math.imul(j,be)|0))<<13)|0;f=((i=i+Math.imul(j,pe)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,se),a=(a=Math.imul(B,fe))+Math.imul(z,se)|0,i=Math.imul(z,fe),n=n+Math.imul(O,de)|0,a=(a=a+Math.imul(O,le)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,le)|0;var Te=(f+(n=n+Math.imul(T,be)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(L,be)|0))<<13)|0;f=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,de),a=(a=Math.imul(B,le))+Math.imul(z,de)|0,i=Math.imul(z,le);var Le=(f+(n=n+Math.imul(O,be)|0)|0)+((8191&(a=(a=a+Math.imul(O,pe)|0)+Math.imul(P,be)|0))<<13)|0;f=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(Le>>>26)|0,Le&=67108863;var De=(f+(n=Math.imul(B,be))|0)+((8191&(a=(a=Math.imul(B,pe))+Math.imul(z,be)|0))<<13)|0;return f=((i=Math.imul(z,pe))+(a>>>13)|0)+(De>>>26)|0,De&=67108863,s[0]=me,s[1]=xe,s[2]=ge,s[3]=ve,s[4]=ye,s[5]=we,s[6]=Me,s[7]=ke,s[8]=Ae,s[9]=Ie,s[10]=Ee,s[11]=Se,s[12]=_e,s[13]=Ne,s[14]=je,s[15]=Ce,s[16]=Te,s[17]=Le,s[18]=De,0!==f&&(s[19]=f,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var o=a;a=0;for(var c=67108863&n,s=Math.min(i,t.length-1),f=Math.max(0,i-e.length+1);f<=s;f++){var u=i-f,d=(0|e.words[u])*(0|t.words[f]),l=67108863&d;c=67108863&(l=l+c|0),a+=(o=(o=o+(d/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function g(e,t,r){return x(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?x(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,a=0;a<t;a++)n|=(1&e)<<t-a-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o<i;o++)n[o]=t[e[o]],a[o]=r[e[o]]},v.prototype.transform=function(e,t,r,n,a,i){this.permute(i,e,t,r,n,a);for(var o=1;o<a;o<<=1)for(var c=o<<1,s=Math.cos(2*Math.PI/c),f=Math.sin(2*Math.PI/c),u=0;u<a;u+=c)for(var d=s,l=f,h=0;h<o;h++){var b=r[u+h],p=n[u+h],m=r[u+h+o],x=n[u+h+o],g=d*m-l*x;x=d*x+l*m,m=g,r[u+h]=b+m,n[u+h]=p+x,r[u+h+o]=b-m,n[u+h+o]=p-x,h!==c&&(g=s*d-f*l,l=s*l+f*d,d=g)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=e[n];e[n]=e[r-n-1],e[r-n-1]=a,a=t[n],t[n]=-t[r-n-1],t[r-n-1]=-a}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var a=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&a,r=a<67108864?0:a/67108864|0}return e},v.prototype.convert13b=function(e,t,r,a){for(var i=0,o=0;o<t;o++)i+=0|e[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o<a;++o)r[o]=0;n(0===i),n(0===(-8192&i))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),a=this.makeRBT(n),i=this.stub(n),o=new Array(n),c=new Array(n),s=new Array(n),f=new Array(n),u=new Array(n),d=new Array(n),l=r.words;l.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,f,n),this.transform(o,i,c,s,n,a),this.transform(f,i,u,d,n,a);for(var h=0;h<n;h++){var b=c[h]*u[h]-s[h]*d[h];s[h]=c[h]*d[h]+s[h]*u[h],c[h]=b}return this.conjugate(c,s,n),this.transform(c,s,l,i,n,a),this.conjugate(l,i,n),this.normalize13b(l,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"===typeof e),n(e<67108864);for(var r=0,a=0;a<this.length;a++){var i=(0|this.words[a])*e,o=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=o>>>26,this.words[a]=67108863&o}return 0!==r&&(this.words[a]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,a=r%26;t[r]=e.words[n]>>>a&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,a=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var c=this.words[t]&i,s=(0|this.words[t])-c<<r;this.words[t]=s|o,o=c>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t<a;t++)this.words[t]=0;this.length+=a}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var a;n("number"===typeof e&&e>=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<<i,s=r;if(a-=o,a=Math.max(0,a),s){for(var f=0;f<o;f++)s.words[f]=this.words[f];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;var u=0;for(f=this.length-1;f>=0&&(0!==u||f>=a);f--){var d=0|this.words[f];this.words[f]=u<<26-i|d>>>i,u=d&c}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<<t;return!(this.length<=r)&&!!(this.words[r]&a)},i.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<<t;this.words[this.length-1]&=a}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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},i.prototype.isubn=function(e){if(n("number"===typeof e),n(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var a,i,o=e.length+r;this._expand(o);var c=0;for(a=0;a<e.length;a++){i=(0|this.words[a+r])+c;var s=(0|e.words[a])*t;c=((i-=67108863&s)>>26)-(s/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)c=(i=(0|this.words[a+r])+c)>>26,this.words[a+r]=67108863&i;if(0===c)return this._strip();for(n(-1===c),c=0,a=0;a<this.length;a++)c=(i=-(0|this.words[a])+c)>>26,this.words[a]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var c,s=n.length-a.length;if("mod"!==t){(c=new i(null)).length=s+1,c.words=new Array(c.length);for(var f=0;f<c.length;f++)c.words[f]=0}var u=n.clone()._ishlnsubmul(a,1,s);0===u.negative&&(n=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var l=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(a,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);c&&(c.words[d]=l)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(a=c.div.neg()),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(a=c.div.neg()),{div:a,mod:c.mod}):0!==(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:c.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,c},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,a=0,i=this.length-1;i>=0;i--)a=(r*a+(0|this.words[i]))%e;return t?-a:a},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,a=this.length-1;a>=0;a--){var i=(0|this.words[a])+67108864*r;this.words[a]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),c=new i(0),s=new i(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0===(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var b=0,p=1;0===(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(c.isOdd()||s.isOdd())&&(c.iadd(u),s.isub(d)),c.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(c),o.isub(s)):(r.isub(t),c.isub(a),s.isub(o))}return{a:c,b:s,gcd:r.iushln(f)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),c=new i(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0===(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var d=0,l=1;0===(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)c.isOdd()&&c.iadd(s),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(c)):(r.isub(t),c.isub(o))}return(a=0===t.cmpn(1)?o:c).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,a=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,o=r;0!==i&&o<this.length;o++){var c=0|this.words[o];i=(c+=i)>>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:a<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){n<a?t=-1:n>a&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},a(M,w),M.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a<n;a++)t.words[a]=e.words[a];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,a=10;a<e.length;a++){var o=0|e.words[a];e.words[a-10]=(o&r)<<4|i>>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(k,w),a(A,w),a(I,w),I.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,a=67108863&n;n>>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new k;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return y[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var c=new i(1).toRed(this),s=c.redNeg(),f=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,f).cmp(s);)u.redIAdd(s);for(var d=this.pow(u,a),l=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),b=o;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();n(m<b);var x=this.pow(d,new i(1).iushln(b-m-1));l=l.redMul(x),d=x.redSqr(),h=h.redMul(d),b=m}return l},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,c=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],u=s-1;u>=0;u--){var d=f>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++c||0===n&&0===u)&&(a=this.mul(a,r[o]),c=0,o=0)):c=0}s=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},a(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},18373:function(e,t,r){"use strict";var n=r(48064).default,a=r(18231).default,i=r(89137).default,o=r(53744).default,c=r(12682).default;Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;var s=r(11053),f=function(e){i(r,e);var t=o(r);function r(e,a,i){var o;if(n(this,r),!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!a||"string"!==typeof a)throw new Error('"message" must be a nonempty string.');return(o=t.call(this,a)).code=e,void 0!==i&&(o.data=i),o}return a(r,[{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 s.default(this.serialize(),d,2)}}]),r}(c(Error));t.EthereumRpcError=f;var u=function(e){i(r,e);var t=o(r);function r(e,a,i){if(n(this,r),!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,a,i)}return a(r)}(f);function d(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=u},93620: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."}}},24399:function(e,t,r){"use strict";var n=r(94534).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;var a=r(18373),i=r(4864),o=r(93620);function c(e,t){var r=f(t),o=n(r,2),c=o[0],s=o[1];return new a.EthereumRpcError(e,c||i.getMessageFromCode(e),s)}function s(e,t){var r=f(t),o=n(r,2),c=o[0],s=o[1];return new a.EthereumProviderError(e,c||i.getMessageFromCode(e),s)}function f(e){if(e){if("string"===typeof e)return[e];if("object"===typeof e&&!Array.isArray(e)){var t=e.message,r=e.data;if(t&&"string"!==typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:function(e){return c(o.errorCodes.rpc.parse,e)},invalidRequest:function(e){return c(o.errorCodes.rpc.invalidRequest,e)},invalidParams:function(e){return c(o.errorCodes.rpc.invalidParams,e)},methodNotFound:function(e){return c(o.errorCodes.rpc.methodNotFound,e)},internal:function(e){return c(o.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 c(t,e)},invalidInput:function(e){return c(o.errorCodes.rpc.invalidInput,e)},resourceNotFound:function(e){return c(o.errorCodes.rpc.resourceNotFound,e)},resourceUnavailable:function(e){return c(o.errorCodes.rpc.resourceUnavailable,e)},transactionRejected:function(e){return c(o.errorCodes.rpc.transactionRejected,e)},methodNotSupported:function(e){return c(o.errorCodes.rpc.methodNotSupported,e)},limitExceeded:function(e){return c(o.errorCodes.rpc.limitExceeded,e)}},provider:{userRejectedRequest:function(e){return s(o.errorCodes.provider.userRejectedRequest,e)},unauthorized:function(e){return s(o.errorCodes.provider.unauthorized,e)},unsupportedMethod:function(e){return s(o.errorCodes.provider.unsupportedMethod,e)},disconnected:function(e){return s(o.errorCodes.provider.disconnected,e)},chainDisconnected:function(e){return s(o.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,r=e.message,n=e.data;if(!r||"string"!==typeof r)throw new Error('"message" must be a nonempty string');return new a.EthereumProviderError(t,r,n)}}}},56216:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;var n=r(18373);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});var a=r(4864);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return a.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return a.getMessageFromCode}});var i=r(24399);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return i.ethErrors}});var o=r(93620);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return o.errorCodes}})},4864:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var n=r(93620),a=r(18373),i=n.errorCodes.rpc.internal,o="Unspecified error message. This is a bug, please report it.",c={code:i,message:s(i)};function s(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;if(Number.isInteger(e)){var a=e.toString();if(l(n.errorValues,a))return n.errorValues[a].message;if(u(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function f(e){if(!Number.isInteger(e))return!1;var t=e.toString();return!!n.errorValues[t]||!!u(e)}function u(e){return e>=-32099&&e<=-32e3}function d(e){return e&&"object"===typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=f,t.serializeError=function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.fallbackError,o=void 0===i?c:i,u=n.shouldIncludeStack,h=void 0!==u&&u;if(!o||!Number.isInteger(o.code)||"string"!==typeof o.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof a.EthereumRpcError)return e.serialize();var b={};if(e&&"object"===typeof e&&!Array.isArray(e)&&l(e,"code")&&f(e.code)){var p=e;b.code=p.code,p.message&&"string"===typeof p.message?(b.message=p.message,l(p,"data")&&(b.data=p.data)):(b.message=s(b.code),b.data={originalError:d(e)})}else{b.code=o.code;var m=null===(t=e)||void 0===t?void 0:t.message;b.message=m&&"string"===typeof m?m:o.message,b.data={originalError:d(e)}}var x=null===(r=e)||void 0===r?void 0:r.stack;return h&&e&&x&&"string"===typeof x&&(b.stack=x),b}},45963:function(e,t,r){"use strict";r.r(t),r.d(t,{Component:function(){return v},Fragment:function(){return g},cloneElement:function(){return U},createContext:function(){return Z},createElement:function(){return p},createRef:function(){return x},h:function(){return p},hydrate:function(){return z},isValidElement:function(){return o},options:function(){return a},render:function(){return B},toChildArray:function(){return E}});var n,a,i,o,c,s,f,u={},d=[],l=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function h(e,t){for(var r in t)e[r]=t[r];return e}function b(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,r){var a,i,o,c={};for(o in t)"key"==o?a=t[o]:"ref"==o?i=t[o]:c[o]=t[o];if(arguments.length>2&&(c.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===c[o]&&(c[o]=e.defaultProps[o]);return m(e,c,a,i,null)}function m(e,t,r,n,o){var c={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++i:o};return null==o&&null!=a.vnode&&a.vnode(c),c}function x(){return{current:null}}function g(e){return e.children}function v(e,t){this.props=e,this.context=t}function y(e,t){if(null==t)return e.__?y(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?y(e):null}function w(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return w(e)}}function M(e){(!e.__d&&(e.__d=!0)&&c.push(e)&&!k.__r++||s!==a.debounceRendering)&&((s=a.debounceRendering)||setTimeout)(k)}function k(){for(var e;k.__r=c.length;)e=c.sort((function(e,t){return e.__v.__b-t.__v.__b})),c=[],e.some((function(e){var t,r,n,a,i,o;e.__d&&(i=(a=(t=e).__v).__e,(o=t.__P)&&(r=[],(n=h({},a)).__v=a.__v+1,T(o,a,n,t.__n,void 0!==o.ownerSVGElement,null!=a.__h?[i]:null,r,null==i?y(a):i,a.__h),L(r,a),a.__e!=i&&w(a)))}))}function A(e,t,r,n,a,i,o,c,s,f){var l,h,b,p,x,v,w,M=n&&n.__k||d,k=M.length;for(r.__k=[],l=0;l<t.length;l++)if(null!=(p=r.__k[l]=null==(p=t[l])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?m(null,p,null,null,p):Array.isArray(p)?m(g,{children:p},null,null,null):p.__b>0?m(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=r,p.__b=r.__b+1,null===(b=M[l])||b&&p.key==b.key&&p.type===b.type)M[l]=void 0;else for(h=0;h<k;h++){if((b=M[h])&&p.key==b.key&&p.type===b.type){M[h]=void 0;break}b=null}T(e,p,b=b||u,a,i,o,c,s,f),x=p.__e,(h=p.ref)&&b.ref!=h&&(w||(w=[]),b.ref&&w.push(b.ref,null,p),w.push(h,p.__c||x,p)),null!=x?(null==v&&(v=x),"function"==typeof p.type&&p.__k===b.__k?p.__d=s=I(p,s,e):s=S(e,p,b,M,x,s),"function"==typeof r.type&&(r.__d=s)):s&&b.__e==s&&s.parentNode!=e&&(s=y(b))}for(r.__e=v,l=k;l--;)null!=M[l]&&P(M[l],M[l]);if(w)for(l=0;l<w.length;l++)O(w[l],w[++l],w[++l])}function I(e,t,r){for(var n,a=e.__k,i=0;a&&i<a.length;i++)(n=a[i])&&(n.__=e,t="function"==typeof n.type?I(n,t,r):S(r,n,n,a,n.__e,t));return t}function E(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){E(e,t)})):t.push(e)),t}function S(e,t,r,n,a,i){var o,c,s;if(void 0!==t.__d)o=t.__d,t.__d=void 0;else if(null==r||a!=i||null==a.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(a),o=null;else{for(c=i,s=0;(c=c.nextSibling)&&s<n.length;s+=2)if(c==a)break e;e.insertBefore(a,i),o=i}return void 0!==o?o:a.nextSibling}function _(e,t,r){"-"===t[0]?e.setProperty(t,r):e[t]=null==r?"":"number"!=typeof r||l.test(t)?r:r+"px"}function N(e,t,r,n,a){var i;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||_(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||_(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n||e.addEventListener(t,i?C:j,i):e.removeEventListener(t,i?C:j,i);else if("dangerouslySetInnerHTML"!==t){if(a)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,r))}}function j(e){this.l[e.type+!1](a.event?a.event(e):e)}function C(e){this.l[e.type+!0](a.event?a.event(e):e)}function T(e,t,r,n,i,o,c,s,f){var u,d,l,b,p,m,x,y,w,M,k,I,E,S=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(f=r.__h,s=t.__e=r.__e,t.__h=null,o=[s]),(u=a.__b)&&u(t);try{e:if("function"==typeof S){y=t.props,w=(u=S.contextType)&&n[u.__c],M=u?w?w.props.value:u.__:n,r.__c?x=(d=t.__c=r.__c).__=d.__E:("prototype"in S&&S.prototype.render?t.__c=d=new S(y,M):(t.__c=d=new v(y,M),d.constructor=S,d.render=R),w&&w.sub(d),d.props=y,d.state||(d.state={}),d.context=M,d.__n=n,l=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=h({},d.__s)),h(d.__s,S.getDerivedStateFromProps(y,d.__s))),b=d.props,p=d.state;for(u=0;u<d._sb.length;u++)d.__h.push(d._sb[u]),d._sb=[];if(l)null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==S.getDerivedStateFromProps&&y!==b&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,M),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,M)||t.__v===r.__v){d.props=y,d.state=d.__s,t.__v!==r.__v&&(d.__d=!1),d.__v=t,t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&c.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,M),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(b,p,m)}))}if(d.context=M,d.props=y,d.__v=t,d.__P=e,k=a.__r,I=0,"prototype"in S&&S.prototype.render)d.state=d.__s,d.__d=!1,k&&k(t),u=d.render(d.props,d.state,d.context);else do{d.__d=!1,k&&k(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(n=h(h({},n),d.getChildContext())),l||null==d.getSnapshotBeforeUpdate||(m=d.getSnapshotBeforeUpdate(b,p)),E=null!=u&&u.type===g&&null==u.key?u.props.children:u,A(e,Array.isArray(E)?E:[E],t,r,n,i,o,c,s,f),d.base=t.__e,t.__h=null,d.__h.length&&c.push(d),x&&(d.__E=d.__=null),d.__e=!1}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=D(r.__e,t,r,n,i,o,c,f);(u=a.diffed)&&u(t)}catch(e){t.__v=null,(f||null!=o)&&(t.__e=s,t.__h=!!f,o[o.indexOf(s)]=null),a.__e(e,t,r)}}function L(e,t){a.__c&&a.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){a.__e(e,t.__v)}}))}function D(e,t,r,a,i,o,c,s){var f,d,l,h=r.props,p=t.props,m=t.type,x=0;if("svg"===m&&(i=!0),null!=o)for(;x<o.length;x++)if((f=o[x])&&"setAttribute"in f==!!m&&(m?f.localName===m:3===f.nodeType)){e=f,o[x]=null;break}if(null==e){if(null===m)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,p.is&&p),o=null,s=!1}if(null===m)h===p||s&&e.data===p||(e.data=p);else{if(o=o&&n.call(e.childNodes),d=(h=r.props||u).dangerouslySetInnerHTML,l=p.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},x=0;x<e.attributes.length;x++)h[e.attributes[x].name]=e.attributes[x].value;(l||d)&&(l&&(d&&l.__html==d.__html||l.__html===e.innerHTML)||(e.innerHTML=l&&l.__html||""))}if(function(e,t,r,n,a){var i;for(i in r)"children"===i||"key"===i||i in t||N(e,i,null,r[i],n);for(i in t)a&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||r[i]===t[i]||N(e,i,t[i],r[i],n)}(e,p,h,i,s),l)t.__k=[];else if(x=t.props.children,A(e,Array.isArray(x)?x:[x],t,r,a,i&&"foreignObject"!==m,o,c,o?o[0]:r.__k&&y(r,0),s),null!=o)for(x=o.length;x--;)null!=o[x]&&b(o[x]);s||("value"in p&&void 0!==(x=p.value)&&(x!==e.value||"progress"===m&&!x||"option"===m&&x!==h.value)&&N(e,"value",x,h.value,!1),"checked"in p&&void 0!==(x=p.checked)&&x!==e.checked&&N(e,"checked",x,h.checked,!1))}return e}function O(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){a.__e(e,r)}}function P(e,t,r){var n,i;if(a.unmount&&a.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||O(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){a.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&P(n[i],t,r||"function"!=typeof e.type);r||null==e.__e||b(e.__e),e.__=e.__e=e.__d=void 0}function R(e,t,r){return this.constructor(e,r)}function B(e,t,r){var i,o,c;a.__&&a.__(e,t),o=(i="function"==typeof r)?null:r&&r.__k||t.__k,c=[],T(t,e=(!i&&r||t).__k=p(g,null,[e]),o||u,u,void 0!==t.ownerSVGElement,!i&&r?[r]:o?null:t.firstChild?n.call(t.childNodes):null,c,!i&&r?r:o?o.__e:t.firstChild,i),L(c,e)}function z(e,t){B(e,t,z)}function U(e,t,r){var a,i,o,c=h({},e.props);for(o in t)"key"==o?a=t[o]:"ref"==o?i=t[o]:c[o]=t[o];return arguments.length>2&&(c.children=arguments.length>3?n.call(arguments,2):r),m(e.type,c,a||e.key,i||e.ref,null)}function Z(e,t){var r={__c:t="__cC"+f++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some(M)},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}n=d.slice,a={__e:function(e,t,r,n){for(var a,i,o;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&null!=i.getDerivedStateFromError&&(a.setState(i.getDerivedStateFromError(e)),o=a.__d),null!=a.componentDidCatch&&(a.componentDidCatch(e,n||{}),o=a.__d),o)return a.__E=a}catch(t){e=t}throw e}},i=0,o=function(e){return null!=e&&void 0===e.constructor},v.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},r),this.props)),e&&h(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),M(this))},v.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},v.prototype.render=g,c=[],k.__r=0,f=0},90632:function(e,t,r){"use strict";r.r(t),r.d(t,{useCallback:function(){return A},useContext:function(){return I},useDebugValue:function(){return E},useEffect:function(){return v},useErrorBoundary:function(){return S},useId:function(){return _},useImperativeHandle:function(){return M},useLayoutEffect:function(){return y},useMemo:function(){return k},useReducer:function(){return g},useRef:function(){return w},useState:function(){return x}});var n,a,i,o,c=r(45963),s=0,f=[],u=[],d=c.options.__b,l=c.options.__r,h=c.options.diffed,b=c.options.__c,p=c.options.unmount;function m(e,t){c.options.__h&&c.options.__h(a,e,s||t),s=0;var r=a.__H||(a.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:u}),r.__[e]}function x(e){return s=1,g(O,e)}function g(e,t,r){var i=m(n++,2);if(i.t=e,!i.__c&&(i.__=[r?r(t):O(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=a,!a.u)){a.u=!0;var o=a.shouldComponentUpdate;a.shouldComponentUpdate=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return e.__c}));if(n.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var a=!1;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&i.__c.props===e)&&(!o||o.call(this,e,t,r))}}return i.__N||i.__}function v(e,t){var r=m(n++,3);!c.options.__s&&D(r.__H,t)&&(r.__=e,r.i=t,a.__H.__h.push(r))}function y(e,t){var r=m(n++,4);!c.options.__s&&D(r.__H,t)&&(r.__=e,r.i=t,a.__h.push(r))}function w(e){return s=5,k((function(){return{current:e}}),[])}function M(e,t,r){s=6,y((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==r?r:r.concat(e))}function k(e,t){var r=m(n++,7);return D(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function A(e,t){return s=8,k((function(){return e}),t)}function I(e){var t=a.context[e.__c],r=m(n++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(a)),t.props.value):e.__}function E(e,t){c.options.useDebugValue&&c.options.useDebugValue(t?t(e):e)}function S(e){var t=m(n++,10),r=x();return t.__=e,a.componentDidCatch||(a.componentDidCatch=function(e,n){t.__&&t.__(e,n),r[1](e)}),[r[0],function(){r[1](void 0)}]}function _(){var e=m(n++,11);return e.__||(e.__="P"+function(e){for(var t=0,r=e.length;r>0;)t=(t<<5)-t+e.charCodeAt(--r)|0;return t}(a.__v.__m)+n),e.__}function N(){for(var e;e=f.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(T),e.__H.__h.forEach(L),e.__H.__h=[]}catch(n){e.__H.__h=[],c.options.__e(n,e.__v)}}c.options.__b=function(e){"function"!=typeof e.type||e.__m||e.type===c.Fragment?e.__m||(e.__m=e.__&&e.__.__m?e.__.__m:""):e.__m=(e.__&&e.__.__m?e.__.__m:"")+(e.__&&e.__.__k?e.__.__k.indexOf(e):0),a=null,d&&d(e)},c.options.__r=function(e){l&&l(e),n=0;var t=(a=e.__c).__H;t&&(i===a?(t.__h=[],a.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=u,e.__N=e.i=void 0}))):(t.__h.forEach(T),t.__h.forEach(L),t.__h=[])),i=a},c.options.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&o===c.options.requestAnimationFrame||((o=c.options.requestAnimationFrame)||C)(N)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==u&&(e.__=e.__V),e.i=void 0,e.__V=u}))),i=a=null},c.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(T),e.__h=e.__h.filter((function(e){return!e.__||L(e)}))}catch(a){t.some((function(e){e.__h&&(e.__h=[])})),t=[],c.options.__e(a,e.__v)}})),b&&b(e,t)},c.options.unmount=function(e){p&&p(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{T(e)}catch(e){t=e}})),r.__H=void 0,t&&c.options.__e(t,r.__v))};var j="function"==typeof requestAnimationFrame;function C(e){var t,r=function(){clearTimeout(n),j&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);j&&(t=requestAnimationFrame(r))}function T(e){var t=a,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),a=t}function L(e){var t=a;e.__c=e.__(),a=t}function D(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function O(e,t){return"function"==typeof t?t(e):t}},87865:function(e){"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:n,RFC3986:a}},75847:function(e,t,r){"use strict";var n=r(89161),a=r(77008),i=r(87865);e.exports={formats:i,parse:a,stringify:n}},77008:function(e,t,r){"use strict";var n=r(4985),a=Object.prototype.hasOwnProperty,i=Array.isArray,o={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},c=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t){return e&&"string"===typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},f=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(i),f=c?i.slice(0,c.index):i,u=[];if(f){if(!r.plainObjects&&a.call(Object.prototype,f)&&!r.allowPrototypes)return;u.push(f)}for(var d=0;r.depth>0&&null!==(c=o.exec(i))&&d<r.depth;){if(d+=1,!r.plainObjects&&a.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(c[1])}return c&&u.push("["+i.slice(c.index)+"]"),function(e,t,r,n){for(var a=n?t:s(t,r),i=e.length-1;i>=0;--i){var o,c=e[i];if("[]"===c&&r.parseArrays)o=[].concat(a);else{o=r.plainObjects?Object.create(null):{};var f="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,u=parseInt(f,10);r.parseArrays||""!==f?!isNaN(u)&&c!==f&&String(u)===f&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[])[u]=a:"__proto__"!==f&&(o[f]=a):o={0:a}}a=o}return a}(u,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return o;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?o.charset:e.charset;return{allowDots:"undefined"===typeof e.allowDots?o.allowDots:!!e.allowDots,allowPrototypes:"boolean"===typeof e.allowPrototypes?e.allowPrototypes:o.allowPrototypes,allowSparse:"boolean"===typeof e.allowSparse?e.allowSparse:o.allowSparse,arrayLimit:"number"===typeof e.arrayLimit?e.arrayLimit:o.arrayLimit,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:o.charsetSentinel,comma:"boolean"===typeof e.comma?e.comma:o.comma,decoder:"function"===typeof e.decoder?e.decoder:o.decoder,delimiter:"string"===typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:o.delimiter,depth:"number"===typeof e.depth||!1===e.depth?+e.depth:o.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"===typeof e.interpretNumericEntities?e.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"===typeof e.parameterLimit?e.parameterLimit:o.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"===typeof e.plainObjects?e.plainObjects:o.plainObjects,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:o.strictNullHandling}}(t);if(""===e||null===e||"undefined"===typeof e)return r.plainObjects?Object.create(null):{};for(var u="string"===typeof e?function(e,t){var r,f={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,l=u.split(t.delimiter,d),h=-1,b=t.charset;if(t.charsetSentinel)for(r=0;r<l.length;++r)0===l[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[r]?b="utf-8":"utf8=%26%2310003%3B"===l[r]&&(b="iso-8859-1"),h=r,r=l.length);for(r=0;r<l.length;++r)if(r!==h){var p,m,x=l[r],g=x.indexOf("]="),v=-1===g?x.indexOf("="):g+1;-1===v?(p=t.decoder(x,o.decoder,b,"key"),m=t.strictNullHandling?null:""):(p=t.decoder(x.slice(0,v),o.decoder,b,"key"),m=n.maybeMap(s(x.slice(v+1),t),(function(e){return t.decoder(e,o.decoder,b,"value")}))),m&&t.interpretNumericEntities&&"iso-8859-1"===b&&(m=c(m)),x.indexOf("[]=")>-1&&(m=i(m)?[m]:m),a.call(f,p)?f[p]=n.combine(f[p],m):f[p]=m}return f}(e,r):e,d=r.plainObjects?Object.create(null):{},l=Object.keys(u),h=0;h<l.length;++h){var b=l[h],p=f(b,u[b],r,"string"===typeof e);d=n.merge(d,p,r)}return!0===r.allowSparse?d:n.compact(d)}},89161:function(e,t,r){"use strict";var n=r(40581),a=r(4985),i=r(87865),o=Object.prototype.hasOwnProperty,c={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,f=String.prototype.split,u=Array.prototype.push,d=function(e,t){u.apply(e,s(t)?t:[t])},l=Date.prototype.toISOString,h=i.default,b={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:a.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},p={},m=function e(t,r,i,o,c,u,l,h,m,x,g,v,y,w,M,k){for(var A,I=t,E=k,S=0,_=!1;void 0!==(E=E.get(p))&&!_;){var N=E.get(t);if(S+=1,"undefined"!==typeof N){if(N===S)throw new RangeError("Cyclic object value");_=!0}"undefined"===typeof E.get(p)&&(S=0)}if("function"===typeof h?I=h(r,I):I instanceof Date?I=g(I):"comma"===i&&s(I)&&(I=a.maybeMap(I,(function(e){return e instanceof Date?g(e):e}))),null===I){if(c)return l&&!w?l(r,b.encoder,M,"key",v):r;I=""}if("string"===typeof(A=I)||"number"===typeof A||"boolean"===typeof A||"symbol"===typeof A||"bigint"===typeof A||a.isBuffer(I)){if(l){var j=w?r:l(r,b.encoder,M,"key",v);if("comma"===i&&w){for(var C=f.call(String(I),","),T="",L=0;L<C.length;++L)T+=(0===L?"":",")+y(l(C[L],b.encoder,M,"value",v));return[y(j)+(o&&s(I)&&1===C.length?"[]":"")+"="+T]}return[y(j)+"="+y(l(I,b.encoder,M,"value",v))]}return[y(r)+"="+y(String(I))]}var D,O=[];if("undefined"===typeof I)return O;if("comma"===i&&s(I))D=[{value:I.length>0?I.join(",")||null:void 0}];else if(s(h))D=h;else{var P=Object.keys(I);D=m?P.sort(m):P}for(var R=o&&s(I)&&1===I.length?r+"[]":r,B=0;B<D.length;++B){var z=D[B],U="object"===typeof z&&"undefined"!==typeof z.value?z.value:I[z];if(!u||null!==U){var Z=s(I)?"function"===typeof i?i(R,z):R:R+(x?"."+z:"["+z+"]");k.set(t,S);var F=n();F.set(p,k),d(O,e(U,Z,i,o,c,u,l,h,m,x,g,v,y,w,M,F))}}return O};e.exports=function(e,t){var r,a=e,f=function(e){if(!e)return b;if(null!==e.encoder&&"undefined"!==typeof e.encoder&&"function"!==typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||b.charset;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 r=i.default;if("undefined"!==typeof e.format){if(!o.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=i.formatters[r],a=b.filter;return("function"===typeof e.filter||s(e.filter))&&(a=e.filter),{addQueryPrefix:"boolean"===typeof e.addQueryPrefix?e.addQueryPrefix:b.addQueryPrefix,allowDots:"undefined"===typeof e.allowDots?b.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"===typeof e.charsetSentinel?e.charsetSentinel:b.charsetSentinel,delimiter:"undefined"===typeof e.delimiter?b.delimiter:e.delimiter,encode:"boolean"===typeof e.encode?e.encode:b.encode,encoder:"function"===typeof e.encoder?e.encoder:b.encoder,encodeValuesOnly:"boolean"===typeof e.encodeValuesOnly?e.encodeValuesOnly:b.encodeValuesOnly,filter:a,format:r,formatter:n,serializeDate:"function"===typeof e.serializeDate?e.serializeDate:b.serializeDate,skipNulls:"boolean"===typeof e.skipNulls?e.skipNulls:b.skipNulls,sort:"function"===typeof e.sort?e.sort:null,strictNullHandling:"boolean"===typeof e.strictNullHandling?e.strictNullHandling:b.strictNullHandling}}(t);"function"===typeof f.filter?a=(0,f.filter)("",a):s(f.filter)&&(r=f.filter);var u,l=[];if("object"!==typeof a||null===a)return"";u=t&&t.arrayFormat in c?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var h=c[u];if(t&&"commaRoundTrip"in t&&"boolean"!==typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var p="comma"===h&&t&&t.commaRoundTrip;r||(r=Object.keys(a)),f.sort&&r.sort(f.sort);for(var x=n(),g=0;g<r.length;++g){var v=r[g];f.skipNulls&&null===a[v]||d(l,m(a[v],v,h,p,f.strictNullHandling,f.skipNulls,f.encode?f.encoder:null,f.filter,f.sort,f.allowDots,f.serializeDate,f.format,f.formatter,f.encodeValuesOnly,f.charset,x))}var y=l.join(f.delimiter),w=!0===f.addQueryPrefix?"?":"";return f.charsetSentinel&&("iso-8859-1"===f.charset?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),y.length>0?w+y:""}},4985:function(e,t,r){"use strict";var n=r(87865),a=Object.prototype.hasOwnProperty,i=Array.isArray,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),c=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)"undefined"!==typeof e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:c,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var a=t[n],o=a.obj[a.prop],c=Object.keys(o),s=0;s<c.length;++s){var f=c[s],u=o[f];"object"===typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:o,prop:f}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],a=0;a<r.length;++a)"undefined"!==typeof r[a]&&n.push(r[a]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(a){return n}},encode:function(e,t,r,a,i){if(0===e.length)return e;var c=e;if("symbol"===typeof e?c=Symbol.prototype.toString.call(e):"string"!==typeof e&&(c=String(e)),"iso-8859-1"===r)return escape(c).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var s="",f=0;f<c.length;++f){var u=c.charCodeAt(f);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===n.RFC1738&&(40===u||41===u)?s+=c.charAt(f):u<128?s+=o[u]:u<2048?s+=o[192|u>>6]+o[128|63&u]:u<55296||u>=57344?s+=o[224|u>>12]+o[128|u>>6&63]+o[128|63&u]:(f+=1,u=65536+((1023&u)<<10|1023&c.charCodeAt(f)),s+=o[240|u>>18]+o[128|u>>12&63]+o[128|u>>6&63]+o[128|63&u])}return s},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(i(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!==typeof r){if(i(t))t.push(r);else{if(!t||"object"!==typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!a.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!==typeof t)return[t].concat(r);var o=t;return i(t)&&!i(r)&&(o=c(t,n)),i(t)&&i(r)?(r.forEach((function(r,i){if(a.call(t,i)){var o=t[i];o&&"object"===typeof o&&r&&"object"===typeof r?t[i]=e(o,r,n):t.push(r)}else t[i]=r})),t):Object.keys(r).reduce((function(t,i){var o=r[i];return a.call(t,i)?t[i]=e(t[i],o,n):t[i]=o,t}),o)}}},71655:function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.chains=t._getInitializedChains=void 0;var i=a(r(87295)),o=a(r(31227)),c=a(r(40439)),s=a(r(37098)),f=a(r(17687)),u=a(r(49422));function d(e){var t,r,a={1:"mainnet",3:"ropsten",4:"rinkeby",42:"kovan",5:"goerli",11155111:"sepolia"},d={mainnet:i.default,ropsten:o.default,rinkeby:c.default,kovan:s.default,goerli:f.default,sepolia:u.default};if(e)try{for(var l=n(e),h=l.next();!h.done;h=l.next()){var b=h.value,p=b.name;a[b.chainId.toString()]=p,d[p]=b}}catch(m){t={error:m}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return d.names=a,d}t._getInitializedChains=d,t.chains=d()},34203:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EIPs=void 0,t.EIPs={1153:r(96561),1559:r(77523),2315:r(83339),2537:r(26769),2565:r(17897),2718:r(62170),2929:r(88436),2930:r(96213),3198:r(25491),3529:r(20070),3540:r(52256),3541:r(21871),3554:r(47225),3607:r(3968),3651:r(29496),3670:r(74290),3675:r(98571),3855:r(64551),3860:r(94300),4345:r(74818),4399:r(68372),5133:r(4759)}},73226:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hardforks=void 0,t.hardforks=[["chainstart",r(60114)],["homestead",r(62800)],["dao",r(7197)],["tangerineWhistle",r(22302)],["spuriousDragon",r(90716)],["byzantium",r(26985)],["constantinople",r(35993)],["petersburg",r(4064)],["istanbul",r(83166)],["muirGlacier",r(42946)],["berlin",r(20015)],["london",r(61250)],["shanghai",r(5553)],["arrowGlacier",r(51971)],["grayGlacier",r(31088)],["mergeForkIdTransition",r(49347)],["merge",r(88648)]]},41941:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)},o=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.ConsensusAlgorithm=t.ConsensusType=t.Hardfork=t.Chain=t.CustomChain=void 0;var c,s,f=r(47465),u=r(33685),d=r(9864),l=r(71655),h=r(73226),b=r(34203);!function(e){e.PolygonMainnet="polygon-mainnet",e.PolygonMumbai="polygon-mumbai",e.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",e.xDaiChain="x-dai-chain",e.OptimisticKovan="optimistic-kovan",e.OptimisticEthereum="optimistic-ethereum"}(c=t.CustomChain||(t.CustomChain={})),function(e){e[e.Mainnet=1]="Mainnet",e[e.Ropsten=3]="Ropsten",e[e.Rinkeby=4]="Rinkeby",e[e.Kovan=42]="Kovan",e[e.Goerli=5]="Goerli",e[e.Sepolia=11155111]="Sepolia"}(t.Chain||(t.Chain={})),function(e){e.Chainstart="chainstart",e.Homestead="homestead",e.Dao="dao",e.TangerineWhistle="tangerineWhistle",e.SpuriousDragon="spuriousDragon",e.Byzantium="byzantium",e.Constantinople="constantinople",e.Petersburg="petersburg",e.Istanbul="istanbul",e.MuirGlacier="muirGlacier",e.Berlin="berlin",e.London="london",e.ArrowGlacier="arrowGlacier",e.GrayGlacier="grayGlacier",e.MergeForkIdTransition="mergeForkIdTransition",e.Merge="merge",e.Shanghai="shanghai"}(s=t.Hardfork||(t.Hardfork={})),function(e){e.ProofOfStake="pos",e.ProofOfWork="pow",e.ProofOfAuthority="poa"}(t.ConsensusType||(t.ConsensusType={})),function(e){e.Ethash="ethash",e.Clique="clique",e.Casper="casper"}(t.ConsensusAlgorithm||(t.ConsensusAlgorithm={}));var p=function(e){function t(t){var r,n,a,i,c=this;(c=e.call(this)||this)._supportedHardforks=[],c._eips=[],c._customChains=null!==(a=t.customChains)&&void 0!==a?a:[],c._chainParams=c.setChain(t.chain),c.DEFAULT_HARDFORK=null!==(i=c._chainParams.defaultHardfork)&&void 0!==i?i:s.Istanbul;try{for(var f=o(c._chainParams.hardforks),u=f.next();!u.done;u=f.next()){var d=u.value;d.forkHash||(d.forkHash=c._calcForkHash(d.name))}}catch(l){r={error:l}}finally{try{u&&!u.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}return c._hardfork=c.DEFAULT_HARDFORK,t.supportedHardforks&&(c._supportedHardforks=t.supportedHardforks),t.hardfork&&c.setHardfork(t.hardfork),t.eips&&c.setEIPs(t.eips),c}return a(t,e),t.custom=function(e,r){var n;void 0===r&&(r={});var a=null!==(n=r.baseChain)&&void 0!==n?n:"mainnet",o=i({},t._getChainParams(a));if(o.name="custom-chain","string"!==typeof e)return new t(i({chain:i(i({},o),e)},r));if(e===c.PolygonMainnet)return t.custom({name:c.PolygonMainnet,chainId:137,networkId:137},r);if(e===c.PolygonMumbai)return t.custom({name:c.PolygonMumbai,chainId:80001,networkId:80001},r);if(e===c.ArbitrumRinkebyTestnet)return t.custom({name:c.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},r);if(e===c.xDaiChain)return t.custom({name:c.xDaiChain,chainId:100,networkId:100},r);if(e===c.OptimisticKovan)return t.custom({name:c.OptimisticKovan,chainId:69,networkId:69},i({hardfork:s.Berlin},r));if(e===c.OptimisticEthereum)return t.custom({name:c.OptimisticEthereum,chainId:10,networkId:10},i({hardfork:s.Berlin},r));throw new Error("Custom chain ".concat(e," not supported"))},t.forCustomChain=function(e,r,n,a){var o=t._getChainParams(e);return new t({chain:i(i({},o),r),hardfork:n,supportedHardforks:a})},t.isSupportedChainId=function(e){var t=(0,l._getInitializedChains)();return Boolean(t.names[e.toString()])},t._getChainParams=function(e,t){var r=(0,l._getInitializedChains)(t);if("number"===typeof e||d.BN.isBN(e)){if(e=e.toString(),r.names[e])return r[r.names[e]];throw new Error("Chain with ID ".concat(e," not supported"))}if(r[e])return r[e];throw new Error("Chain with name ".concat(e," not supported"))},t.prototype.setChain=function(e){var r,n;if("number"===typeof e||"string"===typeof e||d.BN.isBN(e)){var a=void 0;a=this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0])?this._customChains.map((function(e){return e[0]})):this._customChains,this._chainParams=t._getChainParams(e,a)}else{if("object"!==typeof e)throw new Error("Wrong input format");if(this._customChains.length>0)throw new Error("Chain must be a string, number, or BN when initialized with customChains passed in");try{for(var i=o(["networkId","genesis","hardforks","bootstrapNodes"]),c=i.next();!c.done;c=i.next()){var s=c.value;if(void 0===e[s])throw new Error("Missing required chain parameter: ".concat(s))}}catch(f){r={error:f}}finally{try{c&&!c.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}this._chainParams=e}return this._chainParams},t.prototype.setHardfork=function(e){var t,r;if(!this._isSupportedHardfork(e))throw new Error("Hardfork ".concat(e," not set as supported in supportedHardforks"));var n=!1;try{for(var a=o(h.hardforks),i=a.next();!i.done;i=a.next()){i.value[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),n=!0)}}catch(c){t={error:c}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}if(!n)throw new Error("Hardfork with name ".concat(e," not supported"))},t.prototype.getHardforkByBlockNumber=function(e,t){var r,n;e=(0,d.toType)(e,d.TypeOutput.BN),t=(0,d.toType)(t,d.TypeOutput.BN);var a,i,c,f=s.Chainstart;try{for(var u=o(this.hardforks()),l=u.next();!l.done;l=u.next()){var h=l.value;if(null!==h.block)e.gte(new d.BN(h.block))&&(f=h.name),t&&h.td&&(t.gte(new d.BN(h.td))?a=h.name:i=c),c=h.name;else if(void 0!==t&&null!==t&&void 0!==h.td&&null!==h.td&&t.gte(new d.BN(h.td)))return h.name}}catch(m){r={error:m}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(t){var b="block number: ".concat(e," (-> ").concat(f,"), ");if(a&&!this.hardforkGteHardfork(f,a)){var p="HF determined by block number is lower than the minimum total difficulty HF";throw b+="total difficulty: ".concat(t," (-> ").concat(a,")"),new Error("".concat(p,": ").concat(b))}if(i&&!this.hardforkGteHardfork(i,f)){p="Maximum HF determined by total difficulty is lower than the block number HF";throw b+="total difficulty: ".concat(t," (-> ").concat(i,")"),new Error("".concat(p,": ").concat(b))}}return f},t.prototype.setHardforkByBlockNumber=function(e,t){var r=this.getHardforkByBlockNumber(e,t);return this.setHardfork(r),r},t.prototype._chooseHardfork=function(e,t){if(void 0===t&&(t=!0),e){if(t&&!this._isSupportedHardfork(e))throw new Error("Hardfork ".concat(e," not set as supported in supportedHardforks"))}else e=this._hardfork;return e},t.prototype._getHardfork=function(e){var t,r,n=this.hardforks();try{for(var a=o(n),i=a.next();!i.done;i=a.next()){var c=i.value;if(c.name===e)return c}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}throw new Error("Hardfork ".concat(e," not defined for chain ").concat(this.chainName()))},t.prototype._isSupportedHardfork=function(e){var t,r;if(!(this._supportedHardforks.length>0))return!0;try{for(var n=o(this._supportedHardforks),a=n.next();!a.done;a=n.next()){if(e===a.value)return!0}}catch(i){t={error:i}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},t.prototype.setEIPs=function(e){var t,r,n=this;void 0===e&&(e=[]);var a=function(t){if(!(t in b.EIPs))throw new Error("".concat(t," not supported"));var r=i.gteHardfork(b.EIPs[t].minimumHardfork);if(!r)throw new Error("".concat(t," cannot be activated on hardfork ").concat(i.hardfork(),", minimumHardfork: ").concat(r));b.EIPs[t].requiredEIPs&&b.EIPs[t].requiredEIPs.forEach((function(r){if(!e.includes(r)&&!n.isActivatedEIP(r))throw new Error("".concat(t," requires EIP ").concat(r,", but is not included in the EIP list"))}))},i=this;try{for(var c=o(e),s=c.next();!s.done;s=c.next()){a(s.value)}}catch(f){t={error:f}}finally{try{s&&!s.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}this._eips=e},t.prototype.param=function(e,t){var r,n,a=null;try{for(var i=o(this._eips),c=i.next();!c.done;c=i.next()){var s=c.value;if(null!==(a=this.paramByEIP(e,t,s)))return a}}catch(f){r={error:f}}finally{try{c&&!c.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return this.paramByHardfork(e,t,this._hardfork)},t.prototype.paramByHardfork=function(e,t,r){var n,a,i,c;r=this._chooseHardfork(r);var s=null;try{for(var f=o(h.hardforks),u=f.next();!u.done;u=f.next()){var d=u.value;if("eips"in d[1]){var l=d[1].eips;try{for(var b=(i=void 0,o(l)),p=b.next();!p.done;p=b.next()){var m=p.value,x=this.paramByEIP(e,t,m);s=null!==x?x:s}}catch(g){i={error:g}}finally{try{p&&!p.done&&(c=b.return)&&c.call(b)}finally{if(i)throw i.error}}}else{if(!d[1][e])throw new Error("Topic ".concat(e," not defined"));void 0!==d[1][e][t]&&(s=d[1][e][t].v)}if(d[0]===r)break}}catch(v){n={error:v}}finally{try{u&&!u.done&&(a=f.return)&&a.call(f)}finally{if(n)throw n.error}}return s},t.prototype.paramByEIP=function(e,t,r){if(!(r in b.EIPs))throw new Error("".concat(r," not supported"));var n=b.EIPs[r];if(!(e in n))throw new Error("Topic ".concat(e," not defined"));return void 0===n[e][t]?null:n[e][t].v},t.prototype.paramByBlock=function(e,t,r){var n=this.activeHardforks(r),a=n[n.length-1].name;return this.paramByHardfork(e,t,a)},t.prototype.isActivatedEIP=function(e){var t,r;if(this.eips().includes(e))return!0;try{for(var n=o(h.hardforks),a=n.next();!a.done;a=n.next()){var i=a.value[1];if(this.gteHardfork(i.name)&&"eips"in i&&i.eips.includes(e))return!0}}catch(c){t={error:c}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},t.prototype.hardforkIsActiveOnBlock=function(e,t,r){var n;void 0===r&&(r={}),t=(0,d.toType)(t,d.TypeOutput.BN);var a=null!==(n=r.onlySupported)&&void 0!==n&&n;e=this._chooseHardfork(e,a);var i=this.hardforkBlockBN(e);return!(!i||!t.gte(i))},t.prototype.activeOnBlock=function(e,t){return this.hardforkIsActiveOnBlock(null,e,t)},t.prototype.hardforkGteHardfork=function(e,t,r){var n,a;void 0===r&&(r={});var i,c=void 0!==r.onlyActive&&r.onlyActive;e=this._chooseHardfork(e,r.onlySupported),i=c?this.activeHardforks(null,r):this.hardforks();var s=-1,f=-1,u=0;try{for(var d=o(i),l=d.next();!l.done;l=d.next()){var h=l.value;h.name===e&&(s=u),h.name===t&&(f=u),u+=1}}catch(b){n={error:b}}finally{try{l&&!l.done&&(a=d.return)&&a.call(d)}finally{if(n)throw n.error}}return s>=f&&-1!==f},t.prototype.gteHardfork=function(e,t){return this.hardforkGteHardfork(null,e,t)},t.prototype.hardforkIsActiveOnChain=function(e,t){var r,n,a;void 0===t&&(t={});var i=null!==(a=t.onlySupported)&&void 0!==a&&a;e=this._chooseHardfork(e,i);try{for(var c=o(this.hardforks()),s=c.next();!s.done;s=c.next()){var f=s.value;if(f.name===e&&null!==f.block)return!0}}catch(u){r={error:u}}finally{try{s&&!s.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return!1},t.prototype.activeHardforks=function(e,t){var r,n;void 0===t&&(t={});var a=[],i=this.hardforks();try{for(var c=o(i),s=c.next();!s.done;s=c.next()){var f=s.value;if(null!==f.block){if(void 0!==e&&null!==e&&e<f.block)break;t.onlySupported&&!this._isSupportedHardfork(f.name)||a.push(f)}}}catch(u){r={error:u}}finally{try{s&&!s.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return a},t.prototype.activeHardfork=function(e,t){void 0===t&&(t={});var r=this.activeHardforks(e,t);if(r.length>0)return r[r.length-1].name;throw new Error("No (supported) active hardfork found")},t.prototype.hardforkBlock=function(e){var t=this.hardforkBlockBN(e);return(0,d.toType)(t,d.TypeOutput.Number)},t.prototype.hardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).block;return void 0===t||null===t?null:new d.BN(t)},t.prototype.hardforkTD=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e).td;return void 0===t||null===t?null:new d.BN(t)},t.prototype.isHardforkBlock=function(e,t){e=(0,d.toType)(e,d.TypeOutput.BN),t=this._chooseHardfork(t,!1);var r=this.hardforkBlockBN(t);return!!r&&r.eq(e)},t.prototype.nextHardforkBlock=function(e){var t=this.nextHardforkBlockBN(e);return(0,d.toType)(t,d.TypeOutput.Number)},t.prototype.nextHardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this.hardforkBlockBN(e);return null===t?null:this.hardforks().reduce((function(e,r){var n=new d.BN(r.block);return n.gt(t)&&null===e?n:e}),null)},t.prototype.isNextHardforkBlock=function(e,t){e=(0,d.toType)(e,d.TypeOutput.BN),t=this._chooseHardfork(t,!1);var r=this.nextHardforkBlockBN(t);return null!==r&&r.eq(e)},t.prototype._calcForkHash=function(e){var t,r,a=n.from(this.genesis().hash.substr(2),"hex"),i=n.alloc(0),c=0;try{for(var s=o(this.hardforks()),f=s.next();!f.done;f=s.next()){var l=f.value,h=l.block;if(0!==h&&null!==h&&h!==c){var b=n.from(h.toString(16).padStart(16,"0"),"hex");i=n.concat([i,b])}if(l.name===e)break;null!==h&&(c=h)}}catch(x){t={error:x}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}var p=n.concat([a,i]),m=(0,d.intToBuffer)((0,u.buf)(p)>>>0).toString("hex");return"0x".concat(m)},t.prototype.forkHash=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e);if(null===t.block&&void 0===t.td){throw new Error("No fork hash calculation possible for future hardfork")}return void 0!==t.forkHash?t.forkHash:this._calcForkHash(e)},t.prototype.hardforkForForkHash=function(e){var t=this.hardforks().filter((function(t){return t.forkHash===e}));return t.length>=1?t[t.length-1]:null},t.prototype.genesis=function(){return this._chainParams.genesis},t.prototype.genesisState=function(){var e,t;switch(this.chainName()){case"mainnet":return r(31617);case"ropsten":return r(53712);case"rinkeby":return r(3023);case"kovan":return r(28777);case"goerli":return r(15382);case"sepolia":return r(81847)}if(this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0]))try{for(var n=o(this._customChains),a=n.next();!a.done;a=n.next()){var i=a.value;if(i[0].name===this.chainName())return i[1]}}catch(c){e={error:c}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return{}},t.prototype.hardforks=function(){return this._chainParams.hardforks},t.prototype.bootstrapNodes=function(){return this._chainParams.bootstrapNodes},t.prototype.dnsNetworks=function(){return this._chainParams.dnsNetworks},t.prototype.hardfork=function(){return this._hardfork},t.prototype.chainId=function(){return(0,d.toType)(this.chainIdBN(),d.TypeOutput.Number)},t.prototype.chainIdBN=function(){return new d.BN(this._chainParams.chainId)},t.prototype.chainName=function(){return this._chainParams.name},t.prototype.networkId=function(){return(0,d.toType)(this.networkIdBN(),d.TypeOutput.Number)},t.prototype.networkIdBN=function(){return new d.BN(this._chainParams.networkId)},t.prototype.eips=function(){return this._eips},t.prototype.consensusType=function(){var e,t,r,n=this.hardfork();try{for(var a=o(h.hardforks),i=a.next();!i.done;i=a.next()){var c=i.value;if("consensus"in c[1]&&(r=c[1].consensus.type),c[0]===n)break}}catch(s){e={error:s}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return r||this._chainParams.consensus.type},t.prototype.consensusAlgorithm=function(){var e,t,r,n=this.hardfork();try{for(var a=o(h.hardforks),i=a.next();!i.done;i=a.next()){var c=i.value;if("consensus"in c[1]&&(r=c[1].consensus.algorithm),c[0]===n)break}}catch(s){e={error:s}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return r||this._chainParams.consensus.algorithm},t.prototype.consensusConfig=function(){var e,t,r,n=this.hardfork();try{for(var a=o(h.hardforks),i=a.next();!i.done;i=a.next()){var c=i.value;if("consensus"in c[1]&&(r=c[1].consensus[c[1].consensus.algorithm]),c[0]===n)break}}catch(f){e={error:f}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}if(r)return r;var s=this.consensusAlgorithm();return this._chainParams.consensus[s]},t.prototype.copy=function(){var e=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return e.removeAllListeners(),e},t}(f.EventEmitter);t.default=p},62004:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(62859).Buffer}catch(_){}function c(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,r){var n=c(e,r);return r-1>=t&&(n|=c(e,r-1)<<4),n}function f(e,t,r,a){for(var i=0,o=0,c=Math.min(e.length,r),s=t;s<c;s++){var f=e.charCodeAt(s)-48;i*=a,o=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&o<a,"Invalid character"),i+=o}return i}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a<e.length&&(16===t?this._parseHex(e,a,r):(this._parseBase(e,t,a),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var i,o,c=0;if("be"===r)for(a=e.length-1,i=0;a>=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(a=0,i=0;a<e.length;a+=3)o=e[a]|e[a+1]<<8|e[a+2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,i=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,s=0,u=r;u<c;u+=n)s=f(e,u,u+n,t),this.imuln(a),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==o){var d=1;for(s=f(e,u,e.length,t),u=0;u<o;u++)d*=t;this.imuln(d),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){u(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(_){i.prototype.inspect=d}else i.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","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"],h=[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],b=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,i=0,o=0;o<this.length;o++){var c=this.words[o],s=(16777215&(c<<a|i)).toString(16);i=c>>>24-a&16777215,(a+=2)>=26&&(a-=26,o--),r=0!==i||o!==this.length-1?l[6-s.length]+s+r:s+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=h[e],u=b[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modrn(u).toString(e);r=(d=d.idivn(u)).isZero()?p+r:l[f-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,s=o/67108864|0;r.words[0]=c;for(var f=1;f<n;f++){for(var u=s>>>26,d=67108863&s,l=Math.min(f,t.length-1),h=Math.max(0,f-e.length+1);h<=l;h++){var b=f-h|0;u+=(o=(a=0|e.words[b])*(i=0|t.words[h])+d)/67108864|0,d=67108863&o}r.words[f]=0|d,s=0|u}return 0!==s?r.words[f]=0|s:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,a),o},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===i?(r<e.length&&(e[r++]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a<t;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<a:this.words[r]&~(1<<a),this._strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&t,a=t>>>26;for(;0!==a&&i<r.length;i++)t=(0|r.words[i])+a,this.words[i]=67108863&t,a=t>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.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 r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)i=(t=(0|r.words[o])-(0|n.words[o])+i)>>26,this.words[o]=67108863&t;for(;0!==i&&o<r.length;o++)i=(t=(0|r.words[o])+i)>>26,this.words[o]=67108863&t;if(0===i&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,a,i,o=e.words,c=t.words,s=r.words,f=0,u=0|o[0],d=8191&u,l=u>>>13,h=0|o[1],b=8191&h,p=h>>>13,m=0|o[2],x=8191&m,g=m>>>13,v=0|o[3],y=8191&v,w=v>>>13,M=0|o[4],k=8191&M,A=M>>>13,I=0|o[5],E=8191&I,S=I>>>13,_=0|o[6],N=8191&_,j=_>>>13,C=0|o[7],T=8191&C,L=C>>>13,D=0|o[8],O=8191&D,P=D>>>13,R=0|o[9],B=8191&R,z=R>>>13,U=0|c[0],Z=8191&U,F=U>>>13,Y=0|c[1],G=8191&Y,H=Y>>>13,W=0|c[2],q=8191&W,Q=W>>>13,V=0|c[3],J=8191&V,K=V>>>13,X=0|c[4],$=8191&X,ee=X>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],se=8191&ce,fe=ce>>>13,ue=0|c[8],de=8191&ue,le=ue>>>13,he=0|c[9],be=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(d,Z))|0)+((8191&(a=(a=Math.imul(d,F))+Math.imul(l,Z)|0))<<13)|0;f=((i=Math.imul(l,F))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(b,Z),a=(a=Math.imul(b,F))+Math.imul(p,Z)|0,i=Math.imul(p,F);var xe=(f+(n=n+Math.imul(d,G)|0)|0)+((8191&(a=(a=a+Math.imul(d,H)|0)+Math.imul(l,G)|0))<<13)|0;f=((i=i+Math.imul(l,H)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,Z),a=(a=Math.imul(x,F))+Math.imul(g,Z)|0,i=Math.imul(g,F),n=n+Math.imul(b,G)|0,a=(a=a+Math.imul(b,H)|0)+Math.imul(p,G)|0,i=i+Math.imul(p,H)|0;var ge=(f+(n=n+Math.imul(d,q)|0)|0)+((8191&(a=(a=a+Math.imul(d,Q)|0)+Math.imul(l,q)|0))<<13)|0;f=((i=i+Math.imul(l,Q)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(y,Z),a=(a=Math.imul(y,F))+Math.imul(w,Z)|0,i=Math.imul(w,F),n=n+Math.imul(x,G)|0,a=(a=a+Math.imul(x,H)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,H)|0,n=n+Math.imul(b,q)|0,a=(a=a+Math.imul(b,Q)|0)+Math.imul(p,q)|0,i=i+Math.imul(p,Q)|0;var ve=(f+(n=n+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,K)|0)+Math.imul(l,J)|0))<<13)|0;f=((i=i+Math.imul(l,K)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(k,Z),a=(a=Math.imul(k,F))+Math.imul(A,Z)|0,i=Math.imul(A,F),n=n+Math.imul(y,G)|0,a=(a=a+Math.imul(y,H)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,H)|0,n=n+Math.imul(x,q)|0,a=(a=a+Math.imul(x,Q)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,Q)|0,n=n+Math.imul(b,J)|0,a=(a=a+Math.imul(b,K)|0)+Math.imul(p,J)|0,i=i+Math.imul(p,K)|0;var ye=(f+(n=n+Math.imul(d,$)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,$)|0))<<13)|0;f=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(E,Z),a=(a=Math.imul(E,F))+Math.imul(S,Z)|0,i=Math.imul(S,F),n=n+Math.imul(k,G)|0,a=(a=a+Math.imul(k,H)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,H)|0,n=n+Math.imul(y,q)|0,a=(a=a+Math.imul(y,Q)|0)+Math.imul(w,q)|0,i=i+Math.imul(w,Q)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,K)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0,n=n+Math.imul(b,$)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(f+(n=n+Math.imul(d,re)|0)|0)+((8191&(a=(a=a+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;f=((i=i+Math.imul(l,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(N,Z),a=(a=Math.imul(N,F))+Math.imul(j,Z)|0,i=Math.imul(j,F),n=n+Math.imul(E,G)|0,a=(a=a+Math.imul(E,H)|0)+Math.imul(S,G)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(k,q)|0,a=(a=a+Math.imul(k,Q)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,Q)|0,n=n+Math.imul(y,J)|0,a=(a=a+Math.imul(y,K)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,K)|0,n=n+Math.imul(x,$)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(b,re)|0,a=(a=a+Math.imul(b,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var Me=(f+(n=n+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(l,ie)|0))<<13)|0;f=((i=i+Math.imul(l,oe)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(T,Z),a=(a=Math.imul(T,F))+Math.imul(L,Z)|0,i=Math.imul(L,F),n=n+Math.imul(N,G)|0,a=(a=a+Math.imul(N,H)|0)+Math.imul(j,G)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(E,q)|0,a=(a=a+Math.imul(E,Q)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,Q)|0,n=n+Math.imul(k,J)|0,a=(a=a+Math.imul(k,K)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(y,$)|0,a=(a=a+Math.imul(y,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(b,ie)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var ke=(f+(n=n+Math.imul(d,se)|0)|0)+((8191&(a=(a=a+Math.imul(d,fe)|0)+Math.imul(l,se)|0))<<13)|0;f=((i=i+Math.imul(l,fe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,Z),a=(a=Math.imul(O,F))+Math.imul(P,Z)|0,i=Math.imul(P,F),n=n+Math.imul(T,G)|0,a=(a=a+Math.imul(T,H)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,H)|0,n=n+Math.imul(N,q)|0,a=(a=a+Math.imul(N,Q)|0)+Math.imul(j,q)|0,i=i+Math.imul(j,Q)|0,n=n+Math.imul(E,J)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(k,$)|0,a=(a=a+Math.imul(k,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,a=(a=a+Math.imul(y,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,oe)|0,n=n+Math.imul(b,se)|0,a=(a=a+Math.imul(b,fe)|0)+Math.imul(p,se)|0,i=i+Math.imul(p,fe)|0;var Ae=(f+(n=n+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;f=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,Z),a=(a=Math.imul(B,F))+Math.imul(z,Z)|0,i=Math.imul(z,F),n=n+Math.imul(O,G)|0,a=(a=a+Math.imul(O,H)|0)+Math.imul(P,G)|0,i=i+Math.imul(P,H)|0,n=n+Math.imul(T,q)|0,a=(a=a+Math.imul(T,Q)|0)+Math.imul(L,q)|0,i=i+Math.imul(L,Q)|0,n=n+Math.imul(N,J)|0,a=(a=a+Math.imul(N,K)|0)+Math.imul(j,J)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(E,$)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(k,re)|0,a=(a=a+Math.imul(k,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(y,ie)|0,a=(a=a+Math.imul(y,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,se)|0,a=(a=a+Math.imul(x,fe)|0)+Math.imul(g,se)|0,i=i+Math.imul(g,fe)|0,n=n+Math.imul(b,de)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(p,de)|0,i=i+Math.imul(p,le)|0;var Ie=(f+(n=n+Math.imul(d,be)|0)|0)+((8191&(a=(a=a+Math.imul(d,pe)|0)+Math.imul(l,be)|0))<<13)|0;f=((i=i+Math.imul(l,pe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,G),a=(a=Math.imul(B,H))+Math.imul(z,G)|0,i=Math.imul(z,H),n=n+Math.imul(O,q)|0,a=(a=a+Math.imul(O,Q)|0)+Math.imul(P,q)|0,i=i+Math.imul(P,Q)|0,n=n+Math.imul(T,J)|0,a=(a=a+Math.imul(T,K)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(N,$)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(E,re)|0,a=(a=a+Math.imul(E,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(k,ie)|0,a=(a=a+Math.imul(k,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,n=n+Math.imul(y,se)|0,a=(a=a+Math.imul(y,fe)|0)+Math.imul(w,se)|0,i=i+Math.imul(w,fe)|0,n=n+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(g,de)|0,i=i+Math.imul(g,le)|0;var Ee=(f+(n=n+Math.imul(b,be)|0)|0)+((8191&(a=(a=a+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;f=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,Q))+Math.imul(z,q)|0,i=Math.imul(z,Q),n=n+Math.imul(O,J)|0,a=(a=a+Math.imul(O,K)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,K)|0,n=n+Math.imul(T,$)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(N,re)|0,a=(a=a+Math.imul(N,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,oe)|0,n=n+Math.imul(k,se)|0,a=(a=a+Math.imul(k,fe)|0)+Math.imul(A,se)|0,i=i+Math.imul(A,fe)|0,n=n+Math.imul(y,de)|0,a=(a=a+Math.imul(y,le)|0)+Math.imul(w,de)|0,i=i+Math.imul(w,le)|0;var Se=(f+(n=n+Math.imul(x,be)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(g,be)|0))<<13)|0;f=((i=i+Math.imul(g,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,J),a=(a=Math.imul(B,K))+Math.imul(z,J)|0,i=Math.imul(z,K),n=n+Math.imul(O,$)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(N,ie)|0,a=(a=a+Math.imul(N,oe)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,oe)|0,n=n+Math.imul(E,se)|0,a=(a=a+Math.imul(E,fe)|0)+Math.imul(S,se)|0,i=i+Math.imul(S,fe)|0,n=n+Math.imul(k,de)|0,a=(a=a+Math.imul(k,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var _e=(f+(n=n+Math.imul(y,be)|0)|0)+((8191&(a=(a=a+Math.imul(y,pe)|0)+Math.imul(w,be)|0))<<13)|0;f=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,$),a=(a=Math.imul(B,ee))+Math.imul(z,$)|0,i=Math.imul(z,ee),n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(N,se)|0,a=(a=a+Math.imul(N,fe)|0)+Math.imul(j,se)|0,i=i+Math.imul(j,fe)|0,n=n+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,le)|0;var Ne=(f+(n=n+Math.imul(k,be)|0)|0)+((8191&(a=(a=a+Math.imul(k,pe)|0)+Math.imul(A,be)|0))<<13)|0;f=((i=i+Math.imul(A,pe)|0)+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,re),a=(a=Math.imul(B,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(T,se)|0,a=(a=a+Math.imul(T,fe)|0)+Math.imul(L,se)|0,i=i+Math.imul(L,fe)|0,n=n+Math.imul(N,de)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,le)|0;var je=(f+(n=n+Math.imul(E,be)|0)|0)+((8191&(a=(a=a+Math.imul(E,pe)|0)+Math.imul(S,be)|0))<<13)|0;f=((i=i+Math.imul(S,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(B,ie),a=(a=Math.imul(B,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(O,se)|0,a=(a=a+Math.imul(O,fe)|0)+Math.imul(P,se)|0,i=i+Math.imul(P,fe)|0,n=n+Math.imul(T,de)|0,a=(a=a+Math.imul(T,le)|0)+Math.imul(L,de)|0,i=i+Math.imul(L,le)|0;var Ce=(f+(n=n+Math.imul(N,be)|0)|0)+((8191&(a=(a=a+Math.imul(N,pe)|0)+Math.imul(j,be)|0))<<13)|0;f=((i=i+Math.imul(j,pe)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,se),a=(a=Math.imul(B,fe))+Math.imul(z,se)|0,i=Math.imul(z,fe),n=n+Math.imul(O,de)|0,a=(a=a+Math.imul(O,le)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,le)|0;var Te=(f+(n=n+Math.imul(T,be)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(L,be)|0))<<13)|0;f=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,de),a=(a=Math.imul(B,le))+Math.imul(z,de)|0,i=Math.imul(z,le);var Le=(f+(n=n+Math.imul(O,be)|0)|0)+((8191&(a=(a=a+Math.imul(O,pe)|0)+Math.imul(P,be)|0))<<13)|0;f=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(Le>>>26)|0,Le&=67108863;var De=(f+(n=Math.imul(B,be))|0)+((8191&(a=(a=Math.imul(B,pe))+Math.imul(z,be)|0))<<13)|0;return f=((i=Math.imul(z,pe))+(a>>>13)|0)+(De>>>26)|0,De&=67108863,s[0]=me,s[1]=xe,s[2]=ge,s[3]=ve,s[4]=ye,s[5]=we,s[6]=Me,s[7]=ke,s[8]=Ae,s[9]=Ie,s[10]=Ee,s[11]=Se,s[12]=_e,s[13]=Ne,s[14]=je,s[15]=Ce,s[16]=Te,s[17]=Le,s[18]=De,0!==f&&(s[19]=f,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var o=a;a=0;for(var c=67108863&n,s=Math.min(i,t.length-1),f=Math.max(0,i-e.length+1);f<=s;f++){var u=i-f,d=(0|e.words[u])*(0|t.words[f]),l=67108863&d;c=67108863&(l=l+c|0),a+=(o=(o=o+(d/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function g(e,t,r){return x(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?x(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,a=0;a<t;a++)n|=(1&e)<<t-a-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o<i;o++)n[o]=t[e[o]],a[o]=r[e[o]]},v.prototype.transform=function(e,t,r,n,a,i){this.permute(i,e,t,r,n,a);for(var o=1;o<a;o<<=1)for(var c=o<<1,s=Math.cos(2*Math.PI/c),f=Math.sin(2*Math.PI/c),u=0;u<a;u+=c)for(var d=s,l=f,h=0;h<o;h++){var b=r[u+h],p=n[u+h],m=r[u+h+o],x=n[u+h+o],g=d*m-l*x;x=d*x+l*m,m=g,r[u+h]=b+m,n[u+h]=p+x,r[u+h+o]=b-m,n[u+h+o]=p-x,h!==c&&(g=s*d-f*l,l=s*l+f*d,d=g)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=e[n];e[n]=e[r-n-1],e[r-n-1]=a,a=t[n],t[n]=-t[r-n-1],t[r-n-1]=-a}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var a=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&a,r=a<67108864?0:a/67108864|0}return e},v.prototype.convert13b=function(e,t,r,a){for(var i=0,o=0;o<t;o++)i+=0|e[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o<a;++o)r[o]=0;n(0===i),n(0===(-8192&i))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),a=this.makeRBT(n),i=this.stub(n),o=new Array(n),c=new Array(n),s=new Array(n),f=new Array(n),u=new Array(n),d=new Array(n),l=r.words;l.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,f,n),this.transform(o,i,c,s,n,a),this.transform(f,i,u,d,n,a);for(var h=0;h<n;h++){var b=c[h]*u[h]-s[h]*d[h];s[h]=c[h]*d[h]+s[h]*u[h],c[h]=b}return this.conjugate(c,s,n),this.transform(c,s,l,i,n,a),this.conjugate(l,i,n),this.normalize13b(l,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"===typeof e),n(e<67108864);for(var r=0,a=0;a<this.length;a++){var i=(0|this.words[a])*e,o=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=o>>>26,this.words[a]=67108863&o}return 0!==r&&(this.words[a]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,a=r%26;t[r]=e.words[n]>>>a&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,a=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var c=this.words[t]&i,s=(0|this.words[t])-c<<r;this.words[t]=s|o,o=c>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t<a;t++)this.words[t]=0;this.length+=a}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var a;n("number"===typeof e&&e>=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<<i,s=r;if(a-=o,a=Math.max(0,a),s){for(var f=0;f<o;f++)s.words[f]=this.words[f];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;var u=0;for(f=this.length-1;f>=0&&(0!==u||f>=a);f--){var d=0|this.words[f];this.words[f]=u<<26-i|d>>>i,u=d&c}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<<t;return!(this.length<=r)&&!!(this.words[r]&a)},i.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<<t;this.words[this.length-1]&=a}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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},i.prototype.isubn=function(e){if(n("number"===typeof e),n(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var a,i,o=e.length+r;this._expand(o);var c=0;for(a=0;a<e.length;a++){i=(0|this.words[a+r])+c;var s=(0|e.words[a])*t;c=((i-=67108863&s)>>26)-(s/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)c=(i=(0|this.words[a+r])+c)>>26,this.words[a+r]=67108863&i;if(0===c)return this._strip();for(n(-1===c),c=0,a=0;a<this.length;a++)c=(i=-(0|this.words[a])+c)>>26,this.words[a]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var c,s=n.length-a.length;if("mod"!==t){(c=new i(null)).length=s+1,c.words=new Array(c.length);for(var f=0;f<c.length;f++)c.words[f]=0}var u=n.clone()._ishlnsubmul(a,1,s);0===u.negative&&(n=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var l=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(a,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);c&&(c.words[d]=l)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(a=c.div.neg()),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(a=c.div.neg()),{div:a,mod:c.mod}):0!==(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:c.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,c},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,a=0,i=this.length-1;i>=0;i--)a=(r*a+(0|this.words[i]))%e;return t?-a:a},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,a=this.length-1;a>=0;a--){var i=(0|this.words[a])+67108864*r;this.words[a]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),c=new i(0),s=new i(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0===(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var b=0,p=1;0===(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(c.isOdd()||s.isOdd())&&(c.iadd(u),s.isub(d)),c.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(c),o.isub(s)):(r.isub(t),c.isub(a),s.isub(o))}return{a:c,b:s,gcd:r.iushln(f)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),c=new i(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0===(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var d=0,l=1;0===(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)c.isOdd()&&c.iadd(s),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(c)):(r.isub(t),c.isub(o))}return(a=0===t.cmpn(1)?o:c).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,a=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,o=r;0!==i&&o<this.length;o++){var c=0|this.words[o];i=(c+=i)>>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:a<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){n<a?t=-1:n>a&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},a(M,w),M.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a<n;a++)t.words[a]=e.words[a];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,a=10;a<e.length;a++){var o=0|e.words[a];e.words[a-10]=(o&r)<<4|i>>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(k,w),a(A,w),a(I,w),I.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,a=67108863&n;n>>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new k;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return y[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var c=new i(1).toRed(this),s=c.redNeg(),f=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,f).cmp(s);)u.redIAdd(s);for(var d=this.pow(u,a),l=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),b=o;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();n(m<b);var x=this.pow(d,new i(1).iushln(b-m-1));l=l.redMul(x),d=x.redSqr(),h=h.redMul(d),b=m}return l},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,c=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],u=s-1;u>=0;u--){var d=f>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++c||0===n&&0===u)&&(a=this.mul(a,r[o]),c=0,o=0)):c=0}s=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},a(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},57377:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(c){a={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var o=i(r(88093)),c=r(85115),s=r(30013),f=r(95169),u=r(92006),d=r(47786),l=r(61061),h=r(5685),b=r(97184),p=function(){function e(e,t,r,n){void 0===e&&(e=new c.BN(0)),void 0===t&&(t=new c.BN(0)),void 0===r&&(r=u.KECCAK256_RLP),void 0===n&&(n=u.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=n,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,n=t.balance,a=t.stateRoot,i=t.codeHash;return new e(r?new c.BN((0,d.toBuffer)(r)):void 0,n?new c.BN((0,d.toBuffer)(n)):void 0,a?(0,d.toBuffer)(a):void 0,i?(0,d.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=c.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var r=a(t,4),n=r[0],i=r[1],o=r[2],s=r[3];return new e(new c.BN(n),new c.BN(i),o,s)},e.prototype._validate=function(){if(this.nonce.lt(new c.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new c.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,b.bnToUnpaddedBuffer)(this.nonce),(0,b.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return c.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(u.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(u.KECCAK256_NULL)},e}();t.Account=p;t.isValidAddress=function(e){try{(0,h.assertIsString)(e)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};t.toChecksumAddress=function(e,t){(0,h.assertIsHexString)(e);var r=(0,f.stripHexPrefix)(e).toLowerCase(),n="";t&&(n=(0,b.toType)(t,b.TypeOutput.BN).toString()+"0x");for(var a=(0,l.keccakFromString)(n+r).toString("hex"),i="0x",o=0;o<r.length;o++)parseInt(a[o],16)>=8?i+=r[o].toUpperCase():i+=r[o];return i};t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.generateAddress=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var r=new c.BN(t);return r.isZero()?(0,l.rlphash)([e,null]).slice(-20):(0,l.rlphash)([e,n.from(r.toArray())]).slice(-20)};t.generateAddress2=function(e,t,r){return(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,o.default)(20===e.length),(0,o.default)(32===t.length),(0,l.keccak256)(n.concat([n.from("ff","hex"),e,t,(0,l.keccak256)(r)])).slice(-20)};t.isValidPrivate=function(e){return(0,s.privateKeyVerify)(e)};t.isValidPublic=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,s.publicKeyVerify)(n.concat([n.from([4]),e])):!!t&&(0,s.publicKeyVerify)(e)};t.pubToAddress=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=n.from((0,s.publicKeyConvert)(e,!1).slice(1))),(0,o.default)(64===e.length),(0,l.keccak)(e).slice(-20)},t.publicToAddress=t.pubToAddress;t.privateToPublic=function(e){return(0,h.assertIsBuffer)(e),n.from((0,s.publicKeyCreate)(e,!1)).slice(1)};t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.importPublic=function(e){return(0,h.assertIsBuffer)(e),64!==e.length&&(e=n.from((0,s.publicKeyConvert)(e,!1).slice(1))),e};t.zeroAddress=function(){var e=(0,d.zeros)(20);return(0,d.bufferToHex)(e)};t.isZeroAddress=function(e){try{(0,h.assertIsString)(e)}catch(r){return!1}return(0,t.zeroAddress)()===e}},66969:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var i=a(r(88093)),o=r(85115),c=r(47786),s=r(57377),f=function(){function e(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,c.zeros)(20))},e.fromString=function(t){return(0,i.default)((0,s.isValidAddress)(t),"Invalid address"),new e((0,c.toBuffer)(t))},e.fromPublicKey=function(t){return(0,i.default)(n.isBuffer(t),"Public key should be Buffer"),new e((0,s.pubToAddress)(t))},e.fromPrivateKey=function(t){return(0,i.default)(n.isBuffer(t),"Private key should be Buffer"),new e((0,s.privateToAddress)(t))},e.generate=function(t,r){return(0,i.default)(o.BN.isBN(r)),new e((0,s.generateAddress)(t.buf,r.toArrayLike(n)))},e.generate2=function(t,r,a){return(0,i.default)(n.isBuffer(r)),(0,i.default)(n.isBuffer(a)),new e((0,s.generateAddress2)(t.buf,r,a))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new o.BN(this.buf),t=new o.BN(0),r=new o.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return n.from(this.buf)},e}();t.Address=f},47786:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(c){a={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var o=r(85115),c=r(95169),s=r(5685);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(e){var r=(0,t.intToHex)(e);return n.from((0,c.padToEven)(r.slice(2)),"hex")};t.zeros=function(e){return n.allocUnsafe(e).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length<r?(e.copy(a),a):e.slice(0,r):e.length<r?(e.copy(a,r-e.length),a):e.slice(-r)};t.setLengthLeft=function(e,t){return(0,s.assertIsBuffer)(e),f(e,t,!1)};t.setLengthRight=function(e,t){return(0,s.assertIsBuffer)(e),f(e,t,!0)};var u=function(e){for(var t=e[0];e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),u(e)};t.unpadArray=function(e){return(0,s.assertIsArray)(e),u(e)};t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,c.stripHexPrefix)(e),u(e)};t.toBuffer=function(e){if(null===e||void 0===e)return n.allocUnsafe(0);if(n.isBuffer(e))return n.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return n.from(e);if("string"===typeof e){if(!(0,c.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return n.from((0,c.padToEven)((0,c.stripHexPrefix)(e)),"hex")}if("number"===typeof e)return(0,t.intToBuffer)(e);if(o.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(n)}if(e.toArray)return n.from(e.toArray());if(e.toBuffer)return n.from(e.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new o.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new o.BN(e).fromTwos(256)};t.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!==typeof e||(0,c.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(e){if((e=(0,c.stripHexPrefix)(e)).length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return n.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(e){if(n.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],a=0;a<e.length;a++)r.push((0,t.baToJSON)(e[a]));return r}};t.validateNoLeadingZeroes=function(e){var t,r;try{for(var n=a(Object.entries(e)),o=n.next();!o.done;o=n.next()){var c=i(o.value,2),s=c[0],f=c[1];if(void 0!==f&&f.length>0&&0===f[0])throw new Error("".concat(s," cannot have leading zeroes, received: ").concat(f.toString("hex")))}}catch(u){t={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},t.arrToBufArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):n.from(t)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!==t&&void 0!==t?t:[])}},92006:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var n=r(19778),a=r(85115);t.MAX_UINT64=new a.BN("ffffffffffffffff",16),t.MAX_INTEGER=new a.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new a.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex")},85115:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(62004));t.BN=c.default;var s=i(r(76445));t.rlp=s},61061:function(e,t,r){"use strict";var n=r(19778).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var a=r(7285),i=r(83569),o=r(85115),c=r(47786),s=r(5685);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,a.keccak224)(e);case 256:return(0,a.keccak256)(e);case 384:return(0,a.keccak384)(e);case 512:return(0,a.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(e,r){void 0===r&&(r=256),(0,s.assertIsString)(e);var a=n.from(e,"utf8");return(0,t.keccak)(a,r)};t.keccakFromHexString=function(e,r){return void 0===r&&(r=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,c.toBuffer)(e),r)};t.keccakFromArray=function(e,r){return void 0===r&&(r=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,c.toBuffer)(e),r)};var f=function(e){return e=(0,c.toBuffer)(e),i("sha256").update(e).digest()};t.sha256=function(e){return(0,s.assertIsBuffer)(e),f(e)};t.sha256FromString=function(e){return(0,s.assertIsString)(e),f(e)};t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),f(e)};var u=function(e,t){e=(0,c.toBuffer)(e);var r=i("rmd160").update(e).digest();return!0===t?(0,c.setLengthLeft)(r,32):r};t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),u(e,t)};t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),u(e,t)};t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),u(e,t)};t.rlphash=function(e){return(0,t.keccak)(o.rlp.encode(e))}},5685:function(e,t,r){"use strict";var n=r(19778).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var a=r(95169);t.assertIsHexString=function(e){if(!(0,a.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=function(e){if(!n.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsString=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},9864:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(92006),t),a(r(57377),t),a(r(66969),t),a(r(61061),t),a(r(69499),t),a(r(47786),t),a(r(2624),t),a(r(85115),t),a(r(97184),t);var i=r(95169);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},95169:function(e,t,r){"use strict";var n=r(19778).Buffer;function a(e){if("string"!==typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=a;function i(e){var t=e;if("string"!==typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!==typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return a(e)?e.slice(2):e},t.padToEven=i,t.getBinarySize=function(e){if("string"!==typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return n.byteLength(e,"utf8")},t.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){var a=parseInt(e.substr(r,2),16);t+=String.fromCharCode(a)}return t},t.fromUtf8=function(e){var t=n.from(e,"utf8");return"0x".concat(i(t.toString("hex")).replace(/^0+|0+$/g,""))},t.fromAscii=function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r).toString(16);t+=n.length<2?"0".concat(n):n}return"0x".concat(t)},t.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat(typeof e));if("string"!==typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat(typeof e));for(var n=[],a=0;a<e.length;a++){var i=e[a][t];if(r&&!i)i="";else if("string"!==typeof i)throw new Error("invalid abi - expected type 'string', received ".concat(typeof i));n.push(i)}return n},t.isHexString=function(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}},2624:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=void 0;var i=a(r(88093)),o=r(95169),c=r(85115),s=r(47786);t.defineProperties=function(e,t,r){if(e.raw=[],e._fields=[],e.toJSON=function(t){if(void 0===t&&(t=!1),t){var r={};return e._fields.forEach((function(t){r[t]="0x".concat(e[t].toString("hex"))})),r}return(0,s.baToJSON)(e.raw)},e.serialize=function(){return c.rlp.encode(e.raw)},t.forEach((function(t,r){function a(){return e.raw[r]}function o(a){"00"!==(a=(0,s.toBuffer)(a)).toString("hex")||t.allowZero||(a=n.allocUnsafe(0)),t.allowLess&&t.length?(a=(0,s.unpadBuffer)(a),(0,i.default)(t.length>=a.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===a.length||!t.length||(0,i.default)(t.length===a.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[r]=a}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:a,set:o}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:o,get:a})})),r)if("string"===typeof r&&(r=n.from((0,o.stripHexPrefix)(r),"hex")),n.isBuffer(r)&&(r=c.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,s.toBuffer)(t)}))}else{if("object"!==typeof r)throw new Error("invalid data");var a=Object.keys(r);t.forEach((function(t){-1!==a.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==a.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}}},69499:function(e,t,r){"use strict";var n=r(19778).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var a=r(30013),i=r(85115),o=r(47786),c=r(61061),s=r(5685),f=r(97184);function u(e,t){var r=(0,f.toType)(e,f.TypeOutput.BN);if(r.eqn(0)||r.eqn(1))return(0,f.toType)(e,f.TypeOutput.BN);if(!t)return r.subn(27);var n=(0,f.toType)(t,f.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function d(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=function(e,t,r){var i=(0,a.ecdsaSign)(e,t),o=i.signature,c=i.recid,s=n.from(o.slice(0,32)),u=n.from(o.slice(32,64));if(!r||"number"===typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:s,s:u,v:r?c+(2*r+35):c+27}}return{r:s,s:u,v:(0,f.toType)(r,f.TypeOutput.BN).muln(2).addn(35).addn(c).toArrayLike(n)}};t.ecrecover=function(e,t,r,i,c){var s=n.concat([(0,o.setLengthLeft)(r,32),(0,o.setLengthLeft)(i,32)],64),f=u(t,c);if(!d(f))throw new Error("Invalid signature v value");var l=(0,a.ecdsaRecover)(s,f.toNumber(),e);return n.from((0,a.publicKeyConvert)(l,!1).slice(1))};t.toRpcSig=function(e,t,r,a){if(!d(u(e,a)))throw new Error("Invalid signature v value");return(0,o.bufferToHex)(n.concat([(0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(r,32),(0,o.toBuffer)(e)]))};t.toCompactSig=function(e,t,r,a){if(!d(u(e,a)))throw new Error("Invalid signature v value");var i=(0,f.toType)(e,f.TypeOutput.Number),c=r;return(i>28&&i%2===1||1===i||28===i)&&((c=n.from(r))[0]|=128),(0,o.bufferToHex)(n.concat([(0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(c,32)]))};t.fromRpcSig=function(e){var t,r,n,a=(0,o.toBuffer)(e);if(a.length>=65)t=a.slice(0,32),r=a.slice(32,64),n=(0,o.bufferToInt)(a.slice(64));else{if(64!==a.length)throw new Error("Invalid signature length");t=a.slice(0,32),r=a.slice(32,64),n=(0,o.bufferToInt)(a.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:t,s:r}};t.isValidSignature=function(e,t,r,n,a){void 0===n&&(n=!0);var o=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),c=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!d(u(e,a)))return!1;var s=new i.BN(t),f=new i.BN(r);return!(s.isZero()||s.gt(c)||f.isZero()||f.gt(c))&&(!n||1!==f.cmp(o))};t.hashPersonalMessage=function(e){(0,s.assertIsBuffer)(e);var t=n.from("\x19Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,c.keccak)(n.concat([t,e]))}},97184:function(e,t,r){"use strict";var n=r(19778).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var a,i=r(85115),o=r(95169),c=r(47786);function s(e){return(0,c.unpadBuffer)(e.toArrayLike(n))}t.bnToHex=function(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=s,t.bnToRlp=function(e){return s(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(a=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0!==e){if("string"===typeof e&&!(0,o.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"===typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var r=(0,c.toBuffer)(e);if(t===a.Buffer)return r;if(t===a.BN)return new i.BN(r);if(t===a.Number){var n=new i.BN(r),s=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(n.gt(s))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return n.toNumber()}return"0x".concat(r.toString("hex"))}}},3060:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},c=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(c){a={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTransaction=void 0;var s=i(r(41941)),f=r(66854),u=r(54527),d=function(){function e(e,t){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=s.Chain.Mainnet,this.DEFAULT_HARDFORK=s.Hardfork.Istanbul;var r=e.nonce,n=e.gasLimit,a=e.to,i=e.value,o=e.data,c=e.v,u=e.r,d=e.s,l=e.type;this._type=new f.BN((0,f.toBuffer)(l)).toNumber(),this.txOptions=t;var h=(0,f.toBuffer)(""===a?"0x":a),b=(0,f.toBuffer)(""===c?"0x":c),p=(0,f.toBuffer)(""===u?"0x":u),m=(0,f.toBuffer)(""===d?"0x":d);this.nonce=new f.BN((0,f.toBuffer)(""===r?"0x":r)),this.gasLimit=new f.BN((0,f.toBuffer)(""===n?"0x":n)),this.to=h.length>0?new f.Address(h):void 0,this.value=new f.BN((0,f.toBuffer)(""===i?"0x":i)),this.data=(0,f.toBuffer)(""===o?"0x":o),this.v=b.length>0?new f.BN(b):void 0,this.r=p.length>0?new f.BN(p):void 0,this.s=m.length>0?new f.BN(m):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0)}return Object.defineProperty(e.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),e.prototype.supports=function(e){return this.activeCapabilities.includes(e)},e.prototype.validate=function(e){void 0===e&&(e=!1);var t=[];return this.getBaseFee().gt(this.gasLimit)&&t.push("gasLimit is too low. given ".concat(this.gasLimit,", need at least ").concat(this.getBaseFee())),this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),e?t:0===t.length},e.prototype.getBaseFee=function(){var e=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&e.iaddn(this.common.param("gasPrices","txCreation")),e},e.prototype.getDataFee=function(){for(var e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero"),r=0,n=0;n<this.data.length;n++)0===this.data[n]?r+=e:r+=t;if(r=new f.BN(r),(void 0===this.to||null===this.to)&&this.common.isActivatedEIP(3860)){var a=Math.ceil(this.data.length/32),i=new f.BN(this.common.param("gasPrices","initCodeWordCost")).imuln(a);r.iadd(i)}return r},e.prototype.toCreationAddress=function(){return void 0===this.to||0===this.to.buf.length},e.prototype.isSigned=function(){var e=this,t=e.v,r=e.r,n=e.s;return 0===this.type?!!(t&&r&&n):!(void 0===t||!r||!n)},e.prototype.verifySignature=function(){try{var e=this.getSenderPublicKey();return 0!==(0,f.unpadBuffer)(e).length}catch(t){return!1}},e.prototype.getSenderAddress=function(){return new f.Address((0,f.publicToAddress)(this.getSenderPublicKey()))},e.prototype.sign=function(e){if(32!==e.length){var t=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(t)}var r=!1;0===this.type&&this.common.gteHardfork("spuriousDragon")&&!this.supports(u.Capability.EIP155ReplayProtection)&&(this.activeCapabilities.push(u.Capability.EIP155ReplayProtection),r=!0);var n=this.getMessageToSign(!0),a=(0,f.ecsign)(n,e),i=a.v,o=a.r,c=a.s,s=this._processSignature(i,o,c);if(r){var d=this.activeCapabilities.indexOf(u.Capability.EIP155ReplayProtection);d>-1&&this.activeCapabilities.splice(d,1)}return s},e.prototype._getCommon=function(e,t){var r;if(t){var n=new f.BN((0,f.toBuffer)(t));if(e){if(!e.chainIdBN().eq(n)){var a=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(a)}return e.copy()}return s.default.isSupportedChainId(n)?new s.default({chain:n,hardfork:this.DEFAULT_HARDFORK}):s.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:n,chainId:n},this.DEFAULT_HARDFORK)}return null!==(r=null===e||void 0===e?void 0:e.copy())&&void 0!==r?r:new s.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},e.prototype._validateCannotExceedMaxInteger=function(e,t,r){var n,a;void 0===t&&(t=256),void 0===r&&(r=!1);try{for(var i=o(Object.entries(e)),s=i.next();!s.done;s=i.next()){var u=c(s.value,2),d=u[0],l=u[1];switch(t){case 64:if(r){if(null===l||void 0===l?void 0:l.gte(f.MAX_UINT64)){var h=this._errorMsg("".concat(d," cannot equal or exceed MAX_UINT64 (2^64-1), given ").concat(l));throw new Error(h)}}else if(null===l||void 0===l?void 0:l.gt(f.MAX_UINT64)){h=this._errorMsg("".concat(d," cannot exceed MAX_UINT64 (2^64-1), given ").concat(l));throw new Error(h)}break;case 256:if(r){if(null===l||void 0===l?void 0:l.gte(f.MAX_INTEGER)){h=this._errorMsg("".concat(d," cannot equal or exceed MAX_INTEGER (2^256-1), given ").concat(l));throw new Error(h)}}else if(null===l||void 0===l?void 0:l.gt(f.MAX_INTEGER)){h=this._errorMsg("".concat(d," cannot exceed MAX_INTEGER (2^256-1), given ").concat(l));throw new Error(h)}break;default:h=this._errorMsg("unimplemented bits value");throw new Error(h)}}}catch(b){n={error:b}}finally{try{s&&!s.done&&(a=i.return)&&a.call(i)}finally{if(n)throw n.error}}},e.prototype._getSharedErrorPostfix=function(){var e="";try{e=this.isSigned()?(0,f.bufferToHex)(this.hash()):"not available (unsigned)"}catch(a){e="error"}var t="";try{t=this.isSigned().toString()}catch(a){e="error"}var r="";try{r=this.common.hardfork()}catch(a){r="error"}var n="tx type=".concat(this.type," hash=").concat(e," nonce=").concat(this.nonce," value=").concat(this.value," ");return n+="signed=".concat(t," hf=").concat(r)},e}();t.BaseTransaction=d},32354:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)},o=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(c){a={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var c=r(66854),s=r(3060),f=r(54527),u=r(29988),d=n.from(2..toString(16).padStart(2,"0"),"hex"),l=function(e){function t(t,r){void 0===r&&(r={});var n,a,o=this;(o=e.call(this,i(i({},t),{type:2}),r)||this).DEFAULT_HARDFORK="london";var s=t.chainId,d=t.accessList,l=t.maxFeePerGas,h=t.maxPriorityFeePerGas;if(o.common=o._getCommon(r.common,s),o.chainId=o.common.chainIdBN(),!o.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");o.activeCapabilities=o.activeCapabilities.concat([1559,2718,2930]);var b=u.AccessLists.getAccessListData(null!==d&&void 0!==d?d:[]);if(o.accessList=b.accessList,o.AccessListJSON=b.AccessListJSON,u.AccessLists.verifyAccessList(o.accessList),o.maxFeePerGas=new c.BN((0,c.toBuffer)(""===l?"0x":l)),o.maxPriorityFeePerGas=new c.BN((0,c.toBuffer)(""===h?"0x":h)),o._validateCannotExceedMaxInteger({maxFeePerGas:o.maxFeePerGas,maxPriorityFeePerGas:o.maxPriorityFeePerGas}),o.gasLimit.mul(o.maxFeePerGas).gt(c.MAX_INTEGER)){var p=o._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(p)}if(o.maxFeePerGas.lt(o.maxPriorityFeePerGas)){p=o._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(p)}if(o.v&&!o.v.eqn(0)&&!o.v.eqn(1)){p=o._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(p)}if(o.common.gteHardfork("homestead")&&(null===(n=o.s)||void 0===n?void 0:n.gt(f.N_DIV_2))){p=o._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(p)}return o.common.isActivatedEIP(3860)&&(0,u.checkMaxInitCodeSize)(o.common,o.data.length),(null===(a=null===r||void 0===r?void 0:r.freeze)||void 0===a||a)&&Object.freeze(o),o}return a(t,e),Object.defineProperty(t.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,r){if(void 0===r&&(r={}),!e.slice(0,1).equals(d))throw new Error("Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ".concat(2,", received: ").concat(e.slice(0,1).toString("hex")));var n=c.rlp.decode(e.slice(1));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(n,r)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),9!==e.length&&12!==e.length)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");var n=o(e,12),a=n[0],i=n[1],s=n[2],f=n[3],u=n[4],d=n[5],l=n[6],h=n[7],b=n[8],p=n[9],m=n[10],x=n[11];return(0,c.validateNoLeadingZeroes)({nonce:i,maxPriorityFeePerGas:s,maxFeePerGas:f,gasLimit:u,value:l,v:p,r:m,s:x}),new t({chainId:new c.BN(a),nonce:i,maxPriorityFeePerGas:s,maxFeePerGas:f,gasLimit:u,to:d,value:l,data:h,accessList:null!==b&&void 0!==b?b:[],v:void 0!==p?new c.BN(p):void 0,r:m,s:x},r)},t.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var t=e.prototype.getDataFee.call(this);return t.iaddn(u.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t},t.prototype.getUpfrontCost=function(e){void 0===e&&(e=new c.BN(0));var t=c.BN.min(this.maxPriorityFeePerGas,this.maxFeePerGas.sub(e)).add(e);return this.gasLimit.mul(t).add(this.value)},t.prototype.raw=function(){return[(0,c.bnToUnpaddedBuffer)(this.chainId),(0,c.bnToUnpaddedBuffer)(this.nonce),(0,c.bnToUnpaddedBuffer)(this.maxPriorityFeePerGas),(0,c.bnToUnpaddedBuffer)(this.maxFeePerGas),(0,c.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,c.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,c.bnToUnpaddedBuffer)(this.v):n.from([]),void 0!==this.r?(0,c.bnToUnpaddedBuffer)(this.r):n.from([]),void 0!==this.s?(0,c.bnToUnpaddedBuffer)(this.s):n.from([])]},t.prototype.serialize=function(){var e=this.raw();return n.concat([d,c.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,9),r=n.concat([d,c.rlp.encode(t)]);return e?(0,c.keccak256)(r):r},t.prototype.hash=function(){if(!this.isSigned()){var e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,c.keccak256)(this.serialize())),this.cache.hash):(0,c.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned()){var t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}var r=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(f.N_DIV_2))){t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(t)}var n=this,a=n.v,i=n.r,o=n.s;try{return(0,c.ecrecover)(r,a.addn(27),(0,c.bnToUnpaddedBuffer)(i),(0,c.bnToUnpaddedBuffer)(o))}catch(s){t=this._errorMsg("Invalid Signature");throw new Error(t)}},t.prototype._processSignature=function(e,r,n){var a=i(i({},this.txOptions),{common:this.common});return t.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new c.BN(e-27),r:new c.BN(r),s:new c.BN(n)},a)},t.prototype.toJSON=function(){var e=u.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,c.bnToHex)(this.chainId),nonce:(0,c.bnToHex)(this.nonce),maxPriorityFeePerGas:(0,c.bnToHex)(this.maxPriorityFeePerGas),maxFeePerGas:(0,c.bnToHex)(this.maxFeePerGas),gasLimit:(0,c.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,c.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,c.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,c.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,c.bnToHex)(this.s):void 0}},t.prototype.errorStr=function(){var e=this._getSharedErrorPostfix();return e+=" maxFeePerGas=".concat(this.maxFeePerGas," maxPriorityFeePerGas=").concat(this.maxPriorityFeePerGas)},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(s.BaseTransaction);t.default=l},52247:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)},o=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(c){a={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var c=r(66854),s=r(3060),f=r(54527),u=r(29988),d=n.from(1..toString(16).padStart(2,"0"),"hex"),l=function(e){function t(t,r){void 0===r&&(r={});var n,a,o=this;(o=e.call(this,i(i({},t),{type:1}),r)||this).DEFAULT_HARDFORK="berlin";var s=t.chainId,d=t.accessList,l=t.gasPrice;if(o.common=o._getCommon(r.common,s),o.chainId=o.common.chainIdBN(),!o.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");o.activeCapabilities=o.activeCapabilities.concat([2718,2930]);var h=u.AccessLists.getAccessListData(null!==d&&void 0!==d?d:[]);if(o.accessList=h.accessList,o.AccessListJSON=h.AccessListJSON,u.AccessLists.verifyAccessList(o.accessList),o.gasPrice=new c.BN((0,c.toBuffer)(""===l?"0x":l)),o._validateCannotExceedMaxInteger({gasPrice:o.gasPrice}),o.gasPrice.mul(o.gasLimit).gt(c.MAX_INTEGER)){var b=o._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(b)}if(o.v&&!o.v.eqn(0)&&!o.v.eqn(1)){b=o._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(b)}if(o.common.gteHardfork("homestead")&&(null===(n=o.s)||void 0===n?void 0:n.gt(f.N_DIV_2))){b=o._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(b)}return o.common.isActivatedEIP(3860)&&(0,u.checkMaxInitCodeSize)(o.common,o.data.length),(null===(a=null===r||void 0===r?void 0:r.freeze)||void 0===a||a)&&Object.freeze(o),o}return a(t,e),Object.defineProperty(t.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,r){if(void 0===r&&(r={}),!e.slice(0,1).equals(d))throw new Error("Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ".concat(1,", received: ").concat(e.slice(0,1).toString("hex")));var n=c.rlp.decode(e.slice(1));if(!Array.isArray(n))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(n,r)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),8!==e.length&&11!==e.length)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");var n=o(e,11),a=n[0],i=n[1],s=n[2],f=n[3],u=n[4],d=n[5],l=n[6],h=n[7],b=n[8],p=n[9],m=n[10];(0,c.validateNoLeadingZeroes)({nonce:i,gasPrice:s,gasLimit:f,value:d,v:b,r:p,s:m});return new t({chainId:new c.BN(a),nonce:i,gasPrice:s,gasLimit:f,to:u,value:d,data:l,accessList:null!==h&&void 0!==h?h:[],v:void 0!==b?new c.BN(b):void 0,r:p,s:m},r)},t.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var t=e.prototype.getDataFee.call(this);return t.iaddn(u.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.raw=function(){return[(0,c.bnToUnpaddedBuffer)(this.chainId),(0,c.bnToUnpaddedBuffer)(this.nonce),(0,c.bnToUnpaddedBuffer)(this.gasPrice),(0,c.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,c.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,c.bnToUnpaddedBuffer)(this.v):n.from([]),void 0!==this.r?(0,c.bnToUnpaddedBuffer)(this.r):n.from([]),void 0!==this.s?(0,c.bnToUnpaddedBuffer)(this.s):n.from([])]},t.prototype.serialize=function(){var e=this.raw();return n.concat([d,c.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,8),r=n.concat([d,c.rlp.encode(t)]);return e?(0,c.keccak256)(r):r},t.prototype.hash=function(){if(!this.isSigned()){var e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,c.keccak256)(this.serialize())),this.cache.hash):(0,c.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned()){var t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}var r=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(f.N_DIV_2))){t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(t)}var n=this,a=n.yParity,i=n.r,o=n.s;try{return(0,c.ecrecover)(r,a.addn(27),(0,c.bnToUnpaddedBuffer)(i),(0,c.bnToUnpaddedBuffer)(o))}catch(s){t=this._errorMsg("Invalid Signature");throw new Error(t)}},t.prototype._processSignature=function(e,r,n){var a=i(i({},this.txOptions),{common:this.common});return t.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new c.BN(e-27),r:new c.BN(r),s:new c.BN(n)},a)},t.prototype.toJSON=function(){var e=u.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,c.bnToHex)(this.chainId),nonce:(0,c.bnToHex)(this.nonce),gasPrice:(0,c.bnToHex)(this.gasPrice),gasLimit:(0,c.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,c.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,c.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,c.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,c.bnToHex)(this.s):void 0}},t.prototype.errorStr=function(){var e,t,r=this._getSharedErrorPostfix();return r+=" gasPrice=".concat(this.gasPrice," accessListCount=").concat(null!==(t=null===(e=this.accessList)||void 0===e?void 0:e.length)&&void 0!==t?t:0)},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(s.BaseTransaction);t.default=l},20258:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FeeMarketEIP1559Transaction=t.TransactionFactory=t.AccessListEIP2930Transaction=t.Transaction=void 0;var o=r(94305);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return i(o).default}});var c=r(52247);Object.defineProperty(t,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return i(c).default}});var s=r(67328);Object.defineProperty(t,"TransactionFactory",{enumerable:!0,get:function(){return i(s).default}});var f=r(32354);Object.defineProperty(t,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return i(f).default}}),a(r(54527),t)},94305:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},i.apply(this,arguments)},o=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(c){a={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var c=r(66854),s=r(54527),f=r(3060),u=r(29988),d=function(e){function t(t,r){void 0===r&&(r={});var n,a=this;if((a=e.call(this,i(i({},t),{type:0}),r)||this).common=a._validateTxV(a.v,r.common),a.gasPrice=new c.BN((0,c.toBuffer)(""===t.gasPrice?"0x":t.gasPrice)),a.gasPrice.mul(a.gasLimit).gt(c.MAX_INTEGER)){var o=a._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(o)}if(a._validateCannotExceedMaxInteger({gasPrice:a.gasPrice}),a.common.gteHardfork("spuriousDragon"))if(a.isSigned()){var f=a.v,d=a.common.chainIdBN().muln(2);(f.eq(d.addn(35))||f.eq(d.addn(36)))&&a.activeCapabilities.push(s.Capability.EIP155ReplayProtection)}else a.activeCapabilities.push(s.Capability.EIP155ReplayProtection);return a.common.isActivatedEIP(3860)&&(0,u.checkMaxInitCodeSize)(a.common,a.data.length),(null===(n=null===r||void 0===r?void 0:r.freeze)||void 0===n||n)&&Object.freeze(a),a}return a(t,e),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,t){void 0===t&&(t={});var r=c.rlp.decode(e);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,t)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),6!==e.length&&9!==e.length)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");var n=o(e,9),a=n[0],i=n[1],s=n[2],f=n[3],u=n[4],d=n[5],l=n[6],h=n[7],b=n[8];return(0,c.validateNoLeadingZeroes)({nonce:a,gasPrice:i,gasLimit:s,value:u,v:l,r:h,s:b}),new t({nonce:a,gasPrice:i,gasLimit:s,to:f,value:u,data:d,v:l,r:h,s:b},r)},t.prototype.raw=function(){return[(0,c.bnToUnpaddedBuffer)(this.nonce),(0,c.bnToUnpaddedBuffer)(this.gasPrice),(0,c.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,c.bnToUnpaddedBuffer)(this.value),this.data,void 0!==this.v?(0,c.bnToUnpaddedBuffer)(this.v):n.from([]),void 0!==this.r?(0,c.bnToUnpaddedBuffer)(this.r):n.from([]),void 0!==this.s?(0,c.bnToUnpaddedBuffer)(this.s):n.from([])]},t.prototype.serialize=function(){return c.rlp.encode(this.raw())},t.prototype._getMessageToSign=function(){var e=[(0,c.bnToUnpaddedBuffer)(this.nonce),(0,c.bnToUnpaddedBuffer)(this.gasPrice),(0,c.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,c.bnToUnpaddedBuffer)(this.value),this.data];return this.supports(s.Capability.EIP155ReplayProtection)&&(e.push((0,c.toBuffer)(this.common.chainIdBN())),e.push((0,c.unpadBuffer)((0,c.toBuffer)(0))),e.push((0,c.unpadBuffer)((0,c.toBuffer)(0)))),e},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this._getMessageToSign();return e?(0,c.rlphash)(t):t},t.prototype.getDataFee=function(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:e.prototype.getDataFee.call(this),hardfork:this.common.hardfork()}),e.prototype.getDataFee.call(this))},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.hash=function(){return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,c.rlphash)(this.raw())),this.cache.hash):(0,c.rlphash)(this.raw())},t.prototype.getMessageToVerifySignature=function(){if(!this.isSigned()){var e=this._errorMsg("This transaction is not signed");throw new Error(e)}var t=this._getMessageToSign();return(0,c.rlphash)(t)},t.prototype.getSenderPublicKey=function(){var e,t=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(s.N_DIV_2))){var r=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(r)}var n=this,a=n.v,i=n.r,o=n.s;try{return(0,c.ecrecover)(t,a,(0,c.bnToUnpaddedBuffer)(i),(0,c.bnToUnpaddedBuffer)(o),this.supports(s.Capability.EIP155ReplayProtection)?this.common.chainIdBN():void 0)}catch(f){r=this._errorMsg("Invalid Signature");throw new Error(r)}},t.prototype._processSignature=function(e,r,n){var a=new c.BN(e);this.supports(s.Capability.EIP155ReplayProtection)&&a.iadd(this.common.chainIdBN().muln(2).addn(8));var o=i(i({},this.txOptions),{common:this.common});return t.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:a,r:new c.BN(r),s:new c.BN(n)},o)},t.prototype.toJSON=function(){return{nonce:(0,c.bnToHex)(this.nonce),gasPrice:(0,c.bnToHex)(this.gasPrice),gasLimit:(0,c.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,c.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),v:void 0!==this.v?(0,c.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,c.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,c.bnToHex)(this.s):void 0}},t.prototype._validateTxV=function(e,t){if(void 0!==e&&e.ltn(37)&&!e.eqn(27)&&!e.eqn(28))throw new Error("Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ".concat(e));var r;if(void 0!==e&&(!t||t.gteHardfork("spuriousDragon"))&&!e.eqn(27)&&!e.eqn(28))if(t){var n=t.chainIdBN().muln(2);if(!(e.eq(n.addn(35))||e.eq(n.addn(36))))throw new Error("Incompatible EIP155-based V ".concat(e," and chain id ").concat(t.chainIdBN(),". See the Common parameter of the Transaction constructor to set the chain id."))}else{var a=void 0;a=e.subn(35).isEven()?35:36,r=e.subn(a).divn(2)}return this._getCommon(t,r)},t.prototype._unsignedTxImplementsEIP155=function(){return this.common.gteHardfork("spuriousDragon")},t.prototype._signedTxImplementsEIP155=function(){if(!this.isSigned()){var e=this._errorMsg("This transaction is not signed");throw new Error(e)}var t=this.common.gteHardfork("spuriousDragon"),r=this.v,n=this.common.chainIdBN().muln(2);return(r.eq(n.addn(35))||r.eq(n.addn(36)))&&t},t.prototype.errorStr=function(){var e=this._getSharedErrorPostfix();return e+=" gasPrice=".concat(this.gasPrice)},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(f.BaseTransaction);t.default=d},67328:function(e,t,r){"use strict";var n=r(19778).Buffer;Object.defineProperty(t,"__esModule",{value:!0});var a=r(66854),i=r(20258),o=function(){function e(){}return e.fromTxData=function(e,t){if(void 0===t&&(t={}),"type"in e&&void 0!==e.type){var r=new a.BN((0,a.toBuffer)(e.type)).toNumber();if(0===r)return i.Transaction.fromTxData(e,t);if(1===r)return i.AccessListEIP2930Transaction.fromTxData(e,t);if(2===r)return i.FeeMarketEIP1559Transaction.fromTxData(e,t);throw new Error("Tx instantiation with type ".concat(r," not supported"))}return i.Transaction.fromTxData(e,t)},e.fromSerializedData=function(e,t){if(void 0===t&&(t={}),e[0]<=127){var r=void 0;switch(e[0]){case 1:r=2930;break;case 2:r=1559;break;default:throw new Error("TypedTransaction with ID ".concat(e[0]," unknown"))}return 1559===r?i.FeeMarketEIP1559Transaction.fromSerializedTx(e,t):i.AccessListEIP2930Transaction.fromSerializedTx(e,t)}return i.Transaction.fromSerializedTx(e,t)},e.fromBlockBodyData=function(e,t){if(void 0===t&&(t={}),n.isBuffer(e))return this.fromSerializedData(e,t);if(Array.isArray(e))return i.Transaction.fromValuesArray(e,t);throw new Error("Cannot decode transaction: unknown type input")},e.getTransactionClass=function(e,t){if(void 0===e&&(e=0),0==e||e>=128&&e<=255)return i.Transaction;switch(e){case 1:return i.AccessListEIP2930Transaction;case 2:return i.FeeMarketEIP1559Transaction;default:throw new Error("TypedTransaction with ID ".concat(e," unknown"))}},e}();t.default=o},54527:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.N_DIV_2=t.isAccessList=t.isAccessListBuffer=t.Capability=void 0;var n=r(66854);function a(e){if(0===e.length)return!0;var t=e[0];return!!Array.isArray(t)}!function(e){e[e.EIP155ReplayProtection=155]="EIP155ReplayProtection",e[e.EIP1559FeeMarket=1559]="EIP1559FeeMarket",e[e.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",e[e.EIP2930AccessLists=2930]="EIP2930AccessLists"}(t.Capability||(t.Capability={})),t.isAccessListBuffer=a,t.isAccessList=function(e){return!a(e)},t.N_DIV_2=new n.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)},29988:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccessLists=t.checkMaxInitCodeSize=void 0;var n=r(66854),a=r(54527);t.checkMaxInitCodeSize=function(e,t){if(t>e.param("vm","maxInitCodeSize"))throw new Error("the initcode size of this transaction is too large: it is ".concat(t," while the max is ").concat(e.param("vm","maxInitCodeSize")))};var i=function(){function e(){}return e.getAccessListData=function(e){var t,r;if(e&&(0,a.isAccessList)(e)){t=e;for(var i=[],o=0;o<e.length;o++){for(var c=e[o],s=(0,n.toBuffer)(c.address),f=[],u=0;u<c.storageKeys.length;u++)f.push((0,n.toBuffer)(c.storageKeys[u]));i.push([s,f])}r=i}else{r=null!==e&&void 0!==e?e:[];var d=[];for(o=0;o<r.length;o++){var l=r[o],h=(0,n.bufferToHex)(l[0]),b=[];for(c=0;c<l[1].length;c++)b.push((0,n.bufferToHex)(l[1][c]));var p={address:h,storageKeys:b};d.push(p)}t=d}return{AccessListJSON:t,accessList:r}},e.verifyAccessList=function(e){for(var t=0;t<e.length;t++){var r=e[t],n=r[0],a=r[1];if(void 0!==r[2])throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(20!=n.length)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(var i=0;i<a.length;i++)if(32!=a[i].length)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}},e.getAccessListJSON=function(e){for(var t=[],r=0;r<e.length;r++){for(var a=e[r],i={address:"0x"+(0,n.setLengthLeft)(a[0],20).toString("hex"),storageKeys:[]},o=a[1],c=0;c<o.length;c++){var s=o[c];i.storageKeys.push("0x"+(0,n.setLengthLeft)(s,32).toString("hex"))}t.push(i)}return t},e.getDataFeeEIP2930=function(e,t){for(var r=t.param("gasPrices","accessListStorageKeyCost"),n=t.param("gasPrices","accessListAddressCost"),a=0,i=0;i<e.length;i++){a+=e[i][1].length}return e.length*n+a*r},e}();t.AccessLists=i},61668:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(75304).Buffer}catch(_){}function c(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,r){var n=c(e,r);return r-1>=t&&(n|=c(e,r-1)<<4),n}function f(e,t,r,a){for(var i=0,o=0,c=Math.min(e.length,r),s=t;s<c;s++){var f=e.charCodeAt(s)-48;i*=a,o=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&o<a,"Invalid character"),i+=o}return i}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a<e.length&&(16===t?this._parseHex(e,a,r):(this._parseBase(e,t,a),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var i,o,c=0;if("be"===r)for(a=e.length-1,i=0;a>=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(a=0,i=0;a<e.length;a+=3)o=e[a]|e[a+1]<<8|e[a+2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,i=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,s=0,u=r;u<c;u+=n)s=f(e,u,u+n,t),this.imuln(a),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==o){var d=1;for(s=f(e,u,e.length,t),u=0;u<o;u++)d*=t;this.imuln(d),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){u(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(_){i.prototype.inspect=d}else i.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","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"],h=[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],b=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,i=0,o=0;o<this.length;o++){var c=this.words[o],s=(16777215&(c<<a|i)).toString(16);i=c>>>24-a&16777215,(a+=2)>=26&&(a-=26,o--),r=0!==i||o!==this.length-1?l[6-s.length]+s+r:s+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=h[e],u=b[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modrn(u).toString(e);r=(d=d.idivn(u)).isZero()?p+r:l[f-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,s=o/67108864|0;r.words[0]=c;for(var f=1;f<n;f++){for(var u=s>>>26,d=67108863&s,l=Math.min(f,t.length-1),h=Math.max(0,f-e.length+1);h<=l;h++){var b=f-h|0;u+=(o=(a=0|e.words[b])*(i=0|t.words[h])+d)/67108864|0,d=67108863&o}r.words[f]=0|d,s=0|u}return 0!==s?r.words[f]=0|s:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,a),o},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===i?(r<e.length&&(e[r++]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a<t;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<a:this.words[r]&~(1<<a),this._strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&t,a=t>>>26;for(;0!==a&&i<r.length;i++)t=(0|r.words[i])+a,this.words[i]=67108863&t,a=t>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.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 r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)i=(t=(0|r.words[o])-(0|n.words[o])+i)>>26,this.words[o]=67108863&t;for(;0!==i&&o<r.length;o++)i=(t=(0|r.words[o])+i)>>26,this.words[o]=67108863&t;if(0===i&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,a,i,o=e.words,c=t.words,s=r.words,f=0,u=0|o[0],d=8191&u,l=u>>>13,h=0|o[1],b=8191&h,p=h>>>13,m=0|o[2],x=8191&m,g=m>>>13,v=0|o[3],y=8191&v,w=v>>>13,M=0|o[4],k=8191&M,A=M>>>13,I=0|o[5],E=8191&I,S=I>>>13,_=0|o[6],N=8191&_,j=_>>>13,C=0|o[7],T=8191&C,L=C>>>13,D=0|o[8],O=8191&D,P=D>>>13,R=0|o[9],B=8191&R,z=R>>>13,U=0|c[0],Z=8191&U,F=U>>>13,Y=0|c[1],G=8191&Y,H=Y>>>13,W=0|c[2],q=8191&W,Q=W>>>13,V=0|c[3],J=8191&V,K=V>>>13,X=0|c[4],$=8191&X,ee=X>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],se=8191&ce,fe=ce>>>13,ue=0|c[8],de=8191&ue,le=ue>>>13,he=0|c[9],be=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(d,Z))|0)+((8191&(a=(a=Math.imul(d,F))+Math.imul(l,Z)|0))<<13)|0;f=((i=Math.imul(l,F))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(b,Z),a=(a=Math.imul(b,F))+Math.imul(p,Z)|0,i=Math.imul(p,F);var xe=(f+(n=n+Math.imul(d,G)|0)|0)+((8191&(a=(a=a+Math.imul(d,H)|0)+Math.imul(l,G)|0))<<13)|0;f=((i=i+Math.imul(l,H)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,Z),a=(a=Math.imul(x,F))+Math.imul(g,Z)|0,i=Math.imul(g,F),n=n+Math.imul(b,G)|0,a=(a=a+Math.imul(b,H)|0)+Math.imul(p,G)|0,i=i+Math.imul(p,H)|0;var ge=(f+(n=n+Math.imul(d,q)|0)|0)+((8191&(a=(a=a+Math.imul(d,Q)|0)+Math.imul(l,q)|0))<<13)|0;f=((i=i+Math.imul(l,Q)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(y,Z),a=(a=Math.imul(y,F))+Math.imul(w,Z)|0,i=Math.imul(w,F),n=n+Math.imul(x,G)|0,a=(a=a+Math.imul(x,H)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,H)|0,n=n+Math.imul(b,q)|0,a=(a=a+Math.imul(b,Q)|0)+Math.imul(p,q)|0,i=i+Math.imul(p,Q)|0;var ve=(f+(n=n+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,K)|0)+Math.imul(l,J)|0))<<13)|0;f=((i=i+Math.imul(l,K)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(k,Z),a=(a=Math.imul(k,F))+Math.imul(A,Z)|0,i=Math.imul(A,F),n=n+Math.imul(y,G)|0,a=(a=a+Math.imul(y,H)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,H)|0,n=n+Math.imul(x,q)|0,a=(a=a+Math.imul(x,Q)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,Q)|0,n=n+Math.imul(b,J)|0,a=(a=a+Math.imul(b,K)|0)+Math.imul(p,J)|0,i=i+Math.imul(p,K)|0;var ye=(f+(n=n+Math.imul(d,$)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,$)|0))<<13)|0;f=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(E,Z),a=(a=Math.imul(E,F))+Math.imul(S,Z)|0,i=Math.imul(S,F),n=n+Math.imul(k,G)|0,a=(a=a+Math.imul(k,H)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,H)|0,n=n+Math.imul(y,q)|0,a=(a=a+Math.imul(y,Q)|0)+Math.imul(w,q)|0,i=i+Math.imul(w,Q)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,K)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0,n=n+Math.imul(b,$)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(f+(n=n+Math.imul(d,re)|0)|0)+((8191&(a=(a=a+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;f=((i=i+Math.imul(l,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(N,Z),a=(a=Math.imul(N,F))+Math.imul(j,Z)|0,i=Math.imul(j,F),n=n+Math.imul(E,G)|0,a=(a=a+Math.imul(E,H)|0)+Math.imul(S,G)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(k,q)|0,a=(a=a+Math.imul(k,Q)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,Q)|0,n=n+Math.imul(y,J)|0,a=(a=a+Math.imul(y,K)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,K)|0,n=n+Math.imul(x,$)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(b,re)|0,a=(a=a+Math.imul(b,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var Me=(f+(n=n+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(l,ie)|0))<<13)|0;f=((i=i+Math.imul(l,oe)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(T,Z),a=(a=Math.imul(T,F))+Math.imul(L,Z)|0,i=Math.imul(L,F),n=n+Math.imul(N,G)|0,a=(a=a+Math.imul(N,H)|0)+Math.imul(j,G)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(E,q)|0,a=(a=a+Math.imul(E,Q)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,Q)|0,n=n+Math.imul(k,J)|0,a=(a=a+Math.imul(k,K)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(y,$)|0,a=(a=a+Math.imul(y,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(b,ie)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var ke=(f+(n=n+Math.imul(d,se)|0)|0)+((8191&(a=(a=a+Math.imul(d,fe)|0)+Math.imul(l,se)|0))<<13)|0;f=((i=i+Math.imul(l,fe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,Z),a=(a=Math.imul(O,F))+Math.imul(P,Z)|0,i=Math.imul(P,F),n=n+Math.imul(T,G)|0,a=(a=a+Math.imul(T,H)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,H)|0,n=n+Math.imul(N,q)|0,a=(a=a+Math.imul(N,Q)|0)+Math.imul(j,q)|0,i=i+Math.imul(j,Q)|0,n=n+Math.imul(E,J)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(k,$)|0,a=(a=a+Math.imul(k,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,a=(a=a+Math.imul(y,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,oe)|0,n=n+Math.imul(b,se)|0,a=(a=a+Math.imul(b,fe)|0)+Math.imul(p,se)|0,i=i+Math.imul(p,fe)|0;var Ae=(f+(n=n+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;f=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,Z),a=(a=Math.imul(B,F))+Math.imul(z,Z)|0,i=Math.imul(z,F),n=n+Math.imul(O,G)|0,a=(a=a+Math.imul(O,H)|0)+Math.imul(P,G)|0,i=i+Math.imul(P,H)|0,n=n+Math.imul(T,q)|0,a=(a=a+Math.imul(T,Q)|0)+Math.imul(L,q)|0,i=i+Math.imul(L,Q)|0,n=n+Math.imul(N,J)|0,a=(a=a+Math.imul(N,K)|0)+Math.imul(j,J)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(E,$)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(k,re)|0,a=(a=a+Math.imul(k,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(y,ie)|0,a=(a=a+Math.imul(y,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,se)|0,a=(a=a+Math.imul(x,fe)|0)+Math.imul(g,se)|0,i=i+Math.imul(g,fe)|0,n=n+Math.imul(b,de)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(p,de)|0,i=i+Math.imul(p,le)|0;var Ie=(f+(n=n+Math.imul(d,be)|0)|0)+((8191&(a=(a=a+Math.imul(d,pe)|0)+Math.imul(l,be)|0))<<13)|0;f=((i=i+Math.imul(l,pe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,G),a=(a=Math.imul(B,H))+Math.imul(z,G)|0,i=Math.imul(z,H),n=n+Math.imul(O,q)|0,a=(a=a+Math.imul(O,Q)|0)+Math.imul(P,q)|0,i=i+Math.imul(P,Q)|0,n=n+Math.imul(T,J)|0,a=(a=a+Math.imul(T,K)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(N,$)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(E,re)|0,a=(a=a+Math.imul(E,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(k,ie)|0,a=(a=a+Math.imul(k,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,n=n+Math.imul(y,se)|0,a=(a=a+Math.imul(y,fe)|0)+Math.imul(w,se)|0,i=i+Math.imul(w,fe)|0,n=n+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(g,de)|0,i=i+Math.imul(g,le)|0;var Ee=(f+(n=n+Math.imul(b,be)|0)|0)+((8191&(a=(a=a+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;f=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,Q))+Math.imul(z,q)|0,i=Math.imul(z,Q),n=n+Math.imul(O,J)|0,a=(a=a+Math.imul(O,K)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,K)|0,n=n+Math.imul(T,$)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(N,re)|0,a=(a=a+Math.imul(N,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,oe)|0,n=n+Math.imul(k,se)|0,a=(a=a+Math.imul(k,fe)|0)+Math.imul(A,se)|0,i=i+Math.imul(A,fe)|0,n=n+Math.imul(y,de)|0,a=(a=a+Math.imul(y,le)|0)+Math.imul(w,de)|0,i=i+Math.imul(w,le)|0;var Se=(f+(n=n+Math.imul(x,be)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(g,be)|0))<<13)|0;f=((i=i+Math.imul(g,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,J),a=(a=Math.imul(B,K))+Math.imul(z,J)|0,i=Math.imul(z,K),n=n+Math.imul(O,$)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(N,ie)|0,a=(a=a+Math.imul(N,oe)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,oe)|0,n=n+Math.imul(E,se)|0,a=(a=a+Math.imul(E,fe)|0)+Math.imul(S,se)|0,i=i+Math.imul(S,fe)|0,n=n+Math.imul(k,de)|0,a=(a=a+Math.imul(k,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var _e=(f+(n=n+Math.imul(y,be)|0)|0)+((8191&(a=(a=a+Math.imul(y,pe)|0)+Math.imul(w,be)|0))<<13)|0;f=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,$),a=(a=Math.imul(B,ee))+Math.imul(z,$)|0,i=Math.imul(z,ee),n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(N,se)|0,a=(a=a+Math.imul(N,fe)|0)+Math.imul(j,se)|0,i=i+Math.imul(j,fe)|0,n=n+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,le)|0;var Ne=(f+(n=n+Math.imul(k,be)|0)|0)+((8191&(a=(a=a+Math.imul(k,pe)|0)+Math.imul(A,be)|0))<<13)|0;f=((i=i+Math.imul(A,pe)|0)+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,re),a=(a=Math.imul(B,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(T,se)|0,a=(a=a+Math.imul(T,fe)|0)+Math.imul(L,se)|0,i=i+Math.imul(L,fe)|0,n=n+Math.imul(N,de)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,le)|0;var je=(f+(n=n+Math.imul(E,be)|0)|0)+((8191&(a=(a=a+Math.imul(E,pe)|0)+Math.imul(S,be)|0))<<13)|0;f=((i=i+Math.imul(S,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(B,ie),a=(a=Math.imul(B,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(O,se)|0,a=(a=a+Math.imul(O,fe)|0)+Math.imul(P,se)|0,i=i+Math.imul(P,fe)|0,n=n+Math.imul(T,de)|0,a=(a=a+Math.imul(T,le)|0)+Math.imul(L,de)|0,i=i+Math.imul(L,le)|0;var Ce=(f+(n=n+Math.imul(N,be)|0)|0)+((8191&(a=(a=a+Math.imul(N,pe)|0)+Math.imul(j,be)|0))<<13)|0;f=((i=i+Math.imul(j,pe)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,se),a=(a=Math.imul(B,fe))+Math.imul(z,se)|0,i=Math.imul(z,fe),n=n+Math.imul(O,de)|0,a=(a=a+Math.imul(O,le)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,le)|0;var Te=(f+(n=n+Math.imul(T,be)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(L,be)|0))<<13)|0;f=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,de),a=(a=Math.imul(B,le))+Math.imul(z,de)|0,i=Math.imul(z,le);var Le=(f+(n=n+Math.imul(O,be)|0)|0)+((8191&(a=(a=a+Math.imul(O,pe)|0)+Math.imul(P,be)|0))<<13)|0;f=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(Le>>>26)|0,Le&=67108863;var De=(f+(n=Math.imul(B,be))|0)+((8191&(a=(a=Math.imul(B,pe))+Math.imul(z,be)|0))<<13)|0;return f=((i=Math.imul(z,pe))+(a>>>13)|0)+(De>>>26)|0,De&=67108863,s[0]=me,s[1]=xe,s[2]=ge,s[3]=ve,s[4]=ye,s[5]=we,s[6]=Me,s[7]=ke,s[8]=Ae,s[9]=Ie,s[10]=Ee,s[11]=Se,s[12]=_e,s[13]=Ne,s[14]=je,s[15]=Ce,s[16]=Te,s[17]=Le,s[18]=De,0!==f&&(s[19]=f,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var o=a;a=0;for(var c=67108863&n,s=Math.min(i,t.length-1),f=Math.max(0,i-e.length+1);f<=s;f++){var u=i-f,d=(0|e.words[u])*(0|t.words[f]),l=67108863&d;c=67108863&(l=l+c|0),a+=(o=(o=o+(d/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function g(e,t,r){return x(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?x(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,a=0;a<t;a++)n|=(1&e)<<t-a-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o<i;o++)n[o]=t[e[o]],a[o]=r[e[o]]},v.prototype.transform=function(e,t,r,n,a,i){this.permute(i,e,t,r,n,a);for(var o=1;o<a;o<<=1)for(var c=o<<1,s=Math.cos(2*Math.PI/c),f=Math.sin(2*Math.PI/c),u=0;u<a;u+=c)for(var d=s,l=f,h=0;h<o;h++){var b=r[u+h],p=n[u+h],m=r[u+h+o],x=n[u+h+o],g=d*m-l*x;x=d*x+l*m,m=g,r[u+h]=b+m,n[u+h]=p+x,r[u+h+o]=b-m,n[u+h+o]=p-x,h!==c&&(g=s*d-f*l,l=s*l+f*d,d=g)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=e[n];e[n]=e[r-n-1],e[r-n-1]=a,a=t[n],t[n]=-t[r-n-1],t[r-n-1]=-a}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var a=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&a,r=a<67108864?0:a/67108864|0}return e},v.prototype.convert13b=function(e,t,r,a){for(var i=0,o=0;o<t;o++)i+=0|e[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o<a;++o)r[o]=0;n(0===i),n(0===(-8192&i))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),a=this.makeRBT(n),i=this.stub(n),o=new Array(n),c=new Array(n),s=new Array(n),f=new Array(n),u=new Array(n),d=new Array(n),l=r.words;l.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,f,n),this.transform(o,i,c,s,n,a),this.transform(f,i,u,d,n,a);for(var h=0;h<n;h++){var b=c[h]*u[h]-s[h]*d[h];s[h]=c[h]*d[h]+s[h]*u[h],c[h]=b}return this.conjugate(c,s,n),this.transform(c,s,l,i,n,a),this.conjugate(l,i,n),this.normalize13b(l,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"===typeof e),n(e<67108864);for(var r=0,a=0;a<this.length;a++){var i=(0|this.words[a])*e,o=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=o>>>26,this.words[a]=67108863&o}return 0!==r&&(this.words[a]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,a=r%26;t[r]=e.words[n]>>>a&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,a=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var c=this.words[t]&i,s=(0|this.words[t])-c<<r;this.words[t]=s|o,o=c>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t<a;t++)this.words[t]=0;this.length+=a}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var a;n("number"===typeof e&&e>=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<<i,s=r;if(a-=o,a=Math.max(0,a),s){for(var f=0;f<o;f++)s.words[f]=this.words[f];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;var u=0;for(f=this.length-1;f>=0&&(0!==u||f>=a);f--){var d=0|this.words[f];this.words[f]=u<<26-i|d>>>i,u=d&c}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<<t;return!(this.length<=r)&&!!(this.words[r]&a)},i.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<<t;this.words[this.length-1]&=a}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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},i.prototype.isubn=function(e){if(n("number"===typeof e),n(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var a,i,o=e.length+r;this._expand(o);var c=0;for(a=0;a<e.length;a++){i=(0|this.words[a+r])+c;var s=(0|e.words[a])*t;c=((i-=67108863&s)>>26)-(s/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)c=(i=(0|this.words[a+r])+c)>>26,this.words[a+r]=67108863&i;if(0===c)return this._strip();for(n(-1===c),c=0,a=0;a<this.length;a++)c=(i=-(0|this.words[a])+c)>>26,this.words[a]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var c,s=n.length-a.length;if("mod"!==t){(c=new i(null)).length=s+1,c.words=new Array(c.length);for(var f=0;f<c.length;f++)c.words[f]=0}var u=n.clone()._ishlnsubmul(a,1,s);0===u.negative&&(n=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var l=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(a,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);c&&(c.words[d]=l)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(a=c.div.neg()),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(a=c.div.neg()),{div:a,mod:c.mod}):0!==(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:c.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,c},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,a=0,i=this.length-1;i>=0;i--)a=(r*a+(0|this.words[i]))%e;return t?-a:a},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,a=this.length-1;a>=0;a--){var i=(0|this.words[a])+67108864*r;this.words[a]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),c=new i(0),s=new i(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0===(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var b=0,p=1;0===(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(c.isOdd()||s.isOdd())&&(c.iadd(u),s.isub(d)),c.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(c),o.isub(s)):(r.isub(t),c.isub(a),s.isub(o))}return{a:c,b:s,gcd:r.iushln(f)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),c=new i(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0===(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var d=0,l=1;0===(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)c.isOdd()&&c.iadd(s),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(c)):(r.isub(t),c.isub(o))}return(a=0===t.cmpn(1)?o:c).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,a=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,o=r;0!==i&&o<this.length;o++){var c=0|this.words[o];i=(c+=i)>>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:a<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){n<a?t=-1:n>a&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},a(M,w),M.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a<n;a++)t.words[a]=e.words[a];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,a=10;a<e.length;a++){var o=0|e.words[a];e.words[a-10]=(o&r)<<4|i>>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(k,w),a(A,w),a(I,w),I.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,a=67108863&n;n>>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new k;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return y[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var c=new i(1).toRed(this),s=c.redNeg(),f=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,f).cmp(s);)u.redIAdd(s);for(var d=this.pow(u,a),l=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),b=o;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();n(m<b);var x=this.pow(d,new i(1).iushln(b-m-1));l=l.redMul(x),d=x.redSqr(),h=h.redMul(d),b=m}return l},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,c=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],u=s-1;u>=0;u--){var d=f>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++c||0===n&&0===u)&&(a=this.mul(a,r[o]),c=0,o=0)):c=0}s=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},a(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},37380:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(c){a={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var o=i(r(88093)),c=r(17399),s=r(30013),f=r(19545),u=r(56136),d=r(92471),l=r(56223),h=r(47638),b=r(50303),p=function(){function e(e,t,r,n){void 0===e&&(e=new c.BN(0)),void 0===t&&(t=new c.BN(0)),void 0===r&&(r=u.KECCAK256_RLP),void 0===n&&(n=u.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=n,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,n=t.balance,a=t.stateRoot,i=t.codeHash;return new e(r?new c.BN((0,d.toBuffer)(r)):void 0,n?new c.BN((0,d.toBuffer)(n)):void 0,a?(0,d.toBuffer)(a):void 0,i?(0,d.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=c.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var r=a(t,4),n=r[0],i=r[1],o=r[2],s=r[3];return new e(new c.BN(n),new c.BN(i),o,s)},e.prototype._validate=function(){if(this.nonce.lt(new c.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new c.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,b.bnToUnpaddedBuffer)(this.nonce),(0,b.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return c.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(u.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(u.KECCAK256_NULL)},e}();t.Account=p;t.isValidAddress=function(e){try{(0,h.assertIsString)(e)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};t.toChecksumAddress=function(e,t){(0,h.assertIsHexString)(e);var r=(0,f.stripHexPrefix)(e).toLowerCase(),n="";t&&(n=(0,b.toType)(t,b.TypeOutput.BN).toString()+"0x");for(var a=(0,l.keccakFromString)(n+r).toString("hex"),i="0x",o=0;o<r.length;o++)parseInt(a[o],16)>=8?i+=r[o].toUpperCase():i+=r[o];return i};t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.generateAddress=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var r=new c.BN(t);return r.isZero()?(0,l.rlphash)([e,null]).slice(-20):(0,l.rlphash)([e,n.from(r.toArray())]).slice(-20)};t.generateAddress2=function(e,t,r){return(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,o.default)(20===e.length),(0,o.default)(32===t.length),(0,l.keccak256)(n.concat([n.from("ff","hex"),e,t,(0,l.keccak256)(r)])).slice(-20)};t.isValidPrivate=function(e){return(0,s.privateKeyVerify)(e)};t.isValidPublic=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,s.publicKeyVerify)(n.concat([n.from([4]),e])):!!t&&(0,s.publicKeyVerify)(e)};t.pubToAddress=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=n.from((0,s.publicKeyConvert)(e,!1).slice(1))),(0,o.default)(64===e.length),(0,l.keccak)(e).slice(-20)},t.publicToAddress=t.pubToAddress;t.privateToPublic=function(e){return(0,h.assertIsBuffer)(e),n.from((0,s.publicKeyCreate)(e,!1)).slice(1)};t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.importPublic=function(e){return(0,h.assertIsBuffer)(e),64!==e.length&&(e=n.from((0,s.publicKeyConvert)(e,!1).slice(1))),e};t.zeroAddress=function(){var e=(0,d.zeros)(20);return(0,d.bufferToHex)(e)};t.isZeroAddress=function(e){try{(0,h.assertIsString)(e)}catch(r){return!1}return(0,t.zeroAddress)()===e}},52731:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var i=a(r(88093)),o=r(17399),c=r(92471),s=r(37380),f=function(){function e(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,c.zeros)(20))},e.fromString=function(t){return(0,i.default)((0,s.isValidAddress)(t),"Invalid address"),new e((0,c.toBuffer)(t))},e.fromPublicKey=function(t){return(0,i.default)(n.isBuffer(t),"Public key should be Buffer"),new e((0,s.pubToAddress)(t))},e.fromPrivateKey=function(t){return(0,i.default)(n.isBuffer(t),"Private key should be Buffer"),new e((0,s.privateToAddress)(t))},e.generate=function(t,r){return(0,i.default)(o.BN.isBN(r)),new e((0,s.generateAddress)(t.buf,r.toArrayLike(n)))},e.generate2=function(t,r,a){return(0,i.default)(n.isBuffer(r)),(0,i.default)(n.isBuffer(a)),new e((0,s.generateAddress2)(t.buf,r,a))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new o.BN(this.buf),t=new o.BN(0),r=new o.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return n.from(this.buf)},e}();t.Address=f},92471:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(c){a={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var o=r(17399),c=r(19545),s=r(47638);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(e){var r=(0,t.intToHex)(e);return n.from((0,c.padToEven)(r.slice(2)),"hex")};t.zeros=function(e){return n.allocUnsafe(e).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length<r?(e.copy(a),a):e.slice(0,r):e.length<r?(e.copy(a,r-e.length),a):e.slice(-r)};t.setLengthLeft=function(e,t){return(0,s.assertIsBuffer)(e),f(e,t,!1)};t.setLengthRight=function(e,t){return(0,s.assertIsBuffer)(e),f(e,t,!0)};var u=function(e){for(var t=e[0];e.length>0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,s.assertIsBuffer)(e),u(e)};t.unpadArray=function(e){return(0,s.assertIsArray)(e),u(e)};t.unpadHexString=function(e){return(0,s.assertIsHexString)(e),e=(0,c.stripHexPrefix)(e),u(e)};t.toBuffer=function(e){if(null===e||void 0===e)return n.allocUnsafe(0);if(n.isBuffer(e))return n.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return n.from(e);if("string"===typeof e){if(!(0,c.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return n.from((0,c.padToEven)((0,c.stripHexPrefix)(e)),"hex")}if("number"===typeof e)return(0,t.intToBuffer)(e);if(o.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(n)}if(e.toArray)return n.from(e.toArray());if(e.toBuffer)return n.from(e.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new o.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new o.BN(e).fromTwos(256)};t.toUnsigned=function(e){return n.from(e.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!==typeof e||(0,c.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(e){if((e=(0,c.stripHexPrefix)(e)).length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return n.from(e.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(e){if(n.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],a=0;a<e.length;a++)r.push((0,t.baToJSON)(e[a]));return r}};t.validateNoLeadingZeroes=function(e){var t,r;try{for(var n=a(Object.entries(e)),o=n.next();!o.done;o=n.next()){var c=i(o.value,2),s=c[0],f=c[1];if(void 0!==f&&f.length>0&&0===f[0])throw new Error("".concat(s," cannot have leading zeroes, received: ").concat(f.toString("hex")))}}catch(u){t={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},t.arrToBufArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):n.from(t)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!==t&&void 0!==t?t:[])}},56136:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var n=r(19778),a=r(17399);t.MAX_UINT64=new a.BN("ffffffffffffffff",16),t.MAX_INTEGER=new a.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new a.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex")},17399:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(61668));t.BN=c.default;var s=i(r(76445));t.rlp=s},56223:function(e,t,r){"use strict";var n=r(19778).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var a=r(7285),i=r(83569),o=r(17399),c=r(92471),s=r(47638);t.keccak=function(e,t){switch(void 0===t&&(t=256),(0,s.assertIsBuffer)(e),t){case 224:return(0,a.keccak224)(e);case 256:return(0,a.keccak256)(e);case 384:return(0,a.keccak384)(e);case 512:return(0,a.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak256=function(e){return(0,t.keccak)(e)};t.keccakFromString=function(e,r){void 0===r&&(r=256),(0,s.assertIsString)(e);var a=n.from(e,"utf8");return(0,t.keccak)(a,r)};t.keccakFromHexString=function(e,r){return void 0===r&&(r=256),(0,s.assertIsHexString)(e),(0,t.keccak)((0,c.toBuffer)(e),r)};t.keccakFromArray=function(e,r){return void 0===r&&(r=256),(0,s.assertIsArray)(e),(0,t.keccak)((0,c.toBuffer)(e),r)};var f=function(e){return e=(0,c.toBuffer)(e),i("sha256").update(e).digest()};t.sha256=function(e){return(0,s.assertIsBuffer)(e),f(e)};t.sha256FromString=function(e){return(0,s.assertIsString)(e),f(e)};t.sha256FromArray=function(e){return(0,s.assertIsArray)(e),f(e)};var u=function(e,t){e=(0,c.toBuffer)(e);var r=i("rmd160").update(e).digest();return!0===t?(0,c.setLengthLeft)(r,32):r};t.ripemd160=function(e,t){return(0,s.assertIsBuffer)(e),u(e,t)};t.ripemd160FromString=function(e,t){return(0,s.assertIsString)(e),u(e,t)};t.ripemd160FromArray=function(e,t){return(0,s.assertIsArray)(e),u(e,t)};t.rlphash=function(e){return(0,t.keccak)(o.rlp.encode(e))}},47638:function(e,t,r){"use strict";var n=r(19778).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var a=r(19545);t.assertIsHexString=function(e){if(!(0,a.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=function(e){if(!n.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsString=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}}},66854:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(56136),t),a(r(37380),t),a(r(52731),t),a(r(56223),t),a(r(90135),t),a(r(92471),t),a(r(54889),t),a(r(17399),t),a(r(50303),t);var i=r(19545);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},19545:function(e,t,r){"use strict";var n=r(19778).Buffer;function a(e){if("string"!==typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=a;function i(e){var t=e;if("string"!==typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!==typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return a(e)?e.slice(2):e},t.padToEven=i,t.getBinarySize=function(e){if("string"!==typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return n.byteLength(e,"utf8")},t.arrayContainsArray=function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){var a=parseInt(e.substr(r,2),16);t+=String.fromCharCode(a)}return t},t.fromUtf8=function(e){var t=n.from(e,"utf8");return"0x".concat(i(t.toString("hex")).replace(/^0+|0+$/g,""))},t.fromAscii=function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r).toString(16);t+=n.length<2?"0".concat(n):n}return"0x".concat(t)},t.getKeys=function(e,t,r){if(!Array.isArray(e))throw new Error("[getKeys] method expects input 'params' to be an array, got ".concat(typeof e));if("string"!==typeof t)throw new Error("[getKeys] method expects input 'key' to be type 'string', got ".concat(typeof e));for(var n=[],a=0;a<e.length;a++){var i=e[a][t];if(r&&!i)i="";else if("string"!==typeof i)throw new Error("invalid abi - expected type 'string', received ".concat(typeof i));n.push(i)}return n},t.isHexString=function(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}},54889:function(e,t,r){"use strict";var n=r(19778).Buffer,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=void 0;var i=a(r(88093)),o=r(19545),c=r(17399),s=r(92471);t.defineProperties=function(e,t,r){if(e.raw=[],e._fields=[],e.toJSON=function(t){if(void 0===t&&(t=!1),t){var r={};return e._fields.forEach((function(t){r[t]="0x".concat(e[t].toString("hex"))})),r}return(0,s.baToJSON)(e.raw)},e.serialize=function(){return c.rlp.encode(e.raw)},t.forEach((function(t,r){function a(){return e.raw[r]}function o(a){"00"!==(a=(0,s.toBuffer)(a)).toString("hex")||t.allowZero||(a=n.allocUnsafe(0)),t.allowLess&&t.length?(a=(0,s.unpadBuffer)(a),(0,i.default)(t.length>=a.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===a.length||!t.length||(0,i.default)(t.length===a.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[r]=a}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:a,set:o}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:o,get:a})})),r)if("string"===typeof r&&(r=n.from((0,o.stripHexPrefix)(r),"hex")),n.isBuffer(r)&&(r=c.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,s.toBuffer)(t)}))}else{if("object"!==typeof r)throw new Error("invalid data");var a=Object.keys(r);t.forEach((function(t){-1!==a.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==a.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}}},90135:function(e,t,r){"use strict";var n=r(19778).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var a=r(30013),i=r(17399),o=r(92471),c=r(56223),s=r(47638),f=r(50303);function u(e,t){var r=(0,f.toType)(e,f.TypeOutput.BN);if(r.eqn(0)||r.eqn(1))return(0,f.toType)(e,f.TypeOutput.BN);if(!t)return r.subn(27);var n=(0,f.toType)(t,f.TypeOutput.BN);return r.sub(n.muln(2).addn(35))}function d(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=function(e,t,r){var i=(0,a.ecdsaSign)(e,t),o=i.signature,c=i.recid,s=n.from(o.slice(0,32)),u=n.from(o.slice(32,64));if(!r||"number"===typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{r:s,s:u,v:r?c+(2*r+35):c+27}}return{r:s,s:u,v:(0,f.toType)(r,f.TypeOutput.BN).muln(2).addn(35).addn(c).toArrayLike(n)}};t.ecrecover=function(e,t,r,i,c){var s=n.concat([(0,o.setLengthLeft)(r,32),(0,o.setLengthLeft)(i,32)],64),f=u(t,c);if(!d(f))throw new Error("Invalid signature v value");var l=(0,a.ecdsaRecover)(s,f.toNumber(),e);return n.from((0,a.publicKeyConvert)(l,!1).slice(1))};t.toRpcSig=function(e,t,r,a){if(!d(u(e,a)))throw new Error("Invalid signature v value");return(0,o.bufferToHex)(n.concat([(0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(r,32),(0,o.toBuffer)(e)]))};t.toCompactSig=function(e,t,r,a){if(!d(u(e,a)))throw new Error("Invalid signature v value");var i=(0,f.toType)(e,f.TypeOutput.Number),c=r;return(i>28&&i%2===1||1===i||28===i)&&((c=n.from(r))[0]|=128),(0,o.bufferToHex)(n.concat([(0,o.setLengthLeft)(t,32),(0,o.setLengthLeft)(c,32)]))};t.fromRpcSig=function(e){var t,r,n,a=(0,o.toBuffer)(e);if(a.length>=65)t=a.slice(0,32),r=a.slice(32,64),n=(0,o.bufferToInt)(a.slice(64));else{if(64!==a.length)throw new Error("Invalid signature length");t=a.slice(0,32),r=a.slice(32,64),n=(0,o.bufferToInt)(a.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:t,s:r}};t.isValidSignature=function(e,t,r,n,a){void 0===n&&(n=!0);var o=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),c=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!d(u(e,a)))return!1;var s=new i.BN(t),f=new i.BN(r);return!(s.isZero()||s.gt(c)||f.isZero()||f.gt(c))&&(!n||1!==f.cmp(o))};t.hashPersonalMessage=function(e){(0,s.assertIsBuffer)(e);var t=n.from("\x19Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,c.keccak)(n.concat([t,e]))}},50303:function(e,t,r){"use strict";var n=r(19778).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var a,i=r(17399),o=r(19545),c=r(92471);function s(e){return(0,c.unpadBuffer)(e.toArrayLike(n))}t.bnToHex=function(e){return"0x".concat(e.toString(16))},t.bnToUnpaddedBuffer=s,t.bnToRlp=function(e){return s(e)},function(e){e[e.Number=0]="Number",e[e.BN=1]="BN",e[e.Buffer=2]="Buffer",e[e.PrefixedHexString=3]="PrefixedHexString"}(a=t.TypeOutput||(t.TypeOutput={})),t.toType=function(e,t){if(null===e)return null;if(void 0!==e){if("string"===typeof e&&!(0,o.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"===typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var r=(0,c.toBuffer)(e);if(t===a.Buffer)return r;if(t===a.BN)return new i.BN(r);if(t===a.Number){var n=new i.BN(r),s=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(n.gt(s))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return n.toNumber()}return"0x".concat(r.toString("hex"))}}},82056:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="abi/5.7.0"},65054:function(e,t,r){"use strict";r.d(t,{R:function(){return P},$:function(){return R}});var n=r(27853),a=r(84531),i=r(49716),o=r(30520),c=r(39502),s=r(82056),f=r(73198),u=r(81020),d=r(18992),l=r(97419),h=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e){return(0,n.Z)(this,r),t.call(this,"address","address",e,!1)}return(0,a.Z)(r,[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=(0,l.getAddress)(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return(0,l.getAddress)((0,i.hexZeroPad)(e.readValue().toHexString(),20))}}]),r}(f.XI),b=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e){var a;return(0,n.Z)(this,r),(a=t.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,a}return(0,a.Z)(r,[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}]),r}(f.XI),p=new c.Logger(s.i);function m(e,t,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===typeof r){var a={};n=t.map((function(e){var t=e.localName;return t||p.throwError("cannot encode object for signature with missing names",c.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),a[t]&&p.throwError("cannot encode object for signature with duplicate names",c.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),a[t]=!0,r[t]}))}else p.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&p.throwArgumentError("types/value length mismatch","tuple",r);var i=new f.QV(e.wordSize),o=new f.QV(e.wordSize),s=[];t.forEach((function(e,t){var r=n[t];if(e.dynamic){var a=o.length;e.encode(o,r);var c=i.writeUpdatableValue();s.push((function(e){c(e+a)}))}else e.encode(i,r)})),s.forEach((function(e){e(i.length)}));var u=e.appendWriter(i);return u+=e.appendWriter(o)}function x(e,t){var r=[],n=e.subReader(0);t.forEach((function(t){var a=null;if(t.dynamic){var i=e.readValue(),o=n.subReader(i.toNumber());try{a=t.decode(o)}catch(s){if(s.code===c.Logger.errors.BUFFER_OVERRUN)throw s;(a=s).baseType=t.name,a.name=t.localName,a.type=t.type}}else try{a=t.decode(e)}catch(s){if(s.code===c.Logger.errors.BUFFER_OVERRUN)throw s;(a=s).baseType=t.name,a.name=t.localName,a.type=t.type}void 0!=a&&r.push(a)}));var a=t.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach((function(e,t){var n=e.localName;if(n&&1===a[n]&&("length"===n&&(n="_length"),null==r[n])){var i=r[t];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw i}}):r[n]=i}}));for(var i=function(e){var t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:function(){throw t}})},o=0;o<r.length;o++)i(o);return Object.freeze(r)}var g=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e,a,i){var o;(0,n.Z)(this,r);var c=e.type+"["+(a>=0?a:"")+"]",s=-1===a||e.dynamic;return(o=t.call(this,"array",c,i,s)).coder=e,o.length=a,o}return(0,a.Z)(r,[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;r<this.length;r++)t.push(e);return t}},{key:"encode",value:function(e,t){Array.isArray(t)||this._throwError("expected array value",t);var r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),p.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],a=0;a<t.length;a++)n.push(this.coder);return m(e,n,t)}},{key:"decode",value:function(e){var t=this.length;-1===t&&32*(t=e.readValue().toNumber())>e._data.length&&p.throwError("insufficient data length",c.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n<t;n++)r.push(new b(this.coder));return e.coerce(this.name,x(e,r))}}]),r}(f.XI),v=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e){return(0,n.Z)(this,r),t.call(this,"bool","bool",e,!1)}return(0,a.Z)(r,[{key:"defaultValue",value:function(){return!1}},{key:"encode",value:function(e,t){return e.writeValue(t?1:0)}},{key:"decode",value:function(e){return e.coerce(this.type,!e.readValue().isZero())}}]),r}(f.XI),y=r(44474),w=r(53538),M=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e,a){return(0,n.Z)(this,r),t.call(this,e,e,a,!0)}return(0,a.Z)(r,[{key:"defaultValue",value:function(){return"0x"}},{key:"encode",value:function(e,t){t=(0,i.arrayify)(t);var r=e.writeValue(t.length);return r+=e.writeBytes(t)}},{key:"decode",value:function(e){return e.readBytes(e.readValue().toNumber(),!0)}}]),r}(f.XI),k=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e){return(0,n.Z)(this,r),t.call(this,"bytes",e)}return(0,a.Z)(r,[{key:"decode",value:function(e){return e.coerce(this.name,(0,i.hexlify)((0,y.Z)((0,w.Z)(r.prototype),"decode",this).call(this,e)))}}]),r}(M),A=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e,a){var i;(0,n.Z)(this,r);var o="bytes"+String(e);return(i=t.call(this,o,o,a,!1)).size=e,i}return(0,a.Z)(r,[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}},{key:"encode",value:function(e,t){var r=(0,i.arrayify)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}},{key:"decode",value:function(e){return e.coerce(this.name,(0,i.hexlify)(e.readBytes(this.size)))}}]),r}(f.XI),I=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e){return(0,n.Z)(this,r),t.call(this,"null","",e,!1)}return(0,a.Z)(r,[{key:"defaultValue",value:function(){return null}},{key:"encode",value:function(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}},{key:"decode",value:function(e){return e.readBytes(0),e.coerce(this.name,null)}}]),r}(f.XI),E=r(2257),S=r(75422),_=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e,a,i){var o;(0,n.Z)(this,r);var c=(a?"int":"uint")+8*e;return(o=t.call(this,c,c,i,!1)).size=e,o.signed=a,o}return(0,a.Z)(r,[{key:"defaultValue",value:function(){return 0}},{key:"encode",value:function(e,t){var r=E.O$.from(t),n=S.Bz.mask(8*e.wordSize);if(this.signed){var a=n.mask(8*this.size-1);(r.gt(a)||r.lt(a.add(S.fh).mul(S.tL)))&&this._throwError("value out-of-bounds",t)}else(r.lt(S._Y)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}},{key:"decode",value:function(e){var t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}]),r}(f.XI),N=r(83374),j=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e){return(0,n.Z)(this,r),t.call(this,"string",e)}return(0,a.Z)(r,[{key:"defaultValue",value:function(){return""}},{key:"encode",value:function(e,t){return(0,y.Z)((0,w.Z)(r.prototype),"encode",this).call(this,e,(0,N.Y0)(t))}},{key:"decode",value:function(e){return(0,N.ZN)((0,y.Z)((0,w.Z)(r.prototype),"decode",this).call(this,e))}}]),r}(M),C=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e,a){var i;(0,n.Z)(this,r);var o=!1,c=[];e.forEach((function(e){e.dynamic&&(o=!0),c.push(e.type)}));var s="tuple("+c.join(",")+")";return(i=t.call(this,"tuple",s,a,o)).coders=e,i}return(0,a.Z)(r,[{key:"defaultValue",value:function(){var e=[];this.coders.forEach((function(t){e.push(t.defaultValue())}));var t=this.coders.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach((function(r,n){var a=r.localName;a&&1===t[a]&&("length"===a&&(a="_length"),null==e[a]&&(e[a]=e[n]))})),Object.freeze(e)}},{key:"encode",value:function(e,t){return m(e,this.coders,t)}},{key:"decode",value:function(e){return e.coerce(this.name,x(e,this.coders))}}]),r}(f.XI),T=r(33165),L=new c.Logger(s.i),D=new RegExp(/^bytes([0-9]*)$/),O=new RegExp(/^(u?int)([0-9]*)$/),P=function(){function e(t){(0,n.Z)(this,e),(0,o.defineReadOnly)(this,"coerceFunc",t||null)}return(0,a.Z)(e,[{key:"_getCoder",value:function(e){var t=this;switch(e.baseType){case"address":return new h(e.name);case"bool":return new v(e.name);case"string":return new j(e.name);case"bytes":return new k(e.name);case"array":return new g(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new C((e.components||[]).map((function(e){return t._getCoder(e)})),e.name);case"":return new I(e.name)}var r=e.type.match(O);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!==0)&&L.throwArgumentError("invalid "+r[1]+" bit length","param",e),new _(n/8,"int"===r[1],e.name)}if(r=e.type.match(D)){var a=parseInt(r[1]);return(0===a||a>32)&&L.throwArgumentError("invalid bytes length","param",e),new A(a,e.name)}return L.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new f.Ej(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new f.QV(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(T._R.from(e))}));return new C(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&L.throwError("types/values length mismatch",c.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(T._R.from(e))})),a=new C(n,"_"),i=this._getWriter();return a.encode(i,t),i.data}},{key:"decode",value:function(e,t,r){var n=this,a=e.map((function(e){return n._getCoder(T._R.from(e))}));return new C(a,"_").decode(this._getReader((0,i.arrayify)(t),r))}}]),e}(),R=new P},73198:function(e,t,r){"use strict";r.d(t,{BR:function(){return d},Ej:function(){return b},QV:function(){return h},XI:function(){return l}});var n=r(27853),a=r(84531),i=r(49716),o=r(2257),c=r(30520),s=r(39502),f=r(82056),u=new s.Logger(f.i);function d(e){var t=[];return function e(r,n){if(Array.isArray(n))for(var a in n){var i=r.slice();i.push(a);try{e(i,n[a])}catch(o){t.push({path:i,error:o})}}}([],e),t}var l=function(){function e(t,r,a,i){(0,n.Z)(this,e),this.name=t,this.type=r,this.localName=a,this.dynamic=i}return(0,a.Z)(e,[{key:"_throwError",value:function(e,t){u.throwArgumentError(e,this.localName,t)}}]),e}(),h=function(){function e(t){(0,n.Z)(this,e),(0,c.defineReadOnly)(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return(0,a.Z)(e,[{key:"data",get:function(){return(0,i.hexConcat)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData((0,i.concat)(e._data))}},{key:"writeBytes",value:function(e){var t=(0,i.arrayify)(e),r=t.length%this.wordSize;return r&&(t=(0,i.concat)([t,this._padding.slice(r)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=(0,i.arrayify)(o.O$.from(e));return t.length>this.wordSize&&u.throwError("value out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,i.concat)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),b=function(){function e(t,r,a,o){(0,n.Z)(this,e),(0,c.defineReadOnly)(this,"_data",(0,i.arrayify)(t)),(0,c.defineReadOnly)(this,"wordSize",r||32),(0,c.defineReadOnly)(this,"_coerceFunc",a),(0,c.defineReadOnly)(this,"allowLoose",o),this._offset=0}return(0,a.Z)(e,[{key:"data",get:function(){return(0,i.hexlify)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:u.throwError("data out-of-bounds",s.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return o.O$.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}()},33165:function(e,t,r){"use strict";r.d(t,{HY:function(){return w},IC:function(){return N},QV:function(){return M},Xg:function(){return E},YW:function(){return S},_R:function(){return v},pc:function(){return x}});var n=r(81020),a=r(18992),i=r(27853),o=r(84531),c=r(2257),s=r(30520),f=r(39502),u=r(82056),d=new f.Logger(u.i),l={},h={calldata:!0,memory:!0,storage:!0},b={calldata:!0,memory:!0};function p(e,t){if("bytes"===e||"string"===e){if(h[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&b[t])return!0;return(h[t]||"payable"===t)&&d.throwArgumentError("invalid modifier","name",t),!1}function m(e,t){for(var r in t)(0,s.defineReadOnly)(e,r,t[r])}var x=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),g=new RegExp(/^(.*)\[([0-9]*)\]$/),v=function(){function e(t,r){(0,i.Z)(this,e),t!==l&&d.throwError("use fromString",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),m(this,r);var n=this.type.match(g);m(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return(0,o.Z)(e,[{key:"format",value:function(e){if(e||(e=x.sighash),x[e]||d.throwArgumentError("invalid format type","format",e),e===x.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"===typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==x.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===x.full?", ":",")+")"):r+=this.type,e!==x.sighash&&(!0===this.indexed&&(r+=" indexed"),e===x.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"===typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(l,{name:t.name||null,type:j(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return n=function(e,t){var r=e;function n(t){d.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function a(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},o=i,c=0;c<e.length;c++){var s=e[c];switch(s){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||n(c),o.state.allowType=!1,o.type=j(o.type),o.components=[a(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(t||n(c),o.indexed=!0,o.name=""),p(o.type,o.name)&&(o.name=""),o.type=j(o.type);var f=o;(o=o.parent)||n(c),delete f.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(t||n(c),o.indexed=!0,o.name=""),p(o.type,o.name)&&(o.name=""),o.type=j(o.type);var u=a(o.parent);o.parent.components.push(u),delete o.parent,o=u;break;case" ":o.state.allowType&&""!==o.type&&(o.type=j(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(t||n(c),o.indexed&&n(c),o.indexed=!0,o.name=""):p(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(c),o.type+=s,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(c),o.type+=s,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=s,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=s,delete o.state.allowArray):o.state.readArray?o.type+=s:n(c)}}return o.parent&&d.throwArgumentError("unexpected eof","param",e),delete i.state,"indexed"===o.name?(t||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):p(o.type,o.name)&&(o.name=""),i.type=j(i.type),i}(t,!!r),e.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components});var n}},{key:"isParamType",value:function(e){return!(null==e||!e._isParamType)}}]),e}();function y(e,t){return function(e){e=e.trim();for(var t=[],r="",n=0,a=0;a<e.length;a++){var i=e[a];","===i&&0===n?(t.push(r),r=""):(r+=i,"("===i?n++:")"===i&&-1===--n&&d.throwArgumentError("unbalanced parenthesis","value",e))}r&&t.push(r);return t}(e).map((function(e){return v.fromString(e,t)}))}var w=function(){function e(t,r){(0,i.Z)(this,e),t!==l&&d.throwError("use a static from method",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),m(this,r),this._isFragment=!0,Object.freeze(this)}return(0,o.Z)(e,null,[{key:"from",value:function(t){return e.isFragment(t)?t:"string"===typeof t?e.fromString(t):e.fromObject(t)}},{key:"fromObject",value:function(t){if(e.isFragment(t))return t;switch(t.type){case"function":return S.fromObject(t);case"event":return M.fromObject(t);case"constructor":return E.fromObject(t);case"error":return N.fromObject(t);case"fallback":case"receive":return null}return d.throwArgumentError("invalid fragment object","value",t)}},{key:"fromString",value:function(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?M.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?S.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?E.fromString(e.trim()):"error"===e.split(" ")[0]?N.fromString(e.substring(5).trim()):d.throwArgumentError("unsupported fragment","value",e)}},{key:"isFragment",value:function(e){return!(!e||!e._isFragment)}}]),e}(),M=function(e){(0,n.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,o.Z)(r,[{key:"format",value:function(e){if(e||(e=x.sighash),x[e]||d.throwArgumentError("invalid format type","format",e),e===x.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==x.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===x.full?", ":",")+") ",e!==x.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isEventFragment(e))return e;"event"!==e.type&&d.throwArgumentError("invalid event object","value",e);var t={name:T(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(v.fromObject):[],type:"event"};return new r(l,t)}},{key:"fromString",value:function(e){var t=e.match(L);t||d.throwArgumentError("invalid event string","value",e);var n=!1;return t[3].split(" ").forEach((function(e){switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:d.warn("unknown modifier: "+e)}})),r.fromObject({name:t[1].trim(),anonymous:n,inputs:y(t[2],!0),type:"event"})}},{key:"isEventFragment",value:function(e){return e&&e._isFragment&&"event"===e.type}}]),r}(w);function k(e,t){t.gas=null;var r=e.split("@");return 1!==r.length?(r.length>2&&d.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||d.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=c.O$.from(r[1]),r[0]):e}function A(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function I(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&d.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&d.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||d.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&d.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&d.throwArgumentError("unable to determine stateMutability","value",e),t}var E=function(e){(0,n.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,o.Z)(r,[{key:"format",value:function(e){if(e||(e=x.sighash),x[e]||d.throwArgumentError("invalid format type","format",e),e===x.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===x.sighash&&d.throwError("cannot format a constructor for sighash",f.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===x.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&d.throwArgumentError("invalid constructor object","value",e);var t=I(e);t.constant&&d.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(v.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?c.O$.from(e.gas):null};return new r(l,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=k(e,t)).match(L);return n&&"constructor"===n[1].trim()||d.throwArgumentError("invalid constructor string","value",e),t.inputs=y(n[2].trim(),!1),A(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(w),S=function(e){(0,n.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,o.Z)(r,[{key:"format",value:function(e){if(e||(e=x.sighash),x[e]||d.throwArgumentError("invalid format type","format",e),e===x.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==x.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===x.full?", ":",")+") ",e!==x.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&d.throwArgumentError("invalid function object","value",e);var t=I(e),n={type:e.type,name:T(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(v.fromObject):[],outputs:e.outputs?e.outputs.map(v.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?c.O$.from(e.gas):null};return new r(l,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=k(e,t)).split(" returns ");n.length>2&&d.throwArgumentError("invalid function string","value",e);var a=n[0].match(L);if(a||d.throwArgumentError("invalid function signature","value",e),t.name=a[1].trim(),t.name&&T(t.name),t.inputs=y(a[2],!1),A(a[3].trim(),t),n.length>1){var i=n[1].match(L);""==i[1].trim()&&""==i[3].trim()||d.throwArgumentError("unexpected tokens","value",e),t.outputs=y(i[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(E);function _(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||d.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var N=function(e){(0,n.Z)(r,e);var t=(0,a.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,o.Z)(r,[{key:"format",value:function(e){if(e||(e=x.sighash),x[e]||d.throwArgumentError("invalid format type","format",e),e===x.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==x.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===x.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"===typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&d.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:T(e.name),inputs:e.inputs?e.inputs.map(v.fromObject):[]};return _(new r(l,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(L);return n||d.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&T(t.name),t.inputs=y(n[2],!1),_(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(w);function j(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var C=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function T(e){return e&&e.match(C)||d.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var L=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$")},18334:function(e,t,r){"use strict";r.r(t),r.d(t,{AbiCoder:function(){return a.R},ConstructorFragment:function(){return n.Xg},ErrorFragment:function(){return n.IC},EventFragment:function(){return n.QV},FormatTypes:function(){return n.pc},Fragment:function(){return n.HY},FunctionFragment:function(){return n.YW},Indexed:function(){return i.Hk},Interface:function(){return i.vU},LogDescription:function(){return i.CC},ParamType:function(){return n._R},TransactionDescription:function(){return i.vk},checkResultErrors:function(){return o.BR},defaultAbiCoder:function(){return a.$}});var n=r(33165),a=r(65054),i=r(17303),o=r(73198)},17303:function(e,t,r){"use strict";r.d(t,{CC:function(){return g},Hk:function(){return w},vU:function(){return A},vk:function(){return v}});var n=r(84531),a=r(27853),i=r(81020),o=r(18992),c=r(97419),s=r(2257),f=r(49716),u=r(51583),d=r(88062),l=r(30520),h=r(65054),b=r(33165),p=r(39502),m=r(82056),x=new p.Logger(m.i),g=function(e){(0,i.Z)(r,e);var t=(0,o.Z)(r);function r(){return(0,a.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r)}(l.Description),v=function(e){(0,i.Z)(r,e);var t=(0,o.Z)(r);function r(){return(0,a.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r)}(l.Description),y=function(e){(0,i.Z)(r,e);var t=(0,o.Z)(r);function r(){return(0,a.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r)}(l.Description),w=function(e){(0,i.Z)(r,e);var t=(0,o.Z)(r);function r(){return(0,a.Z)(this,r),t.apply(this,arguments)}return(0,n.Z)(r,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),r}(l.Description),M={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function k(e,t){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}var A=function(){function e(t){var r=this;(0,a.Z)(this,e);var n=[];n="string"===typeof t?JSON.parse(t):t,(0,l.defineReadOnly)(this,"fragments",n.map((function(e){return b.HY.from(e)})).filter((function(e){return null!=e}))),(0,l.defineReadOnly)(this,"_abiCoder",(0,l.getStatic)(this instanceof e?this.constructor:void 0,"getAbiCoder")()),(0,l.defineReadOnly)(this,"functions",{}),(0,l.defineReadOnly)(this,"errors",{}),(0,l.defineReadOnly)(this,"events",{}),(0,l.defineReadOnly)(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return r.deploy?void x.warn("duplicate definition - constructor"):void(0,l.defineReadOnly)(r,"deploy",e);case"function":t=r.functions;break;case"event":t=r.events;break;case"error":t=r.errors;break;default:return}var n=e.format();t[n]?x.warn("duplicate definition - "+n):t[n]=e})),this.deploy||(0,l.defineReadOnly)(this,"deploy",b.Xg.from({payable:!1,type:"constructor"})),(0,l.defineReadOnly)(this,"_isInterface",!0)}return(0,n.Z)(e,[{key:"format",value:function(e){e||(e=b.pc.full),e===b.pc.sighash&&x.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===b.pc.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if((0,f.isHexString)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];x.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?x.throwArgumentError("no matching function","name",r):n.length>1&&x.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var a=this.functions[b.YW.fromString(e).format()];return a||x.throwArgumentError("no matching function","signature",e),a}},{key:"getEvent",value:function(e){if((0,f.isHexString)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];x.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),a=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===a.length?x.throwArgumentError("no matching event","name",n):a.length>1&&x.throwArgumentError("multiple matching events","name",n),this.events[a[0]]}var i=this.events[b.QV.fromString(e).format()];return i||x.throwArgumentError("no matching event","signature",e),i}},{key:"getError",value:function(e){if((0,f.isHexString)(e)){var t=(0,l.getStatic)(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}x.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),a=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===a.length?x.throwArgumentError("no matching error","name",n):a.length>1&&x.throwArgumentError("multiple matching errors","name",n),this.errors[a[0]]}var i=this.errors[b.YW.fromString(e).format()];return i||x.throwArgumentError("no matching error","signature",e),i}},{key:"getSighash",value:function(e){if("string"===typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(r){throw t}}return(0,l.getStatic)(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"===typeof e&&(e=this.getEvent(e)),(0,l.getStatic)(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"===typeof e&&(e=this.getError(e));var r=(0,f.arrayify)(t);return(0,f.hexlify)(r.slice(0,4))!==this.getSighash(e)&&x.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",(0,f.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"===typeof e&&(e=this.getError(e)),(0,f.hexlify)((0,f.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=(0,f.arrayify)(t);return(0,f.hexlify)(r.slice(0,4))!==this.getSighash(e)&&x.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",(0,f.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,f.hexlify)((0,f.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"===typeof e&&(e=this.getFunction(e));var r=(0,f.arrayify)(t),n=null,a="",i=null,o=null,c=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(d){}break;case 4:var s=(0,f.hexlify)(r.slice(0,4)),u=M[s];if(u)i=this._abiCoder.decode(u.inputs,r.slice(4)),o=u.name,c=u.signature,u.reason&&(n=i[0]),"Error"===o?a="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(i[0])):"Panic"===o&&(a="; VM Exception while processing transaction: reverted with panic code ".concat(i[0]));else try{var d=this.getError(s);i=this._abiCoder.decode(d.inputs,r.slice(4)),o=d.name,c=d.format()}catch(d){}}return x.throwError("call revert exception"+a,p.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,f.hexlify)(t),errorArgs:i,errorName:o,errorSignature:c,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"===typeof e&&(e=this.getFunction(e)),(0,f.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"===typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&x.throwError("too many arguments for "+e.format(),p.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var n=[];e.anonymous||n.push(this.getEventTopic(e));var a=function(e,t){return"string"===e.type?(0,u.id)(t):"bytes"===e.type?(0,d.keccak256)((0,f.hexlify)(t)):("bool"===e.type&&"boolean"===typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=s.O$.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),(0,f.hexZeroPad)((0,f.hexlify)(t),32))};for(t.forEach((function(t,r){var i=e.inputs[r];i.indexed?null==t?n.push(null):"array"===i.baseType||"tuple"===i.baseType?x.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?n.push(t.map((function(e){return a(i,e)}))):n.push(a(i,t)):null!=t&&x.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"===typeof e&&(e=this.getEvent(e));var n=[],a=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&x.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,o){var c=t[o];if(e.indexed)if("string"===e.type)n.push((0,u.id)(c));else if("bytes"===e.type)n.push((0,d.keccak256)(c));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[c]))}else a.push(e),i.push(c)})),{data:this._abiCoder.encode(a,i),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"===typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);(0,f.isHexString)(r[0],32)&&r[0].toLowerCase()===n||x.throwError("fragment/topic mismatch",p.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var a=[],i=[],o=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(a.push(b._R.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(a.push(e),o.push(!1)):(i.push(e),o.push(!1))}));var c=null!=r?this._abiCoder.decode(a,(0,f.concat)(r)):null,s=this._abiCoder.decode(i,t,!0),u=[],d=0,l=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==c)u[t]=new w({_isIndexed:!0,hash:null});else if(o[t])u[t]=new w({_isIndexed:!0,hash:c[l++]});else try{u[t]=c[l++]}catch(n){u[t]=n}else try{u[t]=s[d++]}catch(n){u[t]=n}if(e.name&&null==u[e.name]){var r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:function(){throw k("property ".concat(JSON.stringify(e.name)),r)}}):u[e.name]=r}}));for(var h=function(e){var t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:function(){throw k("index ".concat(e),t)}})},m=0;m<u.length;m++)h(m);return Object.freeze(u)}},{key:"parseTransaction",value:function(e){var t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new v({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:s.O$.from(e.value||"0")}):null}},{key:"parseLog",value:function(e){var t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new g({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}},{key:"parseError",value:function(e){var t=(0,f.hexlify)(e),r=this.getError(t.substring(0,10).toLowerCase());return r?new y({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}}],[{key:"getAbiCoder",value:function(){return h.$}},{key:"getAddress",value:function(e){return(0,c.getAddress)(e)}},{key:"getSighash",value:function(e){return(0,f.hexDataSlice)((0,u.id)(e.format()),0,4)}},{key:"getEventTopic",value:function(e){return(0,u.id)(e.format())}},{key:"isInterface",value:function(e){return!(!e||!e._isInterface)}}]),e}()},69745:function(e,t,r){"use strict";r.d(t,{Sg:function(){return h},zt:function(){return b}});var n=r(27166),a=r(27853),i=r(84531),o=r(81020),c=r(18992),s=r(2257),f=r(30520),u=r(39502),d=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},l=new u.Logger("abstract-provider/5.7.0"),h=function(e){(0,o.Z)(r,e);var t=(0,c.Z)(r);function r(){return(0,a.Z)(this,r),t.apply(this,arguments)}return(0,i.Z)(r,null,[{key:"isForkEvent",value:function(e){return!(!e||!e._isForkEvent)}}]),r}(f.Description),b=function(){function e(){(0,a.Z)(this,e),l.checkAbstract(this instanceof e?this.constructor:void 0,e),(0,f.defineReadOnly)(this,"_isProvider",!0)}return(0,i.Z)(e,[{key:"getFeeData",value:function(){return d(this,void 0,void 0,(0,n.Z)().mark((function e(){var t,r,a,i,o,c;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((function(e){return null}))});case 2:return t=e.sent,r=t.block,a=t.gasPrice,i=null,o=null,c=null,r&&r.baseFeePerGas&&(i=r.baseFeePerGas,c=s.O$.from("1500000000"),o=r.baseFeePerGas.mul(2).add(c)),e.abrupt("return",{lastBaseFeePerGas:i,maxFeePerGas:o,maxPriorityFeePerGas:c,gasPrice:a});case 8:case"end":return e.stop()}}),e,this)})))}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"isProvider",value:function(e){return!(!e||!e._isProvider)}}]),e}()},68408:function(e,t,r){"use strict";r.r(t),r.d(t,{Signer:function(){return p},VoidSigner:function(){return m}});var n=r(6148),a=r(81020),i=r(18992),o=r(27166),c=r(27853),s=r(84531),f=r(30520),u=r(39502),d=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},l=new u.Logger("abstract-signer/5.7.0"),h=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],b=[u.Logger.errors.INSUFFICIENT_FUNDS,u.Logger.errors.NONCE_EXPIRED,u.Logger.errors.REPLACEMENT_UNDERPRICED],p=function(){function e(){(0,c.Z)(this,e),l.checkAbstract(this instanceof e?this.constructor:void 0,e),(0,f.defineReadOnly)(this,"_isSigner",!0)}return(0,s.Z)(e,[{key:"getBalance",value:function(e){return d(this,void 0,void 0,(0,o.Z)().mark((function t(){return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getBalance"),t.next=3,this.provider.getBalance(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getTransactionCount",value:function(e){return d(this,void 0,void 0,(0,o.Z)().mark((function t(){return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getTransactionCount"),t.next=3,this.provider.getTransactionCount(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"estimateGas",value:function(e){return d(this,void 0,void 0,(0,o.Z)().mark((function t(){var r;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("estimateGas"),t.next=3,(0,f.resolveProperties)(this.checkTransaction(e));case 3:return r=t.sent,t.next=6,this.provider.estimateGas(r);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"call",value:function(e,t){return d(this,void 0,void 0,(0,o.Z)().mark((function r(){var n;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this._checkProvider("call"),r.next=3,(0,f.resolveProperties)(this.checkTransaction(e));case 3:return n=r.sent,r.next=6,this.provider.call(n,t);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sendTransaction",value:function(e){return d(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("sendTransaction"),t.next=3,this.populateTransaction(e);case 3:return r=t.sent,t.next=6,this.signTransaction(r);case 6:return n=t.sent,t.next=9,this.provider.sendTransaction(n);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getChainId",value:function(){return d(this,void 0,void 0,(0,o.Z)().mark((function e(){var t;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getChainId"),e.next=3,this.provider.getNetwork();case 3:return t=e.sent,e.abrupt("return",t.chainId);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return d(this,void 0,void 0,(0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getGasPrice"),e.next=3,this.provider.getGasPrice();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getFeeData",value:function(){return d(this,void 0,void 0,(0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getFeeData"),e.next=3,this.provider.getFeeData();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"resolveName",value:function(e){return d(this,void 0,void 0,(0,o.Z)().mark((function t(){return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("resolveName"),t.next=3,this.provider.resolveName(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"checkTransaction",value:function(e){for(var t in e)-1===h.indexOf(t)&&l.throwArgumentError("invalid transaction key: "+t,"transaction",e);var r=(0,f.shallowCopy)(e);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then((function(t){return t[0].toLowerCase()!==t[1].toLowerCase()&&l.throwArgumentError("from address mismatch","transaction",e),t[0]})),r}},{key:"populateTransaction",value:function(e){return d(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n,a,i,c=this;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,f.resolveProperties)(this.checkTransaction(e));case 2:if(null!=(r=t.sent).to&&(r.to=Promise.resolve(r.to).then((function(e){return d(c,void 0,void 0,(0,o.Z)().mark((function t(){var r;return(0,o.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.resolveName(e);case 4:return null==(r=t.sent)&&l.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))})),r.to.catch((function(e){}))),n=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas,null==r.gasPrice||2!==r.type&&!n?0!==r.type&&1!==r.type||!n||l.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):l.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas){t.next=10;break}r.type=2,t.next=18;break;case 10:if(0!==r.type&&1!==r.type){t.next=14;break}null==r.gasPrice&&(r.gasPrice=this.getGasPrice()),t.next=18;break;case 14:return t.next=16,this.getFeeData();case 16:a=t.sent,null==r.type?null!=a.maxFeePerGas&&null!=a.maxPriorityFeePerGas?(r.type=2,null!=r.gasPrice?(i=r.gasPrice,delete r.gasPrice,r.maxFeePerGas=i,r.maxPriorityFeePerGas=i):(null==r.maxFeePerGas&&(r.maxFeePerGas=a.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=a.maxPriorityFeePerGas))):null!=a.gasPrice?(n&&l.throwError("network does not support EIP-1559",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=a.gasPrice),r.type=0):l.throwError("failed to get consistent fee data",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=a.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=a.maxPriorityFeePerGas));case 18:return null==r.nonce&&(r.nonce=this.getTransactionCount("pending")),null==r.gasLimit&&(r.gasLimit=this.estimateGas(r).catch((function(e){if(b.indexOf(e.code)>=0)throw e;return l.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",u.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&l.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,(0,f.resolveProperties)(r);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||l.throwError("missing provider",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),m=function(e){(0,a.Z)(r,e);var t=(0,i.Z)(r);function r(e,a){var i;return(0,c.Z)(this,r),i=t.call(this),(0,f.defineReadOnly)((0,n.Z)(i),"address",e),(0,f.defineReadOnly)((0,n.Z)(i),"provider",a||null),i}return(0,s.Z)(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){l.throwError(e,u.Logger.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,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new r(this.address,e)}}]),r}(p)},97419:function(e,t,r){"use strict";r.r(t),r.d(t,{getAddress:function(){return p},getContractAddress:function(){return g},getCreate2Address:function(){return v},getIcapAddress:function(){return x},isAddress:function(){return m}});var n=r(49716),a=r(2257),i=r(88062),o=r(17986),c=new(r(39502).Logger)("address/5.7.0");function s(e){(0,n.isHexString)(e,20)||c.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),a=0;a<40;a++)r[a]=t[a].charCodeAt(0);for(var o=(0,n.arrayify)((0,i.keccak256)(r)),s=0;s<40;s+=2)o[s>>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(15&o[s>>1])>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}for(var f={},u=0;u<10;u++)f[String(u)]=String(u);for(var d=0;d<26;d++)f[String.fromCharCode(65+d)]=String(10+d);var l,h=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function b(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return f[e]})).join("");t.length>=h;){var r=t.substring(0,h);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function p(e){var t=null;if("string"!==typeof e&&c.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=s(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&c.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)!==b(e)&&c.throwArgumentError("bad icap checksum","address",e),t=(0,a.g$)(e.substring(4));t.length<40;)t="0"+t;t=s("0x"+t)}else c.throwArgumentError("invalid address","address",e);return t}function m(e){try{return p(e),!0}catch(t){}return!1}function x(e){for(var t=(0,a.t2)(p(e).substring(2)).toUpperCase();t.length<30;)t="0"+t;return"XE"+b("XE00"+t)+t}function g(e){var t=null;try{t=p(e.from)}catch(s){c.throwArgumentError("missing from address","transaction",e)}var r=(0,n.stripZeros)((0,n.arrayify)(a.O$.from(e.nonce).toHexString()));return p((0,n.hexDataSlice)((0,i.keccak256)((0,o.encode)([t,r])),12))}function v(e,t,r){return 32!==(0,n.hexDataLength)(t)&&c.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,n.hexDataLength)(r)&&c.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),p((0,n.hexDataSlice)((0,i.keccak256)((0,n.concat)(["0xff",p(e),t,r])),12))}},87354:function(e,t,r){"use strict";r.d(t,{J:function(){return a},c:function(){return i}});var n=r(49716);function a(e){e=atob(e);for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r));return(0,n.arrayify)(t)}function i(e){e=(0,n.arrayify)(e);for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}},21800:function(e,t,r){"use strict";r.r(t),r.d(t,{decode:function(){return n.J},encode:function(){return n.c}});var n=r(87354)},3482:function(e,t,r){"use strict";r.r(t),r.d(t,{Base32:function(){return s},Base58:function(){return f},BaseX:function(){return c}});var n=r(27853),a=r(84531),i=r(49716),o=r(30520),c=function(){function e(t){(0,n.Z)(this,e),(0,o.defineReadOnly)(this,"alphabet",t),(0,o.defineReadOnly)(this,"base",t.length),(0,o.defineReadOnly)(this,"_alphabetMap",{}),(0,o.defineReadOnly)(this,"_leader",t.charAt(0));for(var r=0;r<t.length;r++)this._alphabetMap[t.charAt(r)]=r}return(0,a.Z)(e,[{key:"encode",value:function(e){var t=(0,i.arrayify)(e);if(0===t.length)return"";for(var r=[0],n=0;n<t.length;++n){for(var a=t[n],o=0;o<r.length;++o)a+=r[o]<<8,r[o]=a%this.base,a=a/this.base|0;for(;a>0;)r.push(a%this.base),a=a/this.base|0}for(var c="",s=0;0===t[s]&&s<t.length-1;++s)c+=this._leader;for(var f=r.length-1;f>=0;--f)c+=this.alphabet[r[f]];return c}},{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 r=0;r<e.length;r++){var n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");for(var a=n,o=0;o<t.length;++o)a+=t[o]*this.base,t[o]=255&a,a>>=8;for(;a>0;)t.push(255&a),a>>=8}for(var c=0;e[c]===this._leader&&c<e.length-1;++c)t.push(0);return(0,i.arrayify)(new Uint8Array(t.reverse()))}}]),e}(),s=new c("abcdefghijklmnopqrstuvwxyz234567"),f=new c("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},86945:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="bignumber/5.7.0"},2257:function(e,t,r){"use strict";r.d(t,{O$:function(){return m},Zm:function(){return b},g$:function(){return w},t2:function(){return M}});var n=r(27853),a=r(84531),i=r(63244),o=r.n(i),c=r(49716),s=r(39502),f=r(86945),u=o().BN,d=new s.Logger(f.i),l={},h=9007199254740991;function b(e){return null!=e&&(m.isBigNumber(e)||"number"===typeof e&&e%1===0||"string"===typeof e&&!!e.match(/^-?[0-9]+$/)||(0,c.isHexString)(e)||"bigint"===typeof e||(0,c.isBytes)(e))}var p=!1,m=function(){function e(t,r){(0,n.Z)(this,e),t!==l&&d.throwError("cannot call constructor directly; use BigNumber.from",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}return(0,a.Z)(e,[{key:"fromTwos",value:function(e){return g(v(this).fromTwos(e))}},{key:"toTwos",value:function(e){return g(v(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return g(v(this).add(v(e)))}},{key:"sub",value:function(e){return g(v(this).sub(v(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&y("division-by-zero","div"),g(v(this).div(v(t)))}},{key:"mul",value:function(e){return g(v(this).mul(v(e)))}},{key:"mod",value:function(e){var t=v(e);return t.isNeg()&&y("division-by-zero","mod"),g(v(this).umod(t))}},{key:"pow",value:function(e){var t=v(e);return t.isNeg()&&y("negative-power","pow"),g(v(this).pow(t))}},{key:"and",value:function(e){var t=v(e);return(this.isNegative()||t.isNeg())&&y("unbound-bitwise-result","and"),g(v(this).and(t))}},{key:"or",value:function(e){var t=v(e);return(this.isNegative()||t.isNeg())&&y("unbound-bitwise-result","or"),g(v(this).or(t))}},{key:"xor",value:function(e){var t=v(e);return(this.isNegative()||t.isNeg())&&y("unbound-bitwise-result","xor"),g(v(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&y("negative-width","mask"),g(v(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&y("negative-width","shl"),g(v(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&y("negative-width","shr"),g(v(this).shrn(e))}},{key:"eq",value:function(e){return v(this).eq(v(e))}},{key:"lt",value:function(e){return v(this).lt(v(e))}},{key:"lte",value:function(e){return v(this).lte(v(e))}},{key:"gt",value:function(e){return v(this).gt(v(e))}},{key:"gte",value:function(e){return v(this).gte(v(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return v(this).isZero()}},{key:"toNumber",value:function(){try{return v(this).toNumber()}catch(e){y("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return d.throwError("this platform does not support BigInt",s.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?p||(p=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),v(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(l,x(t)):t.match(/^-?[0-9]+$/)?new e(l,x(new u(t))):d.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&y("underflow","BigNumber.from",t),(t>=h||t<=-h)&&y("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"===typeof r)return e.from(r.toString());if((0,c.isBytes)(r))return e.from((0,c.hexlify)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"===typeof n)return e.from(n)}else{var a=r._hex;if(null==a&&"BigNumber"===r.type&&(a=r.hex),"string"===typeof a&&((0,c.isHexString)(a)||"-"===a[0]&&(0,c.isHexString)(a.substring(1))))return e.from(a)}return d.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function x(e){if("string"!==typeof e)return x(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=x(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 g(e){return m.from(x(e))}function v(e){var t=m.from(e).toHexString();return"-"===t[0]?new u("-"+t.substring(3),16):new u(t.substring(2),16)}function y(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),d.throwError(e,s.Logger.errors.NUMERIC_FAULT,n)}function w(e){return new u(e,36).toString(16)}function M(e){return new u(e,16).toString(36)}},1503:function(e,t,r){"use strict";r.d(t,{Ox:function(){return x},S5:function(){return m},xO:function(){return g},xs:function(){return v}});var n=r(27853),a=r(84531),i=r(49716),o=r(39502),c=r(86945),s=r(2257),f=new o.Logger(c.i),u={},d=s.O$.from(0),l=s.O$.from(-1);function h(e,t,r,n){var a={fault:t,operation:r};return void 0!==n&&(a.value=n),f.throwError(e,o.Logger.errors.NUMERIC_FAULT,a)}for(var b="0";b.length<256;)b+=b;function p(e){if("number"!==typeof e)try{e=s.O$.from(e).toNumber()}catch(t){}return"number"===typeof e&&e>=0&&e<=256&&!(e%1)?"1"+b.substring(0,e):f.throwArgumentError("invalid decimal size","decimals",e)}function m(e,t){null==t&&(t=0);var r=p(t),n=(e=s.O$.from(e)).lt(d);n&&(e=e.mul(l));for(var a=e.mod(r).toString();a.length<r.length-1;)a="0"+a;a=a.match(/^([0-9]*[1-9]|0)(0*)/)[1];var i=e.div(r).toString();return e=1===r.length?i:i+"."+a,n&&(e="-"+e),e}function x(e,t){null==t&&(t=0);var r=p(t);"string"===typeof e&&e.match(/^-?[0-9.]+$/)||f.throwArgumentError("invalid decimal value","value",e);var n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&f.throwArgumentError("missing value","value",e);var a=e.split(".");a.length>2&&f.throwArgumentError("too many decimal points","value",e);var i=a[0],o=a[1];for(i||(i="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&h("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<r.length-1;)o+="0";var c=s.O$.from(i),u=s.O$.from(o),d=c.mul(r).add(u);return n&&(d=d.mul(l)),d}var g=function(){function e(t,r,a,i){(0,n.Z)(this,e),t!==u&&f.throwError("cannot use FixedFormat constructor; use FixedFormat.from",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=a,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(a)+"x"+String(i),this._multiplier=p(i),Object.freeze(this)}return(0,a.Z)(e,null,[{key:"from",value:function(t){if(t instanceof e)return t;"number"===typeof t&&(t="fixed128x".concat(t));var r=!0,n=128,a=18;if("string"===typeof t)if("fixed"===t);else if("ufixed"===t)r=!1;else{var i=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||f.throwArgumentError("invalid fixed format","format",t),r="u"!==i[1],n=parseInt(i[2]),a=parseInt(i[3])}else if(t){var o=function(e,r,n){return null==t[e]?n:(typeof t[e]!==r&&f.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e])};r=o("signed","boolean",r),n=o("width","number",n),a=o("decimals","number",a)}return n%8&&f.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),a>80&&f.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",a),new e(u,r,n,a)}}]),e}(),v=function(){function e(t,r,a,i){(0,n.Z)(this,e),t!==u&&f.throwError("cannot use FixedNumber constructor; use FixedNumber.from",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=a,this._isFixedNumber=!0,Object.freeze(this)}return(0,a.Z)(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&f.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t);var r=x(this._value,this.format.decimals),n=x(t._value,t.format.decimals);return e.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t);var r=x(this._value,this.format.decimals),n=x(t._value,t.format.decimals);return e.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t);var r=x(this._value,this.format.decimals),n=x(t._value,t.format.decimals);return e.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t);var r=x(this._value,this.format.decimals),n=x(t._value,t.format.decimals);return e.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(y.toFormat(r.format))),r}},{key:"ceiling",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(y.toFormat(r.format))),r}},{key:"round",value:function(t){null==t&&(t=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(t<0||t>80||t%1)&&f.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;var n=e.from("1"+b.substring(0,t),this.format),a=w.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(a).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex;e%8&&f.throwArgumentError("invalid byte width","width",e);var t=s.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,i.hexZeroPad)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,r,n){return null!=n||null==r||(0,s.Zm)(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),e.fromString(m(t,r),g.from(n))}},{key:"fromString",value:function(t,r){null==r&&(r="fixed");var n=g.from(r),a=x(t,n.decimals);!n.signed&&a.lt(d)&&h("unsigned value cannot be negative","overflow","value",t);var o=null;n.signed?o=a.toTwos(n.width).toHexString():(o=a.toHexString(),o=(0,i.hexZeroPad)(o,n.width/8));var c=m(a,n.decimals);return new e(u,o,c,n)}},{key:"fromBytes",value:function(t,r){null==r&&(r="fixed");var n=g.from(r);if((0,i.arrayify)(t).length>n.width/8)throw new Error("overflow");var a=s.O$.from(t);n.signed&&(a=a.fromTwos(n.width));var o=a.toTwos((n.signed?0:1)+n.width).toHexString(),c=m(a,n.decimals);return new e(u,o,c,n)}},{key:"from",value:function(t,r){if("string"===typeof t)return e.fromString(t,r);if((0,i.isBytes)(t))return e.fromBytes(t,r);try{return e.fromValue(t,0,r)}catch(n){if(n.code!==o.Logger.errors.INVALID_ARGUMENT)throw n}return f.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),y=v.from(1),w=v.from("0.5")},59594:function(e,t,r){"use strict";r.r(t),r.d(t,{BigNumber:function(){return n.O$},FixedFormat:function(){return a.xO},FixedNumber:function(){return a.xs},_base16To36:function(){return n.t2},_base36To16:function(){return n.g$},formatFixed:function(){return a.S5},parseFixed:function(){return a.Ox}});var n=r(2257),a=r(1503)},63244:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(88677).Buffer}catch(_){}function c(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,r){var n=c(e,r);return r-1>=t&&(n|=c(e,r-1)<<4),n}function f(e,t,r,a){for(var i=0,o=0,c=Math.min(e.length,r),s=t;s<c;s++){var f=e.charCodeAt(s)-48;i*=a,o=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&o<a,"Invalid character"),i+=o}return i}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a<e.length&&(16===t?this._parseHex(e,a,r):(this._parseBase(e,t,a),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var i,o,c=0;if("be"===r)for(a=e.length-1,i=0;a>=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(a=0,i=0;a<e.length;a+=3)o=e[a]|e[a+1]<<8|e[a+2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,i=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,s=0,u=r;u<c;u+=n)s=f(e,u,u+n,t),this.imuln(a),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==o){var d=1;for(s=f(e,u,e.length,t),u=0;u<o;u++)d*=t;this.imuln(d),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){u(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(_){i.prototype.inspect=d}else i.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","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"],h=[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],b=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,i=0,o=0;o<this.length;o++){var c=this.words[o],s=(16777215&(c<<a|i)).toString(16);i=c>>>24-a&16777215,(a+=2)>=26&&(a-=26,o--),r=0!==i||o!==this.length-1?l[6-s.length]+s+r:s+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=h[e],u=b[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modrn(u).toString(e);r=(d=d.idivn(u)).isZero()?p+r:l[f-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,s=o/67108864|0;r.words[0]=c;for(var f=1;f<n;f++){for(var u=s>>>26,d=67108863&s,l=Math.min(f,t.length-1),h=Math.max(0,f-e.length+1);h<=l;h++){var b=f-h|0;u+=(o=(a=0|e.words[b])*(i=0|t.words[h])+d)/67108864|0,d=67108863&o}r.words[f]=0|d,s=0|u}return 0!==s?r.words[f]=0|s:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,a),o},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===i?(r<e.length&&(e[r++]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a<t;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<a:this.words[r]&~(1<<a),this._strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&t,a=t>>>26;for(;0!==a&&i<r.length;i++)t=(0|r.words[i])+a,this.words[i]=67108863&t,a=t>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.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 r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)i=(t=(0|r.words[o])-(0|n.words[o])+i)>>26,this.words[o]=67108863&t;for(;0!==i&&o<r.length;o++)i=(t=(0|r.words[o])+i)>>26,this.words[o]=67108863&t;if(0===i&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,a,i,o=e.words,c=t.words,s=r.words,f=0,u=0|o[0],d=8191&u,l=u>>>13,h=0|o[1],b=8191&h,p=h>>>13,m=0|o[2],x=8191&m,g=m>>>13,v=0|o[3],y=8191&v,w=v>>>13,M=0|o[4],k=8191&M,A=M>>>13,I=0|o[5],E=8191&I,S=I>>>13,_=0|o[6],N=8191&_,j=_>>>13,C=0|o[7],T=8191&C,L=C>>>13,D=0|o[8],O=8191&D,P=D>>>13,R=0|o[9],B=8191&R,z=R>>>13,U=0|c[0],Z=8191&U,F=U>>>13,Y=0|c[1],G=8191&Y,H=Y>>>13,W=0|c[2],q=8191&W,Q=W>>>13,V=0|c[3],J=8191&V,K=V>>>13,X=0|c[4],$=8191&X,ee=X>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],se=8191&ce,fe=ce>>>13,ue=0|c[8],de=8191&ue,le=ue>>>13,he=0|c[9],be=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(d,Z))|0)+((8191&(a=(a=Math.imul(d,F))+Math.imul(l,Z)|0))<<13)|0;f=((i=Math.imul(l,F))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(b,Z),a=(a=Math.imul(b,F))+Math.imul(p,Z)|0,i=Math.imul(p,F);var xe=(f+(n=n+Math.imul(d,G)|0)|0)+((8191&(a=(a=a+Math.imul(d,H)|0)+Math.imul(l,G)|0))<<13)|0;f=((i=i+Math.imul(l,H)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,Z),a=(a=Math.imul(x,F))+Math.imul(g,Z)|0,i=Math.imul(g,F),n=n+Math.imul(b,G)|0,a=(a=a+Math.imul(b,H)|0)+Math.imul(p,G)|0,i=i+Math.imul(p,H)|0;var ge=(f+(n=n+Math.imul(d,q)|0)|0)+((8191&(a=(a=a+Math.imul(d,Q)|0)+Math.imul(l,q)|0))<<13)|0;f=((i=i+Math.imul(l,Q)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(y,Z),a=(a=Math.imul(y,F))+Math.imul(w,Z)|0,i=Math.imul(w,F),n=n+Math.imul(x,G)|0,a=(a=a+Math.imul(x,H)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,H)|0,n=n+Math.imul(b,q)|0,a=(a=a+Math.imul(b,Q)|0)+Math.imul(p,q)|0,i=i+Math.imul(p,Q)|0;var ve=(f+(n=n+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,K)|0)+Math.imul(l,J)|0))<<13)|0;f=((i=i+Math.imul(l,K)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(k,Z),a=(a=Math.imul(k,F))+Math.imul(A,Z)|0,i=Math.imul(A,F),n=n+Math.imul(y,G)|0,a=(a=a+Math.imul(y,H)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,H)|0,n=n+Math.imul(x,q)|0,a=(a=a+Math.imul(x,Q)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,Q)|0,n=n+Math.imul(b,J)|0,a=(a=a+Math.imul(b,K)|0)+Math.imul(p,J)|0,i=i+Math.imul(p,K)|0;var ye=(f+(n=n+Math.imul(d,$)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,$)|0))<<13)|0;f=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(E,Z),a=(a=Math.imul(E,F))+Math.imul(S,Z)|0,i=Math.imul(S,F),n=n+Math.imul(k,G)|0,a=(a=a+Math.imul(k,H)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,H)|0,n=n+Math.imul(y,q)|0,a=(a=a+Math.imul(y,Q)|0)+Math.imul(w,q)|0,i=i+Math.imul(w,Q)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,K)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0,n=n+Math.imul(b,$)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(f+(n=n+Math.imul(d,re)|0)|0)+((8191&(a=(a=a+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;f=((i=i+Math.imul(l,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(N,Z),a=(a=Math.imul(N,F))+Math.imul(j,Z)|0,i=Math.imul(j,F),n=n+Math.imul(E,G)|0,a=(a=a+Math.imul(E,H)|0)+Math.imul(S,G)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(k,q)|0,a=(a=a+Math.imul(k,Q)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,Q)|0,n=n+Math.imul(y,J)|0,a=(a=a+Math.imul(y,K)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,K)|0,n=n+Math.imul(x,$)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(b,re)|0,a=(a=a+Math.imul(b,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var Me=(f+(n=n+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(l,ie)|0))<<13)|0;f=((i=i+Math.imul(l,oe)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(T,Z),a=(a=Math.imul(T,F))+Math.imul(L,Z)|0,i=Math.imul(L,F),n=n+Math.imul(N,G)|0,a=(a=a+Math.imul(N,H)|0)+Math.imul(j,G)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(E,q)|0,a=(a=a+Math.imul(E,Q)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,Q)|0,n=n+Math.imul(k,J)|0,a=(a=a+Math.imul(k,K)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(y,$)|0,a=(a=a+Math.imul(y,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(b,ie)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var ke=(f+(n=n+Math.imul(d,se)|0)|0)+((8191&(a=(a=a+Math.imul(d,fe)|0)+Math.imul(l,se)|0))<<13)|0;f=((i=i+Math.imul(l,fe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,Z),a=(a=Math.imul(O,F))+Math.imul(P,Z)|0,i=Math.imul(P,F),n=n+Math.imul(T,G)|0,a=(a=a+Math.imul(T,H)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,H)|0,n=n+Math.imul(N,q)|0,a=(a=a+Math.imul(N,Q)|0)+Math.imul(j,q)|0,i=i+Math.imul(j,Q)|0,n=n+Math.imul(E,J)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(k,$)|0,a=(a=a+Math.imul(k,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,a=(a=a+Math.imul(y,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,oe)|0,n=n+Math.imul(b,se)|0,a=(a=a+Math.imul(b,fe)|0)+Math.imul(p,se)|0,i=i+Math.imul(p,fe)|0;var Ae=(f+(n=n+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;f=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,Z),a=(a=Math.imul(B,F))+Math.imul(z,Z)|0,i=Math.imul(z,F),n=n+Math.imul(O,G)|0,a=(a=a+Math.imul(O,H)|0)+Math.imul(P,G)|0,i=i+Math.imul(P,H)|0,n=n+Math.imul(T,q)|0,a=(a=a+Math.imul(T,Q)|0)+Math.imul(L,q)|0,i=i+Math.imul(L,Q)|0,n=n+Math.imul(N,J)|0,a=(a=a+Math.imul(N,K)|0)+Math.imul(j,J)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(E,$)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(k,re)|0,a=(a=a+Math.imul(k,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(y,ie)|0,a=(a=a+Math.imul(y,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,se)|0,a=(a=a+Math.imul(x,fe)|0)+Math.imul(g,se)|0,i=i+Math.imul(g,fe)|0,n=n+Math.imul(b,de)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(p,de)|0,i=i+Math.imul(p,le)|0;var Ie=(f+(n=n+Math.imul(d,be)|0)|0)+((8191&(a=(a=a+Math.imul(d,pe)|0)+Math.imul(l,be)|0))<<13)|0;f=((i=i+Math.imul(l,pe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,G),a=(a=Math.imul(B,H))+Math.imul(z,G)|0,i=Math.imul(z,H),n=n+Math.imul(O,q)|0,a=(a=a+Math.imul(O,Q)|0)+Math.imul(P,q)|0,i=i+Math.imul(P,Q)|0,n=n+Math.imul(T,J)|0,a=(a=a+Math.imul(T,K)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(N,$)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(E,re)|0,a=(a=a+Math.imul(E,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(k,ie)|0,a=(a=a+Math.imul(k,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,n=n+Math.imul(y,se)|0,a=(a=a+Math.imul(y,fe)|0)+Math.imul(w,se)|0,i=i+Math.imul(w,fe)|0,n=n+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(g,de)|0,i=i+Math.imul(g,le)|0;var Ee=(f+(n=n+Math.imul(b,be)|0)|0)+((8191&(a=(a=a+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;f=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,Q))+Math.imul(z,q)|0,i=Math.imul(z,Q),n=n+Math.imul(O,J)|0,a=(a=a+Math.imul(O,K)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,K)|0,n=n+Math.imul(T,$)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(N,re)|0,a=(a=a+Math.imul(N,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,oe)|0,n=n+Math.imul(k,se)|0,a=(a=a+Math.imul(k,fe)|0)+Math.imul(A,se)|0,i=i+Math.imul(A,fe)|0,n=n+Math.imul(y,de)|0,a=(a=a+Math.imul(y,le)|0)+Math.imul(w,de)|0,i=i+Math.imul(w,le)|0;var Se=(f+(n=n+Math.imul(x,be)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(g,be)|0))<<13)|0;f=((i=i+Math.imul(g,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,J),a=(a=Math.imul(B,K))+Math.imul(z,J)|0,i=Math.imul(z,K),n=n+Math.imul(O,$)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(N,ie)|0,a=(a=a+Math.imul(N,oe)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,oe)|0,n=n+Math.imul(E,se)|0,a=(a=a+Math.imul(E,fe)|0)+Math.imul(S,se)|0,i=i+Math.imul(S,fe)|0,n=n+Math.imul(k,de)|0,a=(a=a+Math.imul(k,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var _e=(f+(n=n+Math.imul(y,be)|0)|0)+((8191&(a=(a=a+Math.imul(y,pe)|0)+Math.imul(w,be)|0))<<13)|0;f=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,$),a=(a=Math.imul(B,ee))+Math.imul(z,$)|0,i=Math.imul(z,ee),n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(N,se)|0,a=(a=a+Math.imul(N,fe)|0)+Math.imul(j,se)|0,i=i+Math.imul(j,fe)|0,n=n+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,le)|0;var Ne=(f+(n=n+Math.imul(k,be)|0)|0)+((8191&(a=(a=a+Math.imul(k,pe)|0)+Math.imul(A,be)|0))<<13)|0;f=((i=i+Math.imul(A,pe)|0)+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,re),a=(a=Math.imul(B,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(T,se)|0,a=(a=a+Math.imul(T,fe)|0)+Math.imul(L,se)|0,i=i+Math.imul(L,fe)|0,n=n+Math.imul(N,de)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,le)|0;var je=(f+(n=n+Math.imul(E,be)|0)|0)+((8191&(a=(a=a+Math.imul(E,pe)|0)+Math.imul(S,be)|0))<<13)|0;f=((i=i+Math.imul(S,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(B,ie),a=(a=Math.imul(B,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(O,se)|0,a=(a=a+Math.imul(O,fe)|0)+Math.imul(P,se)|0,i=i+Math.imul(P,fe)|0,n=n+Math.imul(T,de)|0,a=(a=a+Math.imul(T,le)|0)+Math.imul(L,de)|0,i=i+Math.imul(L,le)|0;var Ce=(f+(n=n+Math.imul(N,be)|0)|0)+((8191&(a=(a=a+Math.imul(N,pe)|0)+Math.imul(j,be)|0))<<13)|0;f=((i=i+Math.imul(j,pe)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,se),a=(a=Math.imul(B,fe))+Math.imul(z,se)|0,i=Math.imul(z,fe),n=n+Math.imul(O,de)|0,a=(a=a+Math.imul(O,le)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,le)|0;var Te=(f+(n=n+Math.imul(T,be)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(L,be)|0))<<13)|0;f=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,de),a=(a=Math.imul(B,le))+Math.imul(z,de)|0,i=Math.imul(z,le);var Le=(f+(n=n+Math.imul(O,be)|0)|0)+((8191&(a=(a=a+Math.imul(O,pe)|0)+Math.imul(P,be)|0))<<13)|0;f=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(Le>>>26)|0,Le&=67108863;var De=(f+(n=Math.imul(B,be))|0)+((8191&(a=(a=Math.imul(B,pe))+Math.imul(z,be)|0))<<13)|0;return f=((i=Math.imul(z,pe))+(a>>>13)|0)+(De>>>26)|0,De&=67108863,s[0]=me,s[1]=xe,s[2]=ge,s[3]=ve,s[4]=ye,s[5]=we,s[6]=Me,s[7]=ke,s[8]=Ae,s[9]=Ie,s[10]=Ee,s[11]=Se,s[12]=_e,s[13]=Ne,s[14]=je,s[15]=Ce,s[16]=Te,s[17]=Le,s[18]=De,0!==f&&(s[19]=f,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var o=a;a=0;for(var c=67108863&n,s=Math.min(i,t.length-1),f=Math.max(0,i-e.length+1);f<=s;f++){var u=i-f,d=(0|e.words[u])*(0|t.words[f]),l=67108863&d;c=67108863&(l=l+c|0),a+=(o=(o=o+(d/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function g(e,t,r){return x(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?x(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,a=0;a<t;a++)n|=(1&e)<<t-a-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o<i;o++)n[o]=t[e[o]],a[o]=r[e[o]]},v.prototype.transform=function(e,t,r,n,a,i){this.permute(i,e,t,r,n,a);for(var o=1;o<a;o<<=1)for(var c=o<<1,s=Math.cos(2*Math.PI/c),f=Math.sin(2*Math.PI/c),u=0;u<a;u+=c)for(var d=s,l=f,h=0;h<o;h++){var b=r[u+h],p=n[u+h],m=r[u+h+o],x=n[u+h+o],g=d*m-l*x;x=d*x+l*m,m=g,r[u+h]=b+m,n[u+h]=p+x,r[u+h+o]=b-m,n[u+h+o]=p-x,h!==c&&(g=s*d-f*l,l=s*l+f*d,d=g)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=e[n];e[n]=e[r-n-1],e[r-n-1]=a,a=t[n],t[n]=-t[r-n-1],t[r-n-1]=-a}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var a=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&a,r=a<67108864?0:a/67108864|0}return e},v.prototype.convert13b=function(e,t,r,a){for(var i=0,o=0;o<t;o++)i+=0|e[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o<a;++o)r[o]=0;n(0===i),n(0===(-8192&i))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),a=this.makeRBT(n),i=this.stub(n),o=new Array(n),c=new Array(n),s=new Array(n),f=new Array(n),u=new Array(n),d=new Array(n),l=r.words;l.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,f,n),this.transform(o,i,c,s,n,a),this.transform(f,i,u,d,n,a);for(var h=0;h<n;h++){var b=c[h]*u[h]-s[h]*d[h];s[h]=c[h]*d[h]+s[h]*u[h],c[h]=b}return this.conjugate(c,s,n),this.transform(c,s,l,i,n,a),this.conjugate(l,i,n),this.normalize13b(l,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"===typeof e),n(e<67108864);for(var r=0,a=0;a<this.length;a++){var i=(0|this.words[a])*e,o=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=o>>>26,this.words[a]=67108863&o}return 0!==r&&(this.words[a]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,a=r%26;t[r]=e.words[n]>>>a&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,a=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var c=this.words[t]&i,s=(0|this.words[t])-c<<r;this.words[t]=s|o,o=c>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t<a;t++)this.words[t]=0;this.length+=a}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var a;n("number"===typeof e&&e>=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<<i,s=r;if(a-=o,a=Math.max(0,a),s){for(var f=0;f<o;f++)s.words[f]=this.words[f];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;var u=0;for(f=this.length-1;f>=0&&(0!==u||f>=a);f--){var d=0|this.words[f];this.words[f]=u<<26-i|d>>>i,u=d&c}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<<t;return!(this.length<=r)&&!!(this.words[r]&a)},i.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<<t;this.words[this.length-1]&=a}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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},i.prototype.isubn=function(e){if(n("number"===typeof e),n(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var a,i,o=e.length+r;this._expand(o);var c=0;for(a=0;a<e.length;a++){i=(0|this.words[a+r])+c;var s=(0|e.words[a])*t;c=((i-=67108863&s)>>26)-(s/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)c=(i=(0|this.words[a+r])+c)>>26,this.words[a+r]=67108863&i;if(0===c)return this._strip();for(n(-1===c),c=0,a=0;a<this.length;a++)c=(i=-(0|this.words[a])+c)>>26,this.words[a]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var c,s=n.length-a.length;if("mod"!==t){(c=new i(null)).length=s+1,c.words=new Array(c.length);for(var f=0;f<c.length;f++)c.words[f]=0}var u=n.clone()._ishlnsubmul(a,1,s);0===u.negative&&(n=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var l=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(a,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);c&&(c.words[d]=l)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(a=c.div.neg()),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(a=c.div.neg()),{div:a,mod:c.mod}):0!==(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:c.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,c},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,a=0,i=this.length-1;i>=0;i--)a=(r*a+(0|this.words[i]))%e;return t?-a:a},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,a=this.length-1;a>=0;a--){var i=(0|this.words[a])+67108864*r;this.words[a]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),c=new i(0),s=new i(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0===(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var b=0,p=1;0===(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(c.isOdd()||s.isOdd())&&(c.iadd(u),s.isub(d)),c.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(c),o.isub(s)):(r.isub(t),c.isub(a),s.isub(o))}return{a:c,b:s,gcd:r.iushln(f)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),c=new i(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0===(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var d=0,l=1;0===(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)c.isOdd()&&c.iadd(s),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(c)):(r.isub(t),c.isub(o))}return(a=0===t.cmpn(1)?o:c).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,a=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,o=r;0!==i&&o<this.length;o++){var c=0|this.words[o];i=(c+=i)>>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:a<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){n<a?t=-1:n>a&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},a(M,w),M.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a<n;a++)t.words[a]=e.words[a];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,a=10;a<e.length;a++){var o=0|e.words[a];e.words[a-10]=(o&r)<<4|i>>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(k,w),a(A,w),a(I,w),I.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,a=67108863&n;n>>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new k;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return y[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var c=new i(1).toRed(this),s=c.redNeg(),f=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,f).cmp(s);)u.redIAdd(s);for(var d=this.pow(u,a),l=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),b=o;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();n(m<b);var x=this.pow(d,new i(1).iushln(b-m-1));l=l.redMul(x),d=x.redSqr(),h=h.redMul(d),b=m}return l},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,c=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],u=s-1;u>=0;u--){var d=f>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++c||0===n&&0===u)&&(a=this.mul(a,r[o]),c=0,o=0)):c=0}s=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},a(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},49716:function(e,t,r){"use strict";r.r(t),r.d(t,{arrayify:function(){return f},concat:function(){return u},hexConcat:function(){return g},hexDataLength:function(){return m},hexDataSlice:function(){return x},hexStripZeros:function(){return y},hexValue:function(){return v},hexZeroPad:function(){return w},hexlify:function(){return p},isBytes:function(){return s},isBytesLike:function(){return o},isHexString:function(){return h},joinSignature:function(){return k},splitSignature:function(){return M},stripZeros:function(){return d},zeroPad:function(){return l}});var n=new(r(39502).Logger)("bytes/5.7.0");function a(e){return!!e.toHexString}function i(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return i(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function o(e){return h(e)&&!(e.length%2)||s(e)}function c(e){return"number"===typeof e&&e==e&&e%1===0}function s(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!c(e.length)||e.length<0)return!1;for(var t=0;t<e.length;t++){var r=e[t];if(!c(r)||r<0||r>=256)return!1}return!0}function f(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid arrayify value");for(var r=[];e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),i(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e)&&(e=e.toHexString()),h(e)){var o=e.substring(2);o.length%2&&("left"===t.hexPad?o="0"+o:"right"===t.hexPad?o+="0":n.throwArgumentError("hex data is odd-length","value",e));for(var c=[],f=0;f<o.length;f+=2)c.push(parseInt(o.substring(f,f+2),16));return i(new Uint8Array(c))}return s(e)?i(new Uint8Array(e)):n.throwArgumentError("invalid arrayify value","value",e)}function u(e){var t=e.map((function(e){return f(e)})),r=t.reduce((function(e,t){return e+t.length}),0),n=new Uint8Array(r);return t.reduce((function(e,t){return n.set(t,e),e+t.length}),0),i(n)}function d(e){var t=f(e);if(0===t.length)return t;for(var r=0;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function l(e,t){(e=f(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(t);return r.set(e,t-e.length),i(r)}function h(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var b="0123456789abcdef";function p(e,t){if(t||(t={}),"number"===typeof e){n.checkSafeUint53(e,"invalid hexlify value");for(var r="";e;)r=b[15&e]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"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),a(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(s(e)){for(var i="0x",o=0;o<e.length;o++){var c=e[o];i+=b[(240&c)>>4]+b[15&c]}return i}return n.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!==typeof e)e=p(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2}function x(e,t,r){return"string"!==typeof e?e=p(e):(!h(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function g(e){var t="0x";return e.forEach((function(e){t+=p(e).substring(2)})),t}function v(e){var t=y(p(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function y(e){"string"!==typeof e&&(e=p(e)),h(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);for(var t=0;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function w(e,t){for("string"!==typeof e?e=p(e):h(e)||n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function M(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(o(e)){var r=f(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64))):65===r.length?(t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=p(r.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 a=l(f(t._vs),32);t._vs=p(a);var i=a[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),a[0]&=127;var c=p(a);null==t.s?t.s=c:t.s!==c&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.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 s=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==s&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&h(t.r)?t.r=w(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&h(t.s)?t.s=w(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);var u=f(t.s);u[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(u[0]|=128);var d=p(u);t._vs&&(h(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=w(t._vs,32)),null==t._vs?t._vs=d:t._vs!==d&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function k(e){return p(u([(e=M(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},68624:function(e,t,r){"use strict";r.d(t,{d:function(){return n}});var n="0x0000000000000000000000000000000000000000"},75422:function(e,t,r){"use strict";r.d(t,{$B:function(){return u},Bz:function(){return f},Ce:function(){return s},PS:function(){return d},Py:function(){return c},_Y:function(){return i},fh:function(){return o},tL:function(){return a}});var n=r(2257),a=n.O$.from(-1),i=n.O$.from(0),o=n.O$.from(1),c=n.O$.from(2),s=n.O$.from("1000000000000000000"),f=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),u=n.O$.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),d=n.O$.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},84867:function(e,t,r){"use strict";r.d(t,{R:function(){return n}});var n="0x0000000000000000000000000000000000000000000000000000000000000000"},58593:function(e,t,r){"use strict";r.r(t),r.d(t,{AddressZero:function(){return n.d},EtherSymbol:function(){return o},HashZero:function(){return i.R},MaxInt256:function(){return a.PS},MaxUint256:function(){return a.Bz},MinInt256:function(){return a.$B},NegativeOne:function(){return a.tL},One:function(){return a.fh},Two:function(){return a.Py},WeiPerEther:function(){return a.Ce},Zero:function(){return a._Y}});var n=r(68624),a=r(75422),i=r(84867),o="\u039e"},34029:function(e,t,r){"use strict";r.r(t),r.d(t,{BaseContract:function(){return P},Contract:function(){return R},ContractFactory:function(){return B}});var n=r(35531),a=r(6148),i=r(44474),o=r(53538),c=r(81020),s=r(18992),f=r(27853),u=r(84531),d=r(27166),l=r(73198),h=r(17303),b=r(69745),p=r(68408),m=r(97419),x=r(2257),g=r(49716),v=r(30520),y=r(25452),w=r(39502),M=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},k=new w.Logger("contracts/5.7.0"),A={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function I(e,t){return M(this,void 0,void 0,(0,d.Z)().mark((function r(){var n,a;return(0,d.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t;case 2:return"string"!==typeof(n=r.sent)&&k.throwArgumentError("invalid address or ENS name","name",n),r.prev=4,r.abrupt("return",(0,m.getAddress)(n));case 8:r.prev=8,r.t0=r.catch(4);case 10:return e||k.throwError("a provider or signer is needed to resolve ENS names",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),r.next=13,e.resolveName(n);case 13:return null==(a=r.sent)&&k.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r.abrupt("return",a);case 16:case"end":return r.stop()}}),r,null,[[4,8]])})))}function E(e,t,r){return M(this,void 0,void 0,(0,d.Z)().mark((function n(){return(0,d.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=4;break}return n.next=3,Promise.all(r.map((function(r,n){return E(e,Array.isArray(t)?t[n]:t[r.name],r)})));case 3:case 7:case 11:case 17:return n.abrupt("return",n.sent);case 4:if("address"!==r.type){n.next=8;break}return n.next=7,I(e,t);case 8:if("tuple"!==r.type){n.next=12;break}return n.next=11,E(e,t,r.components);case 12:if("array"!==r.baseType){n.next=18;break}if(Array.isArray(t)){n.next=15;break}return n.abrupt("return",Promise.reject(k.makeError("invalid value for array",w.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})));case 15:return n.next=17,Promise.all(t.map((function(t){return E(e,t,r.arrayChildren)})));case 18:return n.abrupt("return",t);case 19:case"end":return n.stop()}}),n)})))}function S(e,t,r){return M(this,void 0,void 0,(0,d.Z)().mark((function n(){var a,i,o,c,s,f,u,l,h,b,p=this;return(0,d.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a={},r.length===t.inputs.length+1&&"object"===typeof r[r.length-1]&&(a=(0,v.shallowCopy)(r.pop())),k.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?a.from?a.from=(0,v.resolveProperties)({override:I(e.signer,a.from),signer:e.signer.getAddress()}).then((function(e){return M(p,void 0,void 0,(0,d.Z)().mark((function t(){return(0,d.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(0,m.getAddress)(e.signer)!==e.override&&k.throwError("Contract with a Signer cannot override from",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.abrupt("return",e.override);case 2:case"end":return t.stop()}}),t)})))})):a.from=e.signer.getAddress():a.from&&(a.from=I(e.provider,a.from)),n.next=6,(0,v.resolveProperties)({args:E(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,v.resolveProperties)(a)||{}});case 6:if(i=n.sent,o=e.interface.encodeFunctionData(t,i.args),c={data:o,to:i.address},null!=(s=i.overrides).nonce&&(c.nonce=x.O$.from(s.nonce).toNumber()),null!=s.gasLimit&&(c.gasLimit=x.O$.from(s.gasLimit)),null!=s.gasPrice&&(c.gasPrice=x.O$.from(s.gasPrice)),null!=s.maxFeePerGas&&(c.maxFeePerGas=x.O$.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(c.maxPriorityFeePerGas=x.O$.from(s.maxPriorityFeePerGas)),null!=s.from&&(c.from=s.from),null!=s.type&&(c.type=s.type),null!=s.accessList&&(c.accessList=(0,y.accessListify)(s.accessList)),null==c.gasLimit&&null!=t.gas){for(f=21e3,u=(0,g.arrayify)(o),l=0;l<u.length;l++)f+=4,u[l]&&(f+=64);c.gasLimit=x.O$.from(t.gas).add(f)}return s.value&&((h=x.O$.from(s.value)).isZero()||t.payable||k.throwError("non-payable method cannot override value",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:a.value}),c.value=h),s.customData&&(c.customData=(0,v.shallowCopy)(s.customData)),s.ccipReadEnabled&&(c.ccipReadEnabled=!!s.ccipReadEnabled),delete a.nonce,delete a.gasLimit,delete a.gasPrice,delete a.from,delete a.value,delete a.type,delete a.accessList,delete a.maxFeePerGas,delete a.maxPriorityFeePerGas,delete a.customData,delete a.ccipReadEnabled,(b=Object.keys(a).filter((function(e){return null!=a[e]}))).length&&k.throwError("cannot override ".concat(b.map((function(e){return JSON.stringify(e)})).join(",")),w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:b}),n.abrupt("return",c);case 36:case"end":return n.stop()}}),n)})))}function _(e,t){var r=t.wait.bind(t);t.wait=function(t){return r(t).then((function(t){return t.events=t.logs.map((function(r){var n=(0,v.deepCopy)(r),a=null;try{a=e.interface.parseLog(r)}catch(i){}return a&&(n.args=a.args,n.decode=function(t,r){return e.interface.decodeEventLog(a.eventFragment,t,r)},n.event=a.name,n.eventSignature=a.signature),n.removeListener=function(){return e.provider},n.getBlock=function(){return e.provider.getBlock(t.blockHash)},n.getTransaction=function(){return e.provider.getTransaction(t.transactionHash)},n.getTransactionReceipt=function(){return Promise.resolve(t)},n})),t}))}}function N(e,t,r){var n=e.signer||e.provider;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return M(this,void 0,void 0,(0,d.Z)().mark((function a(){var o,c,s,f,u;return(0,d.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(o=void 0,i.length!==t.inputs.length+1||"object"!==typeof i[i.length-1]){a.next=9;break}if(null==(c=(0,v.shallowCopy)(i.pop())).blockTag){a.next=7;break}return a.next=6,c.blockTag;case 6:o=a.sent;case 7:delete c.blockTag,i.push(c);case 9:if(null==e.deployTransaction){a.next=12;break}return a.next=12,e._deployed(o);case 12:return a.next=14,S(e,t,i);case 14:return s=a.sent,a.next=17,n.call(s,o);case 17:return f=a.sent,a.prev=18,u=e.interface.decodeFunctionResult(t,f),r&&1===t.outputs.length&&(u=u[0]),a.abrupt("return",u);case 24:throw a.prev=24,a.t0=a.catch(18),a.t0.code===w.Logger.errors.CALL_EXCEPTION&&(a.t0.address=e.address,a.t0.args=i,a.t0.transaction=s),a.t0;case 28:case"end":return a.stop()}}),a,null,[[18,24]])})))}}function j(e,t,r){return t.constant?N(e,t,r):function(e,t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return M(this,void 0,void 0,(0,d.Z)().mark((function r(){var a,i;return(0,d.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.signer||k.throwError("sending a transaction requires a signer",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null==e.deployTransaction){r.next=4;break}return r.next=4,e._deployed();case 4:return r.next=6,S(e,t,n);case 6:return a=r.sent,r.next=9,e.signer.sendTransaction(a);case 9:return i=r.sent,_(e,i),r.abrupt("return",i);case 12:case"end":return r.stop()}}),r)})))}}(e,t)}function C(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((function(e){return Array.isArray(e)?e.join("|"):e})).join(":"):""):"*"}var T=function(){function e(t,r){(0,f.Z)(this,e),(0,v.defineReadOnly)(this,"tag",t),(0,v.defineReadOnly)(this,"filter",r),this._listeners=[]}return(0,u.Z)(e,[{key:"addListener",value:function(e,t){this._listeners.push({listener:e,once:t})}},{key:"removeListener",value:function(e){var t=!1;this._listeners=this._listeners.filter((function(r){return!(!t&&r.listener===e)||(t=!0,!1)}))}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"listeners",value:function(){return this._listeners.map((function(e){return e.listener}))}},{key:"listenerCount",value:function(){return this._listeners.length}},{key:"run",value:function(e){var t=this,r=this.listenerCount();return this._listeners=this._listeners.filter((function(r){var n=e.slice();return setTimeout((function(){r.listener.apply(t,n)}),0),!r.once})),r}},{key:"prepareEvent",value:function(e){}},{key:"getEmit",value:function(e){return[e]}}]),e}(),L=function(e){(0,c.Z)(r,e);var t=(0,s.Z)(r);function r(){return(0,f.Z)(this,r),t.call(this,"error",null)}return(0,u.Z)(r)}(T),D=function(e){(0,c.Z)(r,e);var t=(0,s.Z)(r);function r(e,n,i,o){var c;(0,f.Z)(this,r);var s={address:e},u=n.getEventTopic(i);return o?(u!==o[0]&&k.throwArgumentError("topic mismatch","topics",o),s.topics=o.slice()):s.topics=[u],c=t.call(this,C(s),s),(0,v.defineReadOnly)((0,a.Z)(c),"address",e),(0,v.defineReadOnly)((0,a.Z)(c),"interface",n),(0,v.defineReadOnly)((0,a.Z)(c),"fragment",i),c}return(0,u.Z)(r,[{key:"prepareEvent",value:function(e){var t=this;(0,i.Z)((0,o.Z)(r.prototype),"prepareEvent",this).call(this,e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=function(e,r){return t.interface.decodeEventLog(t.fragment,e,r)};try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(n){e.args=null,e.decodeError=n}}},{key:"getEmit",value:function(e){var t=(0,l.BR)(e.args);if(t.length)throw t[0].error;var r=(e.args||[]).slice();return r.push(e),r}}]),r}(T),O=function(e){(0,c.Z)(r,e);var t=(0,s.Z)(r);function r(e,n){var i;return(0,f.Z)(this,r),i=t.call(this,"*",{address:e}),(0,v.defineReadOnly)((0,a.Z)(i),"address",e),(0,v.defineReadOnly)((0,a.Z)(i),"interface",n),i}return(0,u.Z)(r,[{key:"prepareEvent",value:function(e){var t=this;(0,i.Z)((0,o.Z)(r.prototype),"prepareEvent",this).call(this,e);try{var n=this.interface.parseLog(e);e.event=n.name,e.eventSignature=n.signature,e.decode=function(e,r){return t.interface.decodeEventLog(n.eventFragment,e,r)},e.args=n.args}catch(a){}}}]),r}(T),P=function(){function e(t,r,n){var a=this;(0,f.Z)(this,e),(0,v.defineReadOnly)(this,"interface",(0,v.getStatic)(this instanceof e?this.constructor:void 0,"getInterface")(r)),null==n?((0,v.defineReadOnly)(this,"provider",null),(0,v.defineReadOnly)(this,"signer",null)):p.Signer.isSigner(n)?((0,v.defineReadOnly)(this,"provider",n.provider||null),(0,v.defineReadOnly)(this,"signer",n)):b.zt.isProvider(n)?((0,v.defineReadOnly)(this,"provider",n),(0,v.defineReadOnly)(this,"signer",null)):k.throwArgumentError("invalid signer or provider","signerOrProvider",n),(0,v.defineReadOnly)(this,"callStatic",{}),(0,v.defineReadOnly)(this,"estimateGas",{}),(0,v.defineReadOnly)(this,"functions",{}),(0,v.defineReadOnly)(this,"populateTransaction",{}),(0,v.defineReadOnly)(this,"filters",{});var i={};if(Object.keys(this.interface.events).forEach((function(e){var t=a.interface.events[e];(0,v.defineReadOnly)(a.filters,e,(function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return{address:a.address,topics:a.interface.encodeFilterTopics(t,r)}})),i[t.name]||(i[t.name]=[]),i[t.name].push(e)})),Object.keys(i).forEach((function(e){var t=i[e];1===t.length?(0,v.defineReadOnly)(a.filters,e,a.filters[t[0]]):k.warn("Duplicate definition of ".concat(e," (").concat(t.join(", "),")"))})),(0,v.defineReadOnly)(this,"_runningEvents",{}),(0,v.defineReadOnly)(this,"_wrappedEmits",{}),null==t&&k.throwArgumentError("invalid contract address or ENS name","addressOrName",t),(0,v.defineReadOnly)(this,"address",t),this.provider)(0,v.defineReadOnly)(this,"resolvedAddress",I(this.provider,t));else try{(0,v.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,m.getAddress)(t)))}catch(s){k.throwError("provider is required to use ENS name as contract address",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((function(e){}));var o={},c={};Object.keys(this.interface.functions).forEach((function(e){var t=a.interface.functions[e];if(c[e])k.warn("Duplicate ABI entry for ".concat(JSON.stringify(e)));else{c[e]=!0;var r=t.name;o["%".concat(r)]||(o["%".concat(r)]=[]),o["%".concat(r)].push(e),null==a[e]&&(0,v.defineReadOnly)(a,e,j(a,t,!0)),null==a.functions[e]&&(0,v.defineReadOnly)(a.functions,e,j(a,t,!1)),null==a.callStatic[e]&&(0,v.defineReadOnly)(a.callStatic,e,N(a,t,!0)),null==a.populateTransaction[e]&&(0,v.defineReadOnly)(a.populateTransaction,e,function(e,t){return function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return S(e,t,n)}}(a,t)),null==a.estimateGas[e]&&(0,v.defineReadOnly)(a.estimateGas,e,function(e,t){var r=e.signer||e.provider;return function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return M(this,void 0,void 0,(0,d.Z)().mark((function n(){var i;return(0,d.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r||k.throwError("estimate require a provider or signer",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),n.next=3,S(e,t,a);case 3:return i=n.sent,n.next=6,r.estimateGas(i);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))}}(a,t))}})),Object.keys(o).forEach((function(e){var t=o[e];if(!(t.length>1)){e=e.substring(1);var r=t[0];try{null==a[e]&&(0,v.defineReadOnly)(a,e,a[r])}catch(n){}null==a.functions[e]&&(0,v.defineReadOnly)(a.functions,e,a.functions[r]),null==a.callStatic[e]&&(0,v.defineReadOnly)(a.callStatic,e,a.callStatic[r]),null==a.populateTransaction[e]&&(0,v.defineReadOnly)(a.populateTransaction,e,a.populateTransaction[r]),null==a.estimateGas[e]&&(0,v.defineReadOnly)(a.estimateGas,e,a.estimateGas[r])}}))}return(0,u.Z)(e,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(e){var t=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return t})):this._deployedPromise=this.provider.getCode(this.address,e).then((function(e){return"0x"===e&&k.throwError("contract not deployed",w.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this;this.signer||k.throwError("sending a transactions require a signer",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=(0,v.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=r[e]&&k.throwError("cannot override "+e,w.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),r.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(r)}))}},{key:"connect",value:function(e){"string"===typeof e&&(e=new p.VoidSigner(e,this.provider));var t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,v.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}},{key:"attach",value:function(e){return new this.constructor(e,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}},{key:"_getRunningEvent",value:function(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new L);if("event"===e)return this._normalizeRunningEvent(new T("event",null));if("*"===e)return this._normalizeRunningEvent(new O(this.address,this.interface));var t=this.interface.getEvent(e);return this._normalizeRunningEvent(new D(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var r=e.topics[0];if("string"!==typeof r)throw new Error("invalid topic");var n=this.interface.getEvent(r);return this._normalizeRunningEvent(new D(this.address,this.interface,n,e.topics))}catch(i){}var a={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new T(C(a),a))}return this._normalizeRunningEvent(new O(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];var t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}},{key:"_wrapEvent",value:function(e,t,r){var n=this,a=(0,v.deepCopy)(t);return a.removeListener=function(){r&&(e.removeListener(r),n._checkRunningEvents(e))},a.getBlock=function(){return n.provider.getBlock(t.blockHash)},a.getTransaction=function(){return n.provider.getTransaction(t.transactionHash)},a.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(a),a}},{key:"_addEventListener",value:function(e,t,r){var a=this;if(this.provider||k.throwError("events require a provider or a signer with a provider",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var i=function(r){var i=a._wrapEvent(e,r,t);if(null==i.decodeError)try{var o=e.getEmit(i);a.emit.apply(a,[e.filter].concat((0,n.Z)(o)))}catch(c){i.decodeError=c.error}null!=e.filter&&a.emit("event",i),null!=i.decodeError&&a.emit("error",i.decodeError,i)};this._wrappedEmits[e.tag]=i,null!=e.filter&&this.provider.on(e.filter,i)}}},{key:"queryFilter",value:function(e,t,r){var n=this,a=this._getRunningEvent(e),i=(0,v.shallowCopy)(a.filter);return"string"===typeof t&&(0,g.isHexString)(t,32)?(null!=r&&k.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((function(e){return e.map((function(e){return n._wrapEvent(a,e,null)}))}))}},{key:"on",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}},{key:"once",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}},{key:"emit",value:function(e){if(!this.provider)return!1;for(var t=this._getRunningEvent(e),r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];var i=t.run(n)>0;return this._checkRunningEvents(t),i}},{key:"listenerCount",value:function(e){var t=this;return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,r){return e+t._runningEvents[r].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){var t=this;if(!this.provider)return[];if(null==e){var r=function(){var e=[];for(var r in t._runningEvents)t._runningEvents[r].listeners().forEach((function(t){e.push(t)}));return{v:e}}();if("object"===typeof r)return r.v}return this._getRunningEvent(e).listeners()}},{key:"removeAllListeners",value:function(e){if(!this.provider)return this;if(null==e){for(var t in this._runningEvents){var r=this._runningEvents[t];r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(e);return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(e,t){if(!this.provider)return this;var r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return(0,m.getContractAddress)(e)}},{key:"getInterface",value:function(e){return h.vU.isInterface(e)?e:new h.vU(e)}},{key:"isIndexed",value:function(e){return h.Hk.isIndexed(e)}}]),e}(),R=function(e){(0,c.Z)(r,e);var t=(0,s.Z)(r);function r(){return(0,f.Z)(this,r),t.apply(this,arguments)}return(0,u.Z)(r)}(P),B=function(){function e(t,r,n){(0,f.Z)(this,e);var a=null;"0x"!==(a="string"===typeof r?r:(0,g.isBytes)(r)?(0,g.hexlify)(r):r&&"string"===typeof r.object?r.object:"!").substring(0,2)&&(a="0x"+a),(!(0,g.isHexString)(a)||a.length%2)&&k.throwArgumentError("invalid bytecode","bytecode",r),n&&!p.Signer.isSigner(n)&&k.throwArgumentError("invalid signer","signer",n),(0,v.defineReadOnly)(this,"bytecode",a),(0,v.defineReadOnly)(this,"interface",(0,v.getStatic)(this instanceof e?this.constructor:void 0,"getInterface")(t)),(0,v.defineReadOnly)(this,"signer",n||null)}return(0,u.Z)(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length===this.interface.deploy.inputs.length+1&&"object"===typeof r[r.length-1])for(var a in e=(0,v.shallowCopy)(r.pop()))if(!A[a])throw new Error("unknown transaction override "+a);if(["data","from","to"].forEach((function(t){null!=e[t]&&k.throwError("cannot override "+t,w.Logger.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.value){var i=x.O$.from(e.value);i.isZero()||this.interface.deploy.payable||k.throwError("non-payable constructor cannot override value",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})}return k.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=(0,g.hexlify)((0,g.concat)([this.bytecode,this.interface.encodeDeploy(r)])),e}},{key:"deploy",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return M(this,void 0,void 0,(0,d.Z)().mark((function e(){var r,a,i,o,c,s;return(0,d.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={},t.length===this.interface.deploy.inputs.length+1&&(r=t.pop()),k.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),e.next=5,E(this.signer,t,this.interface.deploy.inputs);case 5:return(a=e.sent).push(r),i=this.getDeployTransaction.apply(this,(0,n.Z)(a)),e.next=10,this.signer.sendTransaction(i);case 10:return o=e.sent,c=(0,v.getStatic)(this.constructor,"getContractAddress")(o),_(s=(0,v.getStatic)(this.constructor,"getContract")(c,this.interface,this.signer),o),(0,v.defineReadOnly)(s,"deployTransaction",o),e.abrupt("return",s);case 16:case"end":return e.stop()}}),e,this)})))}},{key:"attach",value:function(e){return this.constructor.getContract(e,this.interface,this.signer)}},{key:"connect",value:function(e){return new this.constructor(this.interface,this.bytecode,e)}}],[{key:"fromSolidity",value:function(e,t){null==e&&k.throwError("missing compiler output",w.Logger.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"===typeof e&&(e=JSON.parse(e));var r=e.abi,n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}},{key:"getInterface",value:function(e){return R.getInterface(e)}},{key:"getContractAddress",value:function(e){return(0,m.getContractAddress)(e)}},{key:"getContract",value:function(e,t,r){return new R(e,t,r)}}]),e}()},49366:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="hash/5.7.0"},51583:function(e,t,r){"use strict";r.d(t,{id:function(){return i}});var n=r(88062),a=r(83374);function i(e){return(0,n.keccak256)((0,a.Y0)(e))}},81049:function(e,t,r){"use strict";r.r(t),r.d(t,{_TypedDataEncoder:function(){return o.E},dnsEncode:function(){return a.Kn},ensNormalize:function(){return a.w3},hashMessage:function(){return i.r},id:function(){return n.id},isValidName:function(){return a.r1},messagePrefix:function(){return i.B},namehash:function(){return a.VM}});var n=r(51583),a=r(95235),i=r(2273),o=r(35992)},2273:function(e,t,r){"use strict";r.d(t,{B:function(){return o},r:function(){return c}});var n=r(49716),a=r(88062),i=r(83374),o="\x19Ethereum Signed Message:\n";function c(e){return"string"===typeof e&&(e=(0,i.Y0)(e)),(0,a.keccak256)((0,n.concat)([(0,i.Y0)(o),(0,i.Y0)(String(e.length)),e]))}},95235:function(e,t,r){"use strict";r.d(t,{Kn:function(){return P},w3:function(){return L},r1:function(){return D},VM:function(){return O}});var n=r(49716),a=r(83374),i=r(88062),o=r(39502),c=r(49366),s=r(35531),f=r(89472);function u(e,t){null==t&&(t=1);var r=[],n=r.forEach;return function e(t,a){n.call(t,(function(t){a>0&&Array.isArray(t)?e(t,a-1):r.push(t)}))}(e,t),r}function d(e){return function(e){var t=0;return function(){return e[t++]}}(function(e){var t=0;function r(){return e[t++]<<8|e[t++]}for(var n=r(),a=1,i=[0,1],o=1;o<n;o++)i.push(a+=r());var c=r(),s=t;t+=c;var f=0,u=0;function d(){return 0==f&&(u=u<<8|e[t++],f=8),u>>--f&1}for(var l=Math.pow(2,31),h=l>>>1,b=h>>1,p=l-1,m=0,x=0;x<31;x++)m=m<<1|d();for(var g=[],v=0,y=l;;){for(var w=Math.floor(((m-v+1)*a-1)/y),M=0,k=n;k-M>1;){var A=M+k>>>1;w<i[A]?k=A:M=A}if(0==M)break;g.push(M);for(var I=v+Math.floor(y*i[M]/a),E=v+Math.floor(y*i[M+1]/a)-1;0==((I^E)&h);)m=m<<1&p|d(),I=I<<1&p,E=E<<1&p|1;for(;I&~E&b;)m=m&h|m<<1&p>>>1|d(),I=I<<1^h,E=(E^h)<<1|h|1;v=I,y=1+E-I}var S=n-4;return g.map((function(t){switch(t-S){case 3:return S+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return S+256+(e[s++]<<8|e[s++]);case 1:return S+e[s++];default:return t-1}}))}(e))}function l(e){return 1&e?~e>>1:e>>1}function h(e,t){for(var r=Array(e),n=0,a=-1;n<e;n++)r[n]=a+=1+t();return r}function b(e,t){for(var r=Array(e),n=0,a=0;n<e;n++)r[n]=a+=l(t());return r}function p(e,t){for(var r=h(e(),e),n=e(),a=h(n,e),i=function(e,t){for(var r=Array(e),n=0;n<e;n++)r[n]=1+t();return r}(n,e),o=0;o<n;o++)for(var c=0;c<i[o];c++)r.push(a[o]+c);return t?r.map((function(e){return t[e]})):r}function m(e,t,r){for(var n=Array(e).fill(void 0).map((function(){return[]})),a=0;a<t;a++)b(e,r).forEach((function(e,t){return n[t].push(e)}));return n}function x(e,t){var r=1+t(),n=t(),a=function(e){for(var t=[];;){var r=e();if(0==r)break;t.push(r)}return t}(t);return u(m(a.length,1+e,t).map((function(e,t){var i=e[0],o=e.slice(1);return Array(a[t]).fill(void 0).map((function(e,t){var a=t*n;return[i+t*r,o.map((function(e){return e+a}))]}))})))}function g(e,t){return m(1+t(),1+e,t).map((function(e){return[e[0],e.slice(1)]}))}var v=d((0,r(87354).J)("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),y=new Set(p(v)),w=new Set(p(v)),M=function(e){for(var t=[];;){var r=e();if(0==r)break;t.push(x(r,e))}for(;;){var n=e()-1;if(n<0)break;t.push(g(n,e))}return function(e){for(var t={},r=0;r<e.length;r++){var n=e[r];t[n[0]]=n[1]}return t}(u(t))}(v),k=function(e){var t=p(e).sort((function(e,t){return e-t}));return function r(){var n=[];for(;;){var a=p(e,t);if(0==a.length)break;n.push({set:new Set(a),node:r()})}n.sort((function(e,t){return t.set.size-e.set.size}));var i=e();return{branches:n,valid:i%3,fe0f:!!(1&(i=i/3|0)),save:1==(i>>=1),check:2==i}}()}(v);function A(e){return(0,a.XL)(e)}function I(e){return e.filter((function(e){return 65039!=e}))}function E(e){var t,r=(0,f.Z)(e.split("."));try{for(r.s();!(t=r.n()).done;){var n=t.value,a=A(n);try{for(var i=a.lastIndexOf(95)-1;i>=0;i--)if(95!==a[i])throw new Error("underscore only allowed at start");if(a.length>=4&&a.every((function(e){return e<128}))&&45===a[2]&&45===a[3])throw new Error("invalid label extension")}catch(o){throw new Error('Invalid label "'.concat(n,'": ').concat(o.message))}}}catch(o){r.e(o)}finally{r.f()}return e}function S(e){return E(function(e,t){var r=A(e).reverse(),n=[];for(;r.length;){var a=_(r);if(a)n.push.apply(n,(0,s.Z)(t(a)));else{var i=r.pop();if(y.has(i))n.push(i);else if(!w.has(i)){var o=M[i];if(!o)throw new Error("Disallowed codepoint: 0x".concat(i.toString(16).toUpperCase()));n.push.apply(n,(0,s.Z)(o))}}}return E((c=String.fromCodePoint.apply(String,n),c.normalize("NFC")));var c}(e,I))}function _(e,t){var r,n,a,i=k,o=[],c=e.length;t&&(t.length=0);for(var f=function(){var f=e[--c];if(!(i=null===(r=i.branches.find((function(e){return e.set.has(f)})))||void 0===r?void 0:r.node))return"break";if(i.save)a=f;else if(i.check&&f===a)return"break";o.push(f),i.fe0f&&(o.push(65039),c>0&&65039==e[c-1]&&c--),i.valid&&(n=o.slice(),2==i.valid&&n.splice(1,1),t&&t.push.apply(t,(0,s.Z)(e.slice(c).reverse())),e.length=c)};c;){if("break"===f())break}return n}var N=new o.Logger(c.i),j=new Uint8Array(32);function C(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function T(e){var t=(0,a.Y0)(S(e)),r=[];if(0===e.length)return r;for(var n=0,i=0;i<t.length;i++){46===t[i]&&(r.push(C(t.slice(n,i))),n=i+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(C(t.slice(n))),r}function L(e){return T(e).map((function(e){return(0,a.ZN)(e)})).join(".")}function D(e){try{return 0!==T(e).length}catch(t){}return!1}function O(e){"string"!==typeof e&&N.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=j,r=T(e);r.length;)t=(0,i.keccak256)((0,n.concat)([t,(0,i.keccak256)(r.pop())]));return(0,n.hexlify)(t)}function P(e){return(0,n.hexlify)((0,n.concat)(T(e).map((function(e){if(e.length>63)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"}j.fill(0)},35992:function(e,t,r){"use strict";r.d(t,{E:function(){return N}});var n=r(27166),a=r(27853),i=r(84531),o=r(97419),c=r(2257),s=r(49716),f=r(88062),u=r(30520),d=r(39502),l=r(49366),h=r(51583),b=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},p=new d.Logger(l.i),m=new Uint8Array(32);m.fill(0);var x=c.O$.from(-1),g=c.O$.from(0),v=c.O$.from(1),y=c.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var w=(0,s.hexZeroPad)(v.toHexString(),32),M=(0,s.hexZeroPad)(g.toHexString(),32),k={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},A=["name","version","chainId","verifyingContract","salt"];function I(e){return function(t){return"string"!==typeof t&&p.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var E={name:I("name"),version:I("version"),chainId:function(e){try{return c.O$.from(e).toString()}catch(t){}return p.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,o.getAddress)(e).toLowerCase()}catch(t){}return p.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=(0,s.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,s.hexlify)(t)}catch(r){}return p.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function S(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var r=""===t[1],n=parseInt(t[2]||"256");(n%8!==0||n>256||t[2]&&t[2]!==String(n))&&p.throwArgumentError("invalid numeric width","type",e);var a=y.mask(r?n-1:n),i=r?a.add(v).mul(x):g;return function(t){var r=c.O$.from(t);return(r.lt(i)||r.gt(a))&&p.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),(0,s.hexZeroPad)(r.toTwos(256).toHexString(),32)}}var u=e.match(/^bytes(\d+)$/);if(u){var d=parseInt(u[1]);return(0===d||d>32||u[1]!==String(d))&&p.throwArgumentError("invalid bytes width","type",e),function(t){return(0,s.arrayify)(t).length!==d&&p.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=(0,s.arrayify)(e),r=t.length%32;return r?(0,s.hexConcat)([t,m.slice(r)]):(0,s.hexlify)(t)}(t)}}switch(e){case"address":return function(e){return(0,s.hexZeroPad)((0,o.getAddress)(e),32)};case"bool":return function(e){return e?w:M};case"bytes":return function(e){return(0,f.keccak256)(e)};case"string":return function(e){return(0,h.id)(e)}}return null}function _(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var N=function(){function e(t){(0,a.Z)(this,e),(0,u.defineReadOnly)(this,"types",Object.freeze((0,u.deepCopy)(t))),(0,u.defineReadOnly)(this,"_encoderCache",{}),(0,u.defineReadOnly)(this,"_types",{});var r={},n={},i={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],i[e]={}}));var o=function(e){var a={};t[e].forEach((function(i){a[i.name]&&p.throwArgumentError("duplicate variable name ".concat(JSON.stringify(i.name)," in ").concat(JSON.stringify(e)),"types",t),a[i.name]=!0;var o=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];o===e&&p.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),S(o)||(n[o]||p.throwArgumentError("unknown type ".concat(JSON.stringify(o)),"types",t),n[o].push(e),r[e][o]=!0)}))};for(var c in t)o(c);var s=Object.keys(n).filter((function(e){return 0===n[e].length}));for(var f in 0===s.length?p.throwArgumentError("missing primary type","types",t):s.length>1&&p.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),(0,u.defineReadOnly)(this,"primaryType",s[0]),function e(a,o){o[a]&&p.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),o[a]=!0,Object.keys(r[a]).forEach((function(t){n[t]&&(e(t,o),Object.keys(o).forEach((function(e){i[e][t]=!0})))})),delete o[a]}(this.primaryType,{}),i){var d=Object.keys(i[f]);d.sort(),this._types[f]=_(f,t[f])+d.map((function(e){return _(e,t[e])})).join("")}}return(0,i.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,r=S(e);if(r)return r;var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var a=n[1],i=this.getEncoder(a),o=parseInt(n[3]);return function(e){o>=0&&e.length!==o&&p.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(i);return t._types[a]&&(r=r.map(f.keccak256)),(0,f.keccak256)((0,s.hexConcat)(r))}}var c=this.types[e];if(c){var u=(0,h.id)(this._types[e]);return function(e){var r=c.map((function(r){var n=r.name,a=r.type,i=t.getEncoder(a)(e[n]);return t._types[a]?(0,f.keccak256)(i):i}));return r.unshift(u),(0,s.hexConcat)(r)}}return p.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||p.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,f.keccak256)(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,r){var n=this;if(S(e))return r(e,t);var a=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(a){var i=a[1],o=parseInt(a[3]);return o>=0&&t.length!==o&&p.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(i,e,r)}))}var c=this.types[e];return c?c.reduce((function(e,a){var i=a.name,o=a.type;return e[i]=n._visit(o,t[i],r),e}),{}):p.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,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[];for(var n in t){var a=k[n];a||p.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:a})}return r.sort((function(e,t){return A.indexOf(e.name)-A.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return(0,s.hexConcat)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return(0,f.keccak256)(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,a,i){return b(this,void 0,void 0,(0,n.Z)().mark((function o(){var c,f,d;return(0,n.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=(0,u.shallowCopy)(t),c={},t.verifyingContract&&!(0,s.isHexString)(t.verifyingContract,20)&&(c[t.verifyingContract]="0x"),(f=e.from(r)).visit(a,(function(e,t){return"address"!==e||(0,s.isHexString)(t,20)||(c[t]="0x"),t})),o.t0=(0,n.Z)().keys(c);case 6:if((o.t1=o.t0()).done){o.next=13;break}return d=o.t1.value,o.next=10,i(d);case 10:c[d]=o.sent,o.next=6;break;case 13:return t.verifyingContract&&c[t.verifyingContract]&&(t.verifyingContract=c[t.verifyingContract]),a=f.visit(a,(function(e,t){return"address"===e&&c[t]?c[t]:t})),o.abrupt("return",{domain:t,value:a});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var a={},i=[];A.forEach((function(e){var r=t[e];null!=r&&(a[e]=E[e](r),i.push({name:e,type:k[e]}))}));var o=e.from(r),f=(0,u.shallowCopy)(r);return f.EIP712Domain?p.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):f.EIP712Domain=i,o.encode(n),{types:f,domain:a,primaryType:o.primaryType,message:o.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return(0,s.hexlify)((0,s.arrayify)(t));if(e.match(/^u?int/))return c.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&p.throwArgumentError("invalid string","value",t),t}return p.throwArgumentError("unsupported type","type",e)}))}}}]),e}()},50117:function(e,t,r){"use strict";r.r(t),r.d(t,{HDNode:function(){return E},defaultPath:function(){return I},entropyToMnemonic:function(){return N},getAccountPath:function(){return C},isValidMnemonic:function(){return j},mnemonicToEntropy:function(){return _},mnemonicToSeed:function(){return S}});var n=r(27853),a=r(84531),i=r(3482),o=r(49716),c=r(2257),s=r(83374),f=r(72522),u=r(30520),d=r(78865),l=r(39598),h=r(24667),b=r(25452),p=r(42646),m=new(r(39502).Logger)("hdnode/5.7.0"),x=c.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),g=(0,s.Y0)("Bitcoin seed"),v=2147483648;function y(e){return(1<<e)-1<<8-e}function w(e){return(0,o.hexZeroPad)((0,o.hexlify)(e),32)}function M(e){return i.Base58.encode((0,o.concat)([e,(0,o.hexDataSlice)((0,l.JQ)((0,l.JQ)(e)),0,4)]))}function k(e){if(null==e)return p.E.en;if("string"===typeof e){var t=p.E[e];return null==t&&m.throwArgumentError("unknown locale","wordlist",e),t}return e}var A={},I="m/44'/60'/0'/0/0",E=function(){function e(t,r,a,i,c,s,f,h){if((0,n.Z)(this,e),t!==A)throw new Error("HDNode constructor cannot be called directly");if(r){var p=new d.SigningKey(r);(0,u.defineReadOnly)(this,"privateKey",p.privateKey),(0,u.defineReadOnly)(this,"publicKey",p.compressedPublicKey)}else(0,u.defineReadOnly)(this,"privateKey",null),(0,u.defineReadOnly)(this,"publicKey",(0,o.hexlify)(a));(0,u.defineReadOnly)(this,"parentFingerprint",i),(0,u.defineReadOnly)(this,"fingerprint",(0,o.hexDataSlice)((0,l.bP)((0,l.JQ)(this.publicKey)),0,4)),(0,u.defineReadOnly)(this,"address",(0,b.computeAddress)(this.publicKey)),(0,u.defineReadOnly)(this,"chainCode",c),(0,u.defineReadOnly)(this,"index",s),(0,u.defineReadOnly)(this,"depth",f),null==h?((0,u.defineReadOnly)(this,"mnemonic",null),(0,u.defineReadOnly)(this,"path",null)):"string"===typeof h?((0,u.defineReadOnly)(this,"mnemonic",null),(0,u.defineReadOnly)(this,"path",h)):((0,u.defineReadOnly)(this,"mnemonic",h),(0,u.defineReadOnly)(this,"path",h.path))}return(0,a.Z)(e,[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!");return M((0,o.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,o.hexlify)(this.depth),this.parentFingerprint,(0,o.hexZeroPad)((0,o.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,o.concat)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e(A,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t));var r=this.path;r&&(r+="/"+(2147483647&t));var n=new Uint8Array(37);if(t&v){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set((0,o.arrayify)(this.privateKey),1),r&&(r+="'")}else n.set((0,o.arrayify)(this.publicKey));for(var a=24;a>=0;a-=8)n[33+(a>>3)]=t>>24-a&255;var i=(0,o.arrayify)((0,l.Gy)(h.p.sha512,this.chainCode,n)),s=i.slice(0,32),f=i.slice(32),u=null,b=null;this.privateKey?u=w(c.O$.from(s).add(this.privateKey).mod(x)):b=new d.SigningKey((0,o.hexlify)(s))._addPoint(this.publicKey);var p=r,m=this.mnemonic;return m&&(p=Object.freeze({phrase:m.phrase,path:r,locale:m.locale||"en"})),new e(A,u,b,this.fingerprint,w(f),t,this.depth+1,p)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var r=this,n=0;n<t.length;n++){var a=t[n];if(a.match(/^[0-9]+'$/)){var i=parseInt(a.substring(0,a.length-1));if(i>=v)throw new Error("invalid path index - "+a);r=r._derive(v+i)}else{if(!a.match(/^[0-9]+$/))throw new Error("invalid path component - "+a);var o=parseInt(a);if(o>=v)throw new Error("invalid path index - "+a);r=r._derive(o)}}return r}}],[{key:"_fromSeed",value:function(t,r){var n=(0,o.arrayify)(t);if(n.length<16||n.length>64)throw new Error("invalid seed");var a=(0,o.arrayify)((0,l.Gy)(h.p.sha512,g,n));return new e(A,w(a.slice(0,32)),null,"0x00000000",w(a.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=N(_(t,n=k(n)),n),e._fromSeed(S(t,r),{phrase:t,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var r=i.Base58.decode(t);82===r.length&&M(r.slice(0,78))===t||m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],a=(0,o.hexlify)(r.slice(5,9)),c=parseInt((0,o.hexlify)(r.slice(9,13)).substring(2),16),s=(0,o.hexlify)(r.slice(13,45)),f=r.slice(45,78);switch((0,o.hexlify)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e(A,null,(0,o.hexlify)(f),a,s,c,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==f[0])break;return new e(A,(0,o.hexlify)(f.slice(1)),null,a,s,c,n,null)}return m.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}]),e}();function S(e,t){t||(t="");var r=(0,s.Y0)("mnemonic"+t,s.Uj.NFKD);return(0,f.n)((0,s.Y0)(e,s.Uj.NFKD),r,2048,64,"sha512")}function _(e,t){t=k(t),m.checkNormalize();var r=t.split(e);if(r.length%3!==0)throw new Error("invalid mnemonic");for(var n=(0,o.arrayify)(new Uint8Array(Math.ceil(11*r.length/8))),a=0,i=0;i<r.length;i++){var c=t.getWordIndex(r[i].normalize("NFKD"));if(-1===c)throw new Error("invalid mnemonic");for(var s=0;s<11;s++)c&1<<10-s&&(n[a>>3]|=1<<7-a%8),a++}var f=32*r.length/3,u=y(r.length/3);if(((0,o.arrayify)((0,l.JQ)(n.slice(0,f/8)))[0]&u)!==(n[n.length-1]&u))throw new Error("invalid checksum");return(0,o.hexlify)(n.slice(0,f/8))}function N(e,t){if(t=k(t),(e=(0,o.arrayify)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,a=0;a<e.length;a++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[a],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[a]>>8-n,r.push(e[a]&(1<<8-n)-1),n+=3);var i=e.length/4,c=(0,o.arrayify)((0,l.JQ)(e))[0]&y(i);return r[r.length-1]<<=i,r[r.length-1]|=c>>8-i,t.join(r.map((function(e){return t.getWord(e)})))}function j(e,t){try{return _(e,t),!0}catch(r){}return!1}function C(e){return("number"!==typeof e||e<0||e>=v||e%1)&&m.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}},95382:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="json-wallets/5.7.0"},31529:function(e,t,r){"use strict";r.r(t),r.d(t,{decryptCrowdsale:function(){return y},decryptJsonWallet:function(){return I},decryptJsonWalletSync:function(){return E},decryptKeystore:function(){return A.pe},decryptKeystoreSync:function(){return A.hb},encryptKeystore:function(){return A.HI},getJsonWalletAddress:function(){return k},isCrowdsaleWallet:function(){return w},isKeystoreWallet:function(){return M}});var n=r(27853),a=r(84531),i=r(81020),o=r(18992),c=r(30468),s=r.n(c),f=r(97419),u=r(49716),d=r(88062),l=r(72522),h=r(83374),b=r(30520),p=r(39502),m=r(95382),x=r(58661),g=new p.Logger(m.i),v=function(e){(0,i.Z)(r,e);var t=(0,o.Z)(r);function r(){return(0,n.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"isCrowdsaleAccount",value:function(e){return!(!e||!e._isCrowdsaleAccount)}}]),r}(b.Description);function y(e,t){var r=JSON.parse(e);t=(0,x.Ij)(t);var n=(0,f.getAddress)((0,x.gx)(r,"ethaddr")),a=(0,x.p3)((0,x.gx)(r,"encseed"));a&&a.length%16===0||g.throwArgumentError("invalid encseed","json",e);for(var i=(0,u.arrayify)((0,l.n)(t,t,2e3,32,"sha256")).slice(0,16),o=a.slice(0,16),c=a.slice(16),b=new(s().ModeOfOperation.cbc)(i,o),p=s().padding.pkcs7.strip((0,u.arrayify)(b.decrypt(c))),m="",y=0;y<p.length;y++)m+=String.fromCharCode(p[y]);var w=(0,h.Y0)(m),M=(0,d.keccak256)(w);return new v({_isCrowdsaleAccount:!0,address:n,privateKey:M})}function w(e){var t=null;try{t=JSON.parse(e)}catch(r){return!1}return t.encseed&&t.ethaddr}function M(e){var t=null;try{t=JSON.parse(e)}catch(r){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function k(e){if(w(e))try{return(0,f.getAddress)(JSON.parse(e).ethaddr)}catch(t){return null}if(M(e))try{return(0,f.getAddress)(JSON.parse(e).address)}catch(t){return null}return null}var A=r(13463);function I(e,t,r){if(w(e)){r&&r(0);var n=y(e,t);return r&&r(1),Promise.resolve(n)}return M(e)?(0,A.pe)(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function E(e,t){if(w(e))return y(e,t);if(M(e))return(0,A.hb)(e,t);throw new Error("invalid JSON wallet")}},13463:function(e,t,r){"use strict";r.d(t,{HI:function(){return L},hb:function(){return C},pe:function(){return T}});var n=r(27166),a=r(27853),i=r(84531),o=r(81020),c=r(18992),s=r(30468),f=r.n(s),u=r(12065),d=r.n(u),l=r(97419),h=r(49716),b=r(50117),p=r(88062),m=r(72522),x=r(15244),g=r(30520),v=r(25452),y=r(58661),w=r(39502),M=r(95382),k=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},A=new w.Logger(M.i);function I(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}var E=function(e){(0,o.Z)(r,e);var t=(0,c.Z)(r);function r(){return(0,a.Z)(this,r),t.apply(this,arguments)}return(0,i.Z)(r,[{key:"isKeystoreAccount",value:function(e){return!(!e||!e._isKeystoreAccount)}}]),r}(g.Description);function S(e,t){var r=(0,y.p3)((0,y.gx)(e,"crypto/ciphertext"));if((0,h.hexlify)((0,p.keccak256)((0,h.concat)([t.slice(16,32),r]))).substring(2)!==(0,y.gx)(e,"crypto/mac").toLowerCase())throw new Error("invalid password");var n=function(e,t,r){if("aes-128-ctr"===(0,y.gx)(e,"crypto/cipher")){var n=(0,y.p3)((0,y.gx)(e,"crypto/cipherparams/iv")),a=new(f().Counter)(n),i=new(f().ModeOfOperation.ctr)(t,a);return(0,h.arrayify)(i.decrypt(r))}return null}(e,t.slice(0,16),r);n||A.throwError("unsupported cipher",w.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var a=t.slice(32,64),i=(0,v.computeAddress)(n);if(e.address){var o=e.address.toLowerCase();if("0x"!==o.substring(0,2)&&(o="0x"+o),(0,l.getAddress)(o)!==i)throw new Error("address mismatch")}var c={_isKeystoreAccount:!0,address:i,privateKey:(0,h.hexlify)(n)};if("0.1"===(0,y.gx)(e,"x-ethers/version")){var s=(0,y.p3)((0,y.gx)(e,"x-ethers/mnemonicCiphertext")),u=(0,y.p3)((0,y.gx)(e,"x-ethers/mnemonicCounter")),d=new(f().Counter)(u),m=new(f().ModeOfOperation.ctr)(a,d),x=(0,y.gx)(e,"x-ethers/path")||b.defaultPath,g=(0,y.gx)(e,"x-ethers/locale")||"en",M=(0,h.arrayify)(m.decrypt(s));try{var k=(0,b.entropyToMnemonic)(M,g),I=b.HDNode.fromMnemonic(k,null,g).derivePath(x);if(I.privateKey!=c.privateKey)throw new Error("mnemonic mismatch");c.mnemonic=I.mnemonic}catch(S){if(S.code!==w.Logger.errors.INVALID_ARGUMENT||"wordlist"!==S.argument)throw S}}return new E(c)}function _(e,t,r,n,a){return(0,h.arrayify)((0,m.n)(e,t,r,n,a))}function N(e,t,r,n,a){return Promise.resolve(_(e,t,r,n,a))}function j(e,t,r,n,a){var i=(0,y.Ij)(t),o=(0,y.gx)(e,"crypto/kdf");if(o&&"string"===typeof o){var c=function(e,t){return A.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===o.toLowerCase()){var s=(0,y.p3)((0,y.gx)(e,"crypto/kdfparams/salt")),f=parseInt((0,y.gx)(e,"crypto/kdfparams/n")),u=parseInt((0,y.gx)(e,"crypto/kdfparams/r")),d=parseInt((0,y.gx)(e,"crypto/kdfparams/p"));f&&u&&d||c("kdf",o),0!==(f&f-1)&&c("N",f);var l=parseInt((0,y.gx)(e,"crypto/kdfparams/dklen"));return 32!==l&&c("dklen",l),n(i,s,f,u,d,64,a)}if("pbkdf2"===o.toLowerCase()){var h=(0,y.p3)((0,y.gx)(e,"crypto/kdfparams/salt")),b=null,p=(0,y.gx)(e,"crypto/kdfparams/prf");"hmac-sha256"===p?b="sha256":"hmac-sha512"===p?b="sha512":c("prf",p);var m=parseInt((0,y.gx)(e,"crypto/kdfparams/c")),x=parseInt((0,y.gx)(e,"crypto/kdfparams/dklen"));return 32!==x&&c("dklen",x),r(i,h,m,x,b)}}return A.throwArgumentError("unsupported key-derivation function","kdf",o)}function C(e,t){var r=JSON.parse(e);return S(r,j(r,t,_,d().syncScrypt))}function T(e,t,r){return k(this,void 0,void 0,(0,n.Z)().mark((function a(){var i,o;return(0,n.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=JSON.parse(e),n.next=3,j(i,t,N,d().scrypt,r);case 3:return o=n.sent,n.abrupt("return",S(i,o));case 5:case"end":return n.stop()}}),a)})))}function L(e,t,r,n){try{if((0,l.getAddress)(e.address)!==(0,v.computeAddress)(e.privateKey))throw new Error("address/privateKey mismatch");if(I(e)){var a=e.mnemonic;if(b.HDNode.fromMnemonic(a.phrase,null,a.locale).derivePath(a.path||b.defaultPath).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(_){return Promise.reject(_)}"function"!==typeof r||n||(n=r,r={}),r||(r={});var i=(0,h.arrayify)(e.privateKey),o=(0,y.Ij)(t),c=null,s=null,u=null;if(I(e)){var m=e.mnemonic;c=(0,h.arrayify)((0,b.mnemonicToEntropy)(m.phrase,m.locale||"en")),s=m.path||b.defaultPath,u=m.locale||"en"}var g=r.client;g||(g="ethers.js");var w=null;w=r.salt?(0,h.arrayify)(r.salt):(0,x.O)(32);var M=null;if(r.iv){if(16!==(M=(0,h.arrayify)(r.iv)).length)throw new Error("invalid iv")}else M=(0,x.O)(16);var k=null;if(r.uuid){if(16!==(k=(0,h.arrayify)(r.uuid)).length)throw new Error("invalid uuid")}else k=(0,x.O)(16);var A=1<<17,E=8,S=1;return r.scrypt&&(r.scrypt.N&&(A=r.scrypt.N),r.scrypt.r&&(E=r.scrypt.r),r.scrypt.p&&(S=r.scrypt.p)),d().scrypt(o,w,A,E,S,64,n).then((function(t){var r=(t=(0,h.arrayify)(t)).slice(0,16),n=t.slice(16,32),a=t.slice(32,64),o=new(f().Counter)(M),d=new(f().ModeOfOperation.ctr)(r,o),l=(0,h.arrayify)(d.encrypt(i)),b=(0,p.keccak256)((0,h.concat)([n,l])),m={address:e.address.substring(2).toLowerCase(),id:(0,y.EH)(k),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,h.hexlify)(M).substring(2)},ciphertext:(0,h.hexlify)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,h.hexlify)(w).substring(2),n:A,dklen:32,p:S,r:E},mac:b.substring(2)}};if(c){var v=(0,x.O)(16),I=new(f().Counter)(v),_=new(f().ModeOfOperation.ctr)(a,I),N=(0,h.arrayify)(_.encrypt(c)),j=new Date,C=j.getUTCFullYear()+"-"+(0,y.VP)(j.getUTCMonth()+1,2)+"-"+(0,y.VP)(j.getUTCDate(),2)+"T"+(0,y.VP)(j.getUTCHours(),2)+"-"+(0,y.VP)(j.getUTCMinutes(),2)+"-"+(0,y.VP)(j.getUTCSeconds(),2)+".0Z";m["x-ethers"]={client:g,gethFilename:"UTC--"+C+"--"+m.address,mnemonicCounter:(0,h.hexlify)(v).substring(2),mnemonicCiphertext:(0,h.hexlify)(N).substring(2),path:s,locale:u,version:"0.1"}}return JSON.stringify(m)}))}},58661:function(e,t,r){"use strict";r.d(t,{EH:function(){return f},Ij:function(){return c},VP:function(){return o},gx:function(){return s},p3:function(){return i}});var n=r(49716),a=r(83374);function i(e){return"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,n.arrayify)(e)}function o(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function c(e){return"string"===typeof e?(0,a.Y0)(e,a.Uj.NFKC):(0,n.arrayify)(e)}function s(e,t){for(var r=e,n=t.toLowerCase().split("/"),a=0;a<n.length;a++){var i=null;for(var o in r)if(o.toLowerCase()===n[a]){i=r[o];break}if(null===i)return null;r=i}return r}function f(e){var t=(0,n.arrayify)(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;var r=(0,n.hexlify)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}},88062:function(e,t,r){"use strict";r.r(t),r.d(t,{keccak256:function(){return o}});var n=r(27898),a=r.n(n),i=r(49716);function o(e){return"0x"+a().keccak_256((0,i.arrayify)(e))}},39502:function(e,t,r){"use strict";r.r(t),r.d(t,{ErrorCode:function(){return d},LogLevel:function(){return u},Logger:function(){return b}});var n=r(27853),a=r(84531),i=!1,o=!1,c={debug:1,default:2,info:2,warning:3,error:4,off:5},s=c.default,f=null;var u,d,l=function(){try{var e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){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"}(u||(u={})),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"}(d||(d={}));var h="0123456789abcdef",b=function(){function e(t){(0,n.Z)(this,e),Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}return(0,a.Z)(e,[{key:"_log",value:function(e,t){var r=e.toLowerCase();null==c[r]&&this.throwArgumentError("invalid log level name","logLevel",e),s>c[r]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this._log(e.levels.DEBUG,r)}},{key:"info",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this._log(e.levels.INFO,r)}},{key:"warn",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this._log(e.levels.WARNING,r)}},{key:"makeError",value:function(t,r,n){if(o)return this.makeError("censored error",r,{});r||(r=e.errors.UNKNOWN_ERROR),n||(n={});var a=[];Object.keys(n).forEach((function(e){var t=n[e];try{if(t instanceof Uint8Array){for(var r="",i=0;i<t.length;i++)r+=h[t[i]>>4],r+=h[15&t[i]];a.push(e+"=Uint8Array(0x"+r+")")}else a.push(e+"="+JSON.stringify(t))}catch(f){a.push(e+"="+JSON.stringify(n[e].toString()))}})),a.push("code=".concat(r)),a.push("version=".concat(this.version));var i=t,c="";switch(r){case d.NUMERIC_FAULT:c="NUMERIC_FAULT";var s=t;switch(s){case"overflow":case"underflow":case"division-by-zero":c+="-"+s;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result"}break;case d.CALL_EXCEPTION:case d.INSUFFICIENT_FUNDS:case d.MISSING_NEW:case d.NONCE_EXPIRED:case d.REPLACEMENT_UNDERPRICED:case d.TRANSACTION_REPLACED:case d.UNPREDICTABLE_GAS_LIMIT:c=r}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");var f=new Error(t);return f.reason=i,f.code=r,Object.keys(n).forEach((function(e){f[e]=n[e]})),f}},{key:"throwError",value:function(e,t,r){throw this.makeError(e,t,r)}},{key:"throwArgumentError",value:function(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(e,t,r,n){e||this.throwError(t,r,n)}},{key:"assertArgument",value:function(e,t,r,n){e||this.throwArgumentError(t,r,n)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),l&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:l})}},{key:"checkSafeUint53",value:function(t,r){"number"===typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,r,n){n=n?": "+n:"",t<r&&this.throwError("missing argument"+n,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}},{key:"checkNew",value:function(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.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:r.name})}}],[{key:"globalLogger",value:function(){return f||(f=new e("logger/5.7.0")),f}},{key:"setCensorship",value:function(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),i){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}o=!!t,i=!!r}},{key:"setLogLevel",value:function(t){var r=c[t.toLowerCase()];null!=r?s=r:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();b.errors=d,b.levels=u},79083:function(e,t,r){"use strict";r.d(t,{H:function(){return u}});var n=new(r(39502).Logger)("networks/5.7.1");function a(e){var t=function(t,r){null==r&&(r={});var n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(c){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(c){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(c){}if(t.PocketProvider&&"-"!==r.pocket){try{var a=new t.PocketProvider(e,r.pocket);a.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(a.network.name)&&n.push(a)}catch(c){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(c){}if(t.AnkrProvider&&"-"!==r.ankr)try{var i=new t.AnkrProvider(e,r.ankr);i.network&&-1===["ropsten"].indexOf(i.network.name)&&n.push(i)}catch(c){}if(0===n.length)return null;if(t.FallbackProvider){var o=1;return null!=r.quorum?o=r.quorum:"homestead"===e&&(o=2),new t.FallbackProvider(n,o)}return n[0]};return t.renetwork=function(e){return a(e)},t}function i(e,t){var r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return i(e,t)},r}var o={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:a("homestead")},c={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:a("ropsten")},s={chainId:63,name:"classicMordor",_defaultProvider:i("https://www.ethercluster.com/mordor","classicMordor")},f={unspecified:{chainId:0,name:"unspecified"},homestead:o,mainnet:o,morden:{chainId:2,name:"morden"},ropsten:c,testnet:c,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:a("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:a("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:a("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:a("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:i("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:s,classicTestnet:s,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:i("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:a("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:a("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function u(e){if(null==e)return null;if("number"===typeof e){for(var t in f){var r=f[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"===typeof e){var a=f[e];return null==a?null:{name:a.name,chainId:a.chainId,ensAddress:a.ensAddress,_defaultProvider:a._defaultProvider||null}}var i=f[e.name];if(!i)return"number"!==typeof e.chainId&&n.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==i.chainId&&n.throwArgumentError("network chainId mismatch","network",e);var o,c=e._defaultProvider||null;return null==c&&i._defaultProvider&&(c=(o=i._defaultProvider)&&"function"===typeof o.renetwork?i._defaultProvider.renetwork(e):i._defaultProvider),{name:e.name,chainId:i.chainId,ensAddress:e.ensAddress||i.ensAddress||null,_defaultProvider:c}}},72522:function(e,t,r){"use strict";r.d(t,{n:function(){return i}});var n=r(49716),a=r(39598);function i(e,t,r,i,o){var c;e=(0,n.arrayify)(e),t=(0,n.arrayify)(t);var s,f,u=1,d=new Uint8Array(i),l=new Uint8Array(t.length+4);l.set(t);for(var h=1;h<=u;h++){l[t.length]=h>>24&255,l[t.length+1]=h>>16&255,l[t.length+2]=h>>8&255,l[t.length+3]=255&h;var b=(0,n.arrayify)((0,a.Gy)(o,e,l));c||(c=b.length,f=new Uint8Array(c),s=i-((u=Math.ceil(i/c))-1)*c),f.set(b);for(var p=1;p<r;p++){b=(0,n.arrayify)((0,a.Gy)(o,e,b));for(var m=0;m<c;m++)f[m]^=b[m]}var x=(h-1)*c,g=h===u?s:c;d.set((0,n.arrayify)(f).slice(0,g),x)}return(0,n.hexlify)(d)}},30520:function(e,t,r){"use strict";r.r(t),r.d(t,{Description:function(){return g},checkProperties:function(){return l},deepCopy:function(){return x},defineReadOnly:function(){return f},getStatic:function(){return u},resolveProperties:function(){return d},shallowCopy:function(){return h}});var n=r(84531),a=r(27853),i=r(27166),o=r(39502),c=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},s=new o.Logger("properties/5.7.0");function f(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function u(e,t){for(var r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!==typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function d(e){return c(this,void 0,void 0,(0,i.Z)().mark((function t(){var r,n;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Object.keys(e).map((function(t){var r=e[t];return Promise.resolve(r).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(r);case 3:return n=t.sent,t.abrupt("return",n.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))}function l(e,t){e&&"object"===typeof e||s.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(r){t[r]||s.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function h(e){var t={};for(var r in e)t[r]=e[r];return t}var b={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function p(e){if(void 0===e||null===e||b[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;for(var t=Object.keys(e),r=0;r<t.length;r++){var n=null;try{n=e[t[r]]}catch(a){continue}if(!p(n))return!1}return!0}return s.throwArgumentError("Cannot deepCopy ".concat(typeof e),"object",e)}function m(e){if(p(e))return e;if(Array.isArray(e))return Object.freeze(e.map((function(e){return x(e)})));if("object"===typeof e){var t={};for(var r in e){var n=e[r];void 0!==n&&f(t,r,x(n))}return t}return s.throwArgumentError("Cannot deepCopy ".concat(typeof e),"object",e)}function x(e){return m(e)}var g=(0,n.Z)((function e(t){for(var r in(0,a.Z)(this,e),t)this[r]=x(t[r])}))},77059:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});var n="providers/5.7.1"},54345:function(e,t,r){"use strict";r.d(t,{D:function(){return x},V:function(){return m}});var n=r(27853),a=r(84531),i=r(6148),o=r(81020),c=r(18992),s=r(30520),f=r(66720),u=r(75080),d=r(39502),l=r(77059),h=r(42412),b=new d.Logger(l.i),p="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",m=function(e){(0,o.Z)(r,e);var t=(0,c.Z)(r);function r(e,a){var o;(0,n.Z)(this,r);var c=new x(e,a),f=c.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return o=t.call(this,f,c.network),(0,s.defineReadOnly)((0,i.Z)(o),"apiKey",c.apiKey),o}return(0,a.Z)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===p}}]),r}(u.q),x=function(e){(0,o.Z)(r,e);var t=(0,c.Z)(r);function r(){return(0,n.Z)(this,r),t.apply(this,arguments)}return(0,a.Z)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===p}}],[{key:"getWebSocketProvider",value:function(e,t){return new m(e,t)}},{key:"getApiKey",value:function(e){return null==e?p:(e&&"string"!==typeof e&&b.throwArgumentError("invalid apiKey","apiKey",e),e)}},{key:"getUrl",value:function(e,t){var r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-rinkeby":r="arb-rinkeby.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-kovan":r="opt-kovan.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:b.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:function(e,r){return t===p&&(0,f.vh)(),Promise.resolve(!0)}}}}]),r}(h.l)},9970:function(e,t,r){"use strict";r.d(t,{H2:function(){return W},Zk:function(){return V}});var n=r(6148),a=r(81020),i=r(18992),o=r(27166),c=r(27853),s=r(84531),f=r(69745),u=r(87354),d=r(3482),l=r(2257),h=r(49716),b=r(84867),p=r(95235),m=r(79083),x=r(30520),g=r(39598),v=r(83374),y=r(65889),w=r(31360),M=r.n(w),k=r(39502),A=r(77059),I=r(66720),E=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},S=new k.Logger(A.i);function _(e){return null==e?"null":(32!==(0,h.hexDataLength)(e)&&S.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function N(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[_(e)]=!0}));var r=Object.keys(t);return r.sort(),r.join("|")}return _(e)})).join("&")}function j(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,h.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+N(e);if(f.Sg.isForkEvent(e))throw S.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+N(e.topics||[])}throw new Error("invalid event - "+e)}function C(){return(new Date).getTime()}function T(e){return new Promise((function(t){setTimeout(t,e)}))}var L=["block","network","pending","poll"],D=function(){function e(t,r,n){(0,c.Z)(this,e),(0,x.defineReadOnly)(this,"tag",t),(0,x.defineReadOnly)(this,"listener",r),(0,x.defineReadOnly)(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return(0,s.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,r=e[1],n=""===(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})),a={};return n.length>0&&(a.topics=n),r&&"*"!==r&&(a.address=r),a}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||L.indexOf(this.tag)>=0}}]),e}(),O={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 P(e){return(0,h.hexZeroPad)(l.O$.from(e).toHexString(),32)}function R(e){return d.Base58.encode((0,h.concat)([e,(0,h.hexDataSlice)((0,g.JQ)((0,g.JQ)(e)),0,4)]))}var B=new RegExp("^(ipfs)://(.*)$","i"),z=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),B,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function U(e,t){try{return(0,v.ZN)(Z(e,t))}catch(r){}return null}function Z(e,t){if("0x"===e)return null;var r=l.O$.from((0,h.hexDataSlice)(e,t,t+32)).toNumber(),n=l.O$.from((0,h.hexDataSlice)(e,r,r+32)).toNumber();return(0,h.hexDataSlice)(e,r+32,r+32+n)}function F(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):S.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function Y(e){var t=(0,h.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");var r=new Uint8Array(32);return r.set(t,32-t.length),r}function G(e){if(e.length%32===0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function H(e){for(var t=[],r=0,n=0;n<e.length;n++)t.push(null),r+=32;for(var a=0;a<e.length;a++){var i=(0,h.arrayify)(e[a]);t[a]=Y(r),t.push(Y(i.length)),t.push(G(i)),r+=32+32*Math.ceil(i.length/32)}return(0,h.hexConcat)(t)}var W=function(){function e(t,r,n,a){(0,c.Z)(this,e),(0,x.defineReadOnly)(this,"provider",t),(0,x.defineReadOnly)(this,"name",n),(0,x.defineReadOnly)(this,"address",t.formatter.address(r)),(0,x.defineReadOnly)(this,"_resolvedAddress",a)}return(0,s.Z)(e,[{key:"supportsWildcard",value:function(){var e=this;return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((function(e){return l.O$.from(e).eq(1)})).catch((function(t){if(t.code===k.Logger.errors.CALL_EXCEPTION)return!1;throw e._supportsEip2544=null,t}))),this._supportsEip2544}},{key:"_fetch",value:function(e,t){return E(this,void 0,void 0,(0,o.Z)().mark((function r(){var n,a,i;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={to:this.address,ccipReadEnabled:!0,data:(0,h.hexConcat)([e,(0,p.VM)(this.name),t||"0x"])},a=!1,r.next=4,this.supportsWildcard();case 4:if(!r.sent){r.next=7;break}a=!0,n.data=(0,h.hexConcat)(["0x9061b923",H([(0,p.Kn)(this.name),n.data])]);case 7:return r.prev=7,r.next=10,this.provider.call(n);case 10:return i=r.sent,(0,h.arrayify)(i).length%32===4&&S.throwError("resolver threw error",k.Logger.errors.CALL_EXCEPTION,{transaction:n,data:i}),a&&(i=Z(i,0)),r.abrupt("return",i);case 16:if(r.prev=16,r.t0=r.catch(7),r.t0.code!==k.Logger.errors.CALL_EXCEPTION){r.next=20;break}return r.abrupt("return",null);case 20:throw r.t0;case 21:case"end":return r.stop()}}),r,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(e,t){return E(this,void 0,void 0,(0,o.Z)().mark((function r(){var n;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._fetch(e,t);case 2:if(null==(n=r.sent)){r.next=5;break}return r.abrupt("return",Z(n,0));case 5:return r.abrupt("return",null);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_getAddress",value:function(e,t){var r=O[String(e)];if(null==r&&S.throwError("unsupported coin type: ".concat(e),k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===r.ilk)return this.provider.formatter.address(t);var n=(0,h.arrayify)(t);if(null!=r.p2pkh){var a=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(a){var i=parseInt(a[1],16);if(a[2].length===2*i&&i>=1&&i<=75)return R((0,h.concat)([[r.p2pkh],"0x"+a[2]]))}}if(null!=r.p2sh){var o=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(o){var c=parseInt(o[1],16);if(o[2].length===2*c&&c>=1&&c<=75)return R((0,h.concat)([[r.p2sh],"0x"+o[2]]))}}if(null!=r.prefix){var s=n[1],f=n[0];if(0===f?20!==s&&32!==s&&(f=-1):f=-1,f>=0&&n.length===2+s&&s>=1&&s<=75){var u=M().toWords(n.slice(2));return u.unshift(f),M().encode(r.prefix,u)}}return null}},{key:"getAddress",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n,a;return(0,o.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"!==(r=t.sent)&&r!==b.R){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(r));case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==k.Logger.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",P(e));case 18:if(null!=(n=t.sent)&&"0x"!==n){t.next=21;break}return t.abrupt("return",null);case 21:return null==(a=this._getAddress(e,n))&&S.throwError("invalid or unsupported coin data",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:n}),t.abrupt("return",a);case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return E(this,void 0,void 0,(0,o.Z)().mark((function e(){var t,r,n,a,i,c,s,f,u,d,b,p,m,x,g,v;return(0,o.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!=(r=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:n=0;case 8:if(!(n<z.length)){e.next=91;break}if(null!=(a=r.match(z[n]))){e.next=12;break}return e.abrupt("continue",88);case 12:i=a[1].toLowerCase(),e.t0=i,e.next="https"===e.t0?16:"data"===e.t0?18:"ipfs"===e.t0?20:"erc721"===e.t0||"erc1155"===e.t0?22:88;break;case 16:return t.push({type:"url",content:r}),e.abrupt("return",{linkage:t,url:r});case 18:return t.push({type:"data",content:r}),e.abrupt("return",{linkage:t,url:r});case 20:return t.push({type:"ipfs",content:r}),e.abrupt("return",{linkage:t,url:F(r)});case 22:if(c="erc721"===i?"0xc87b56dd":"0x0e89341c",t.push({type:i,content:r}),e.t1=this._resolvedAddress,e.t1){e.next=29;break}return e.next=28,this.getAddress();case 28:e.t1=e.sent;case 29:if(s=e.t1,2===(f=(a[2]||"").split("/")).length){e.next=33;break}return e.abrupt("return",null);case 33:return e.next=35,this.provider.formatter.address(f[0]);case 35:if(u=e.sent,d=(0,h.hexZeroPad)(l.O$.from(f[1]).toHexString(),32),"erc721"!==i){e.next=48;break}return e.t2=this.provider.formatter,e.next=41,this.provider.call({to:u,data:(0,h.hexConcat)(["0x6352211e",d])});case 41:if(e.t3=e.sent,b=e.t2.callAddress.call(e.t2,e.t3),s===b){e.next=45;break}return e.abrupt("return",null);case 45:t.push({type:"owner",content:b}),e.next=57;break;case 48:if("erc1155"!==i){e.next=57;break}return e.t4=l.O$,e.next=52,this.provider.call({to:u,data:(0,h.hexConcat)(["0x00fdd58e",(0,h.hexZeroPad)(s,32),d])});case 52:if(e.t5=e.sent,!(p=e.t4.from.call(e.t4,e.t5)).isZero()){e.next=56;break}return e.abrupt("return",null);case 56:t.push({type:"balance",content:p.toString()});case 57:return m={to:this.provider.formatter.address(f[0]),data:(0,h.hexConcat)([c,d])},e.t6=U,e.next=61,this.provider.call(m);case 61:if(e.t7=e.sent,null!=(x=(0,e.t6)(e.t7,0))){e.next=65;break}return e.abrupt("return",null);case 65:return t.push({type:"metadata-url-base",content:x}),"erc1155"===i&&(x=x.replace("{id}",d.substring(2)),t.push({type:"metadata-url-expanded",content:x})),x.match(/^ipfs:/i)&&(x=F(x)),t.push({type:"metadata-url",content:x}),e.next=71,(0,y.fetchJson)(x);case 71:if(g=e.sent){e.next=74;break}return e.abrupt("return",null);case 74:if(t.push({type:"metadata",content:JSON.stringify(g)}),"string"===typeof(v=g.image)){e.next=78;break}return e.abrupt("return",null);case 78:if(!v.match(/^(https:\/\/|data:)/i)){e.next=81;break}e.next=86;break;case 81:if(null!=v.match(B)){e.next=84;break}return e.abrupt("return",null);case 84:t.push({type:"url-ipfs",content:v}),v=F(v);case 86:return t.push({type:"url",content:v}),e.abrupt("return",{linkage:t,url:v});case 88:n++,e.next=8;break;case 91:e.next=95;break;case 93:e.prev=93,e.t8=e.catch(1);case 95:return e.abrupt("return",null);case 96:case"end":return e.stop()}}),e,this,[[1,93]])})))}},{key:"getContentHash",value:function(){return E(this,void 0,void 0,(0,o.Z)().mark((function e(){var t,r,n,a,i,c,s,f,l;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(t=e.sent)&&"0x"!==t){e.next=5;break}return e.abrupt("return",null);case 5:if(!(r=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){e.next=10;break}return e.abrupt("return","ipfs://"+d.Base58.encode("0x"+r[1]));case 10:if(!(a=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=15;break}if(i=parseInt(a[3],16),a[4].length!==2*i){e.next=15;break}return e.abrupt("return","ipns://"+d.Base58.encode("0x"+a[1]));case 15:if(!(c=t.match(/^0xe40101fa011b20([0-9a-f]*)$/))){e.next=19;break}if(64!==c[1].length){e.next=19;break}return e.abrupt("return","bzz://"+c[1]);case 19:if(!(s=t.match(/^0x90b2c605([0-9a-f]*)$/))){e.next=25;break}if(68!==s[1].length){e.next=25;break}return f={"=":"","+":"-","/":"_"},l=(0,u.c)("0x"+s[1]).replace(/[=+\/]/g,(function(e){return f[e]})),e.abrupt("return","sia://"+l);case 25:return e.abrupt("return",S.throwError("invalid or unsupported content hash data",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t}));case 26:case"end":return e.stop()}}),e,this)})))}},{key:"getText",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(0,v.Y0)(e),(r=(0,h.concat)([P(64),P(r.length),r])).length%32!==0&&(r=(0,h.concat)([r,(0,h.hexZeroPad)("0x",32-e.length%32)])),t.next=5,this._fetchBytes("0x59d1d43c",(0,h.hexlify)(r));case 5:if(null!=(n=t.sent)&&"0x"!==n){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",(0,v.ZN)(n));case 9:case"end":return t.stop()}}),t,this)})))}}]),e}(),q=null,Q=1,V=function(e){(0,a.Z)(r,e);var t=(0,i.Z)(r);function r(e){var a;if((0,c.Z)(this,r),(a=t.call(this))._events=[],a._emitted={block:-2},a.disableCcipRead=!1,a.formatter=(this instanceof r?this.constructor:void 0).getFormatter(),(0,x.defineReadOnly)((0,n.Z)(a),"anyNetwork","any"===e),a.anyNetwork&&(e=a.detectNetwork()),e instanceof Promise)a._networkPromise=e,e.catch((function(e){})),a._ready().catch((function(e){}));else{var i=(0,x.getStatic)(this instanceof r?this.constructor:void 0,"getNetwork")(e);i?((0,x.defineReadOnly)((0,n.Z)(a),"_network",i),a.emit("network",i,null)):S.throwArgumentError("invalid network","network",e)}return a._maxInternalBlockNumber=-1024,a._lastBlockNumber=-2,a._maxFilterBlockRange=10,a._pollingInterval=4e3,a._fastQueryDate=0,a}return(0,s.Z)(r,[{key:"_ready",value:function(){return E(this,void 0,void 0,(0,o.Z)().mark((function e(){var t;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this._network){e.next=17;break}if(t=null,!this._networkPromise){e.next=11;break}return e.prev=3,e.next=6,this._networkPromise;case 6:t=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(null!=t){e.next=15;break}return e.next=14,this.detectNetwork();case 14:t=e.sent;case 15:t||S.throwError("no network detected",k.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,x.defineReadOnly)(this,"_network",t),this.emit("network",t,null));case 17:return e.abrupt("return",this._network);case 18:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"ready",get:function(){var e=this;return(0,y.poll)((function(){return e._ready().then((function(e){return e}),(function(e){if(e.code!==k.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}))}},{key:"ccipReadFetch",value:function(e,t,r){return E(this,void 0,void 0,(0,o.Z)().mark((function n(){var a,i,c,s,f,u,d,l,h;return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.disableCcipRead&&0!==r.length){n.next=2;break}return n.abrupt("return",null);case 2:a=e.to.toLowerCase(),i=t.toLowerCase(),c=[],s=0;case 6:if(!(s<r.length)){n.next=22;break}return f=r[s],u=f.replace("{sender}",a).replace("{data}",i),d=f.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:a}),n.next=12,(0,y.fetchJson)({url:u,errorPassThrough:!0},d,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(l=n.sent).data){n.next=15;break}return n.abrupt("return",l.data);case 15:if(h=l.message||"unknown error",!(l.status>=400&&l.status<500)){n.next=18;break}return n.abrupt("return",S.throwError("response not found during CCIP fetch: ".concat(h),k.Logger.errors.SERVER_ERROR,{url:f,errorMessage:h}));case 18:c.push(h);case 19:s++,n.next=6;break;case 22:return n.abrupt("return",S.throwError("error encountered during CCIP fetch: ".concat(c.map((function(e){return JSON.stringify(e)})).join(", ")),k.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:c}));case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n,a,i,c=this;return(0,o.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 r=this._internalBlockNumber,t.prev=5,t.next=8,r;case 8:if(n=t.sent,!(C()-n.respTime<=e)){t.next=11;break}return t.abrupt("return",n.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==r){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return a=C(),i=(0,x.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,r=e.networkError;if(r)throw c._internalBlockNumber===i&&(c._internalBlockNumber=null),r;var n=C();return(t=l.O$.from(t).toNumber())<c._maxInternalBlockNumber&&(t=c._maxInternalBlockNumber),c._maxInternalBlockNumber=t,c._setFastBlockNumber(t),{blockNumber:t,reqTime:a,respTime:n}})),this._internalBlockNumber=i,i.catch((function(e){c._internalBlockNumber===i&&(c._internalBlockNumber=null)})),t.next=26,i;case 26:return t.abrupt("return",t.sent.blockNumber);case 27:case"end":return t.stop()}}),t,this,[[5,14]])})))}},{key:"poll",value:function(){return E(this,void 0,void 0,(0,o.Z)().mark((function e(){var t,r,n,a,i=this;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Q++,r=[],n=null,e.prev=3,e.next=6,this._getInternalBlockNumber(100+this.pollingInterval/2);case 6:n=e.sent,e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),this.emit("error",e.t0),e.abrupt("return");case 13:if(this._setFastBlockNumber(n),this.emit("poll",t,n),n!==this._lastBlockNumber){e.next=18;break}return this.emit("didPoll",t),e.abrupt("return");case 18:if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)S.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",S.makeError("network block skew detected",k.Logger.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(a=this._emitted.block+1;a<=n;a++)this.emit("block",a);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=i._emitted[e];"pending"!==t&&n-t>12&&delete i._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,a=i.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(i._emitted["t:"+t]=e.blockNumber,i.emit(t,e),null):null})).catch((function(e){i.emit("error",e)}));r.push(a);break;case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);var o=e.filter;o.fromBlock=e._lastBlockNumber+1,o.toBlock=n;var c=o.toBlock-i._maxFilterBlockRange;c>o.fromBlock&&(o.fromBlock=c),o.fromBlock<0&&(o.fromBlock=0);var s=i.getLogs(o).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),i._emitted["b:"+t.blockHash]=t.blockNumber,i._emitted["t:"+t.transactionHash]=t.blockNumber,i.emit(o,t)}))})).catch((function(t){i.emit("error",t),e._inflight=!1}));r.push(s)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){i.emit("didPoll",t)})).catch((function(e){i.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 E(this,void 0,void 0,(0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",S.throwError("provider does not support network detection",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return E(this,void 0,void 0,(0,o.Z)().mark((function e(){var t,r,n;return(0,o.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(r=e.sent,t.chainId===r.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,t),e.next=19,T(0);case 19:return e.abrupt("return",this._network);case 20:throw n=S.makeError("underlying network changed",k.Logger.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:r}),this.emit("error",n),n;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=C();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&&e<this._fastBlockNumber||(this._fastQueryDate=C(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,r){return E(this,void 0,void 0,(0,o.Z)().mark((function n(){return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(e,null==t?1:t,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(e,t,r,n){return E(this,void 0,void 0,(0,o.Z)().mark((function a(){var i,c=this;return(0,o.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.getTransactionReceipt(e);case 2:if(!(((i=a.sent)?i.confirmations:0)>=t)){a.next=5;break}return a.abrupt("return",i);case 5:return a.abrupt("return",new Promise((function(a,i){var s=[],f=!1,u=function(){return!!f||(f=!0,s.forEach((function(e){e()})),!1)},d=function(e){e.confirmations<t||u()||a(e)};if(c.on(e,d),s.push((function(){c.removeListener(e,d)})),n){var l=n.startBlock,h=null,b=function r(a){return E(c,void 0,void 0,(0,o.Z)().mark((function c(){var s=this;return(0,o.Z)().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:if(!f){c.next=2;break}return c.abrupt("return");case 2:return c.next=4,T(1e3);case 4:this.getTransactionCount(n.from).then((function(c){return E(s,void 0,void 0,(0,o.Z)().mark((function s(){var d,b,p,m,x,g;return(0,o.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(!f){o.next=2;break}return o.abrupt("return");case 2:if(!(c<=n.nonce)){o.next=6;break}l=a,o.next=41;break;case 6:return o.next=8,this.getTransaction(e);case 8:if(!(d=o.sent)||null==d.blockNumber){o.next=11;break}return o.abrupt("return");case 11:null==h&&(h=l-3)<n.startBlock&&(h=n.startBlock);case 12:if(!(h<=a)){o.next=41;break}if(!f){o.next=15;break}return o.abrupt("return");case 15:return o.next=17,this.getBlockWithTransactions(h);case 17:b=o.sent,p=0;case 19:if(!(p<b.transactions.length)){o.next=38;break}if((m=b.transactions[p]).hash!==e){o.next=23;break}return o.abrupt("return");case 23:if(m.from!==n.from||m.nonce!==n.nonce){o.next=35;break}if(!f){o.next=26;break}return o.abrupt("return");case 26:return o.next=28,this.waitForTransaction(m.hash,t);case 28:if(x=o.sent,!u()){o.next=31;break}return o.abrupt("return");case 31:return g="replaced",m.data===n.data&&m.to===n.to&&m.value.eq(n.value)?g="repriced":"0x"===m.data&&m.from===m.to&&m.value.isZero()&&(g="cancelled"),i(S.makeError("transaction was replaced",k.Logger.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===g||"cancelled"===g,reason:g,replacement:this._wrapTransaction(m),hash:e,receipt:x})),o.abrupt("return");case 35:p++,o.next=19;break;case 38:h++,o.next=12;break;case 41:if(!f){o.next=43;break}return o.abrupt("return");case 43:this.once("block",r);case 44:case"end":return o.stop()}}),s,this)})))}),(function(e){f||s.once("block",r)}));case 5:case"end":return c.stop()}}),c,this)})))};if(f)return;c.once("block",b),s.push((function(){c.removeListener("block",b)}))}if("number"===typeof r&&r>0){var p=setTimeout((function(){u()||i(S.makeError("timeout exceeded",k.Logger.errors.TIMEOUT,{timeout:r}))}),r);p.unref&&p.unref(),s.push((function(){clearTimeout(p)}))}})));case 6:case"end":return a.stop()}}),a,this)})))}},{key:"getBlockNumber",value:function(){return E(this,void 0,void 0,(0,o.Z)().mark((function e(){return(0,o.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 E(this,void 0,void 0,(0,o.Z)().mark((function e(){var t;return(0,o.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",l.O$.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",S.throwError("bad result from backend",k.Logger.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 E(this,void 0,void 0,(0,o.Z)().mark((function r(){var n,a;return(0,o.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,x.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return a=r.sent,r.prev=8,r.abrupt("return",l.O$.from(a));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",S.throwError("bad result from backend",k.Logger.errors.SERVER_ERROR,{method:"getBalance",params:n,result:a,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return E(this,void 0,void 0,(0,o.Z)().mark((function r(){var n,a;return(0,o.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,x.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return a=r.sent,r.prev=8,r.abrupt("return",l.O$.from(a).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",S.throwError("bad result from backend",k.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:a,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return E(this,void 0,void 0,(0,o.Z)().mark((function r(){var n,a;return(0,o.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,x.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return a=r.sent,r.prev=8,r.abrupt("return",(0,h.hexlify)(a));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",S.throwError("bad result from backend",k.Logger.errors.SERVER_ERROR,{method:"getCode",params:n,result:a,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,r){return E(this,void 0,void 0,(0,o.Z)().mark((function n(){var a,i;return(0,o.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,x.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((function(e){return(0,h.hexValue)(e)}))});case 4:return a=n.sent,n.next=7,this.perform("getStorageAt",a);case 7:return i=n.sent,n.prev=8,n.abrupt("return",(0,h.hexlify)(i));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",S.throwError("bad result from backend",k.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:a,result:i,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,r){var n=this;if(null!=t&&32!==(0,h.hexDataLength)(t))throw new Error("invalid response - sendTransaction");var a=e;return null!=t&&e.hash!==t&&S.throwError("Transaction hash mismatch from Provider.sendTransaction.",k.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),a.wait=function(t,a){return E(n,void 0,void 0,(0,o.Z)().mark((function n(){var i,c;return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t=1),null==a&&(a=0),i=void 0,0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r}),n.next=6,this._waitForTransaction(e.hash,t,a,i);case 6:if(null!=(c=n.sent)||0!==t){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=c.blockNumber,0===c.status&&S.throwError("transaction failed",k.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),n.abrupt("return",c);case 12:case"end":return n.stop()}}),n,this)})))},a}},{key:"sendTransaction",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n,a,i;return(0,o.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,h.hexlify)(e)}));case 4:return r=t.sent,null==(n=this.formatter.transaction(e)).confirmations&&(n.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return a=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:r});case 13:return i=t.sent,t.abrupt("return",this._wrapTransaction(n,i,a));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=n,t.t0.transactionHash=n.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n,a=this;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return r=t.sent,n={},["from","to"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?a._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?l.O$.from(e):null})))})),["type"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return null!=e?e:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?(0,h.hexlify)(e):null})))})),t.t0=this.formatter,t.next=12,(0,x.resolveProperties)(n);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 E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n=this;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,r={},null!=e.address&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(r[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(r[t]=n._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,(0,x.resolveProperties)(r);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,r){return E(this,void 0,void 0,(0,o.Z)().mark((function n(){var a,i,c,s,f,u,d,b,p,m,x,g,v,y,w;return(0,o.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&S.throwError("CCIP read exceeded maximum redirections",k.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e}),a=e.to,n.next=4,this.perform("call",{transaction:e,blockTag:t});case 4:if(i=n.sent,!(r>=0&&"latest"===t&&null!=a&&"0x556f1830"===i.substring(0,10)&&(0,h.hexDataLength)(i)%32===4)){n.next=31;break}for(n.prev=6,c=(0,h.hexDataSlice)(i,4),s=(0,h.hexDataSlice)(c,0,32),l.O$.from(s).eq(a)||S.throwError("CCIP Read sender did not match",k.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),f=[],u=l.O$.from((0,h.hexDataSlice)(c,32,64)).toNumber(),d=l.O$.from((0,h.hexDataSlice)(c,u,u+32)).toNumber(),b=(0,h.hexDataSlice)(c,u+32),p=0;p<d;p++)null==(m=U(b,32*p))&&S.throwError("CCIP Read contained corrupt URL string",k.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),f.push(m);return x=Z(c,64),l.O$.from((0,h.hexDataSlice)(c,100,128)).isZero()||S.throwError("CCIP Read callback selector included junk",k.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),g=(0,h.hexDataSlice)(c,96,100),v=Z(c,128),n.next=21,this.ccipReadFetch(e,x,f);case 21:return null==(y=n.sent)&&S.throwError("CCIP Read disabled or provided no URLs",k.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),w={to:a,data:(0,h.hexConcat)([g,H([y,v])])},n.abrupt("return",this._call(w,t,r+1));case 27:if(n.prev=27,n.t0=n.catch(6),n.t0.code!==k.Logger.errors.SERVER_ERROR){n.next=31;break}throw n.t0;case 31:return n.prev=31,n.abrupt("return",(0,h.hexlify)(i));case 35:return n.prev=35,n.t1=n.catch(31),n.abrupt("return",S.throwError("bad result from backend",k.Logger.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:i,error:n.t1}));case 38:case"end":return n.stop()}}),n,this,[[6,27],[31,35]])})))}},{key:"call",value:function(e,t){return E(this,void 0,void 0,(0,o.Z)().mark((function r(){var n;return(0,o.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,x.resolveProperties)({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});case 4:return n=r.sent,r.abrupt("return",this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1));case 6:case"end":return r.stop()}}),r,this)})))}},{key:"estimateGas",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,(0,x.resolveProperties)({transaction:this._getTransactionRequest(e)});case 4:return r=t.sent,t.next=7,this.perform("estimateGas",r);case 7:return n=t.sent,t.prev=8,t.abrupt("return",l.O$.from(n));case 12:return t.prev=12,t.t0=t.catch(8),t.abrupt("return",S.throwError("bad result from backend",k.Logger.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:t.t0}));case 15:case"end":return t.stop()}}),t,this,[[8,12]])})))}},{key:"_getAddress",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return"string"!==typeof(e=t.sent)&&S.throwArgumentError("invalid address or ENS name","name",e),t.next=6,this.resolveName(e);case 6:return null==(r=t.sent)&&S.throwError("ENS name not configured",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(e),")")}),t.abrupt("return",r);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlock",value:function(e,t){return E(this,void 0,void 0,(0,o.Z)().mark((function r(){var n,a,i=this;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,e;case 4:if(e=r.sent,n=-128,a={includeTransactions:!!t},!(0,h.isHexString)(e,32)){r.next=11;break}a.blockHash=e,r.next=21;break;case 11:return r.prev=11,r.next=14,this._getBlockTag(e);case 14:a.blockTag=r.sent,(0,h.isHexString)(a.blockTag)&&(n=parseInt(a.blockTag.substring(2),16)),r.next=21;break;case 18:r.prev=18,r.t0=r.catch(11),S.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e);case 21:return r.abrupt("return",(0,y.poll)((function(){return E(i,void 0,void 0,(0,o.Z)().mark((function e(){var r,i,c,s,f,u,d=this;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getBlock",a);case 2:if(null!=(r=e.sent)){e.next=11;break}if(null==a.blockHash){e.next=7;break}if(null!=this._emitted["b:"+a.blockHash]){e.next=7;break}return e.abrupt("return",null);case 7:if(null==a.blockTag){e.next=10;break}if(!(n>this._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}i=null,c=0;case 14:if(!(c<r.transactions.length)){e.next=31;break}if(null!=(s=r.transactions[c]).blockNumber){e.next=20;break}s.confirmations=0,e.next=28;break;case 20:if(null!=s.confirmations){e.next=28;break}if(null!=i){e.next=25;break}return e.next=24,this._getInternalBlockNumber(100+2*this.pollingInterval);case 24:i=e.sent;case 25:(f=i-s.blockNumber+1)<=0&&(f=1),s.confirmations=f;case 28:c++,e.next=14;break;case 31:return(u=this.formatter.blockWithTransactions(r)).transactions=u.transactions.map((function(e){return d._wrapTransaction(e)})),e.abrupt("return",u);case 34:return e.abrupt("return",this.formatter.block(r));case 35:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 22:case"end":return r.stop()}}),r,this,[[11,18]])})))}},{key:"getBlock",value:function(e){return this._getBlock(e,!1)}},{key:"getBlockWithTransactions",value:function(e){return this._getBlock(e,!0)}},{key:"getTransaction",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n=this;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,e;case 4:return e=t.sent,r={transactionHash:this.formatter.hash(e,!0)},t.abrupt("return",(0,y.poll)((function(){return E(n,void 0,void 0,(0,o.Z)().mark((function t(){var n,a,i,c;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getTransaction",r);case 2:if(null!=(n=t.sent)){t.next=7;break}if(null!=this._emitted["t:"+e]){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",void 0);case 7:if(null!=(a=this.formatter.transactionResponse(n)).blockNumber){t.next=12;break}a.confirmations=0,t.next=19;break;case 12:if(null!=a.confirmations){t.next=19;break}return t.next=15,this._getInternalBlockNumber(100+2*this.pollingInterval);case 15:i=t.sent,(c=i-a.blockNumber+1)<=0&&(c=1),a.confirmations=c;case 19:return t.abrupt("return",this._wrapTransaction(a));case 20:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getTransactionReceipt",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n=this;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,e;case 4:return e=t.sent,r={transactionHash:this.formatter.hash(e,!0)},t.abrupt("return",(0,y.poll)((function(){return E(n,void 0,void 0,(0,o.Z)().mark((function t(){var n,a,i,c;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getTransactionReceipt",r);case 2:if(null!=(n=t.sent)){t.next=7;break}if(null!=this._emitted["t:"+e]){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",void 0);case 7:if(null!=n.blockHash){t.next=9;break}return t.abrupt("return",void 0);case 9:if(null!=(a=this.formatter.receipt(n)).blockNumber){t.next=14;break}a.confirmations=0,t.next=21;break;case 14:if(null!=a.confirmations){t.next=21;break}return t.next=17,this._getInternalBlockNumber(100+2*this.pollingInterval);case 17:i=t.sent,(c=i-a.blockNumber+1)<=0&&(c=1),a.confirmations=c;case 21:return t.abrupt("return",a);case 22:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getLogs",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,(0,x.resolveProperties)({filter:this._getFilter(e)});case 4:return r=t.sent,t.next=7,this.perform("getLogs",r);case 7:return(n=t.sent).forEach((function(e){null==e.removed&&(e.removed=!1)})),t.abrupt("return",I.Mb.arrayOf(this.formatter.filterLog.bind(this.formatter))(n));case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getEtherPrice",value:function(){return E(this,void 0,void 0,(0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.abrupt("return",this.perform("getEtherPrice",{}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"_getBlockTag",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:if(!("number"===typeof(e=t.sent)&&e<0)){t.next=11;break}return e%1&&S.throwArgumentError("invalid BlockTag","blockTag",e),t.next=7,this._getInternalBlockNumber(100+2*this.pollingInterval);case 7:return r=t.sent,(r+=e)<0&&(r=0),t.abrupt("return",this.formatter.blockTag(r));case 11:return t.abrupt("return",this.formatter.blockTag(e));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"getResolver",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n,a;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e;case 1:if(""!==r&&"."!==r){t.next=4;break}return t.abrupt("return",null);case 4:if("eth"===e||"eth"!==r){t.next=6;break}return t.abrupt("return",null);case 6:return t.next=8,this._getResolver(r,"getResolver");case 8:if(null==(n=t.sent)){t.next=19;break}if(a=new W(this,n,e),t.t0=r!==e,!t.t0){t.next=16;break}return t.next=15,a.supportsWildcard();case 15:t.t0=!t.sent;case 16:if(!t.t0){t.next=18;break}return t.abrupt("return",null);case 18:return t.abrupt("return",a);case 19:r=r.split(".").slice(1).join("."),t.next=1;break;case 22:case"end":return t.stop()}}),t,this)})))}},{key:"_getResolver",value:function(e,t){return E(this,void 0,void 0,(0,o.Z)().mark((function r(){var n,a;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t="ENS"),r.next=3,this.getNetwork();case 3:return(n=r.sent).ensAddress||S.throwError("network does not support ENS",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name}),r.prev=5,r.next=8,this.call({to:n.ensAddress,data:"0x0178b8bf"+(0,p.VM)(e).substring(2)});case 8:return a=r.sent,r.abrupt("return",this.formatter.callAddress(a));case 12:r.prev=12,r.t0=r.catch(5);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r,this,[[5,12]])})))}},{key:"resolveName",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,t.prev=3,t.abrupt("return",Promise.resolve(this.formatter.address(e)));case 7:if(t.prev=7,t.t0=t.catch(3),!(0,h.isHexString)(e)){t.next=11;break}throw t.t0;case 11:return"string"!==typeof e&&S.throwArgumentError("invalid ENS name","name",e),t.next=14,this.getResolver(e);case 14:if(r=t.sent){t.next=17;break}return t.abrupt("return",null);case 17:return t.next=19,r.getAddress();case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t,this,[[3,7]])})))}},{key:"lookupAddress",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n,a;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,e=this.formatter.address(e),r=e.substring(2).toLowerCase()+".addr.reverse",t.next=7,this._getResolver(r,"lookupAddress");case 7:if(null!=(n=t.sent)){t.next=10;break}return t.abrupt("return",null);case 10:return t.t0=U,t.next=13,this.call({to:n,data:"0x691f3431"+(0,p.VM)(r).substring(2)});case 13:return t.t1=t.sent,a=(0,t.t0)(t.t1,0),t.next=17,this.resolveName(a);case 17:if(t.sent==e){t.next=20;break}return t.abrupt("return",null);case 20:return t.abrupt("return",a);case 21:case"end":return t.stop()}}),t,this)})))}},{key:"getAvatar",value:function(e){return E(this,void 0,void 0,(0,o.Z)().mark((function t(){var r,n,a,i,c,s,f;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=null,!(0,h.isHexString)(e)){t.next=40;break}return n=this.formatter.address(e),a=n.substring(2).toLowerCase()+".addr.reverse",t.next=6,this._getResolver(a,"getAvatar");case 6:if(i=t.sent){t.next=9;break}return t.abrupt("return",null);case 9:return r=new W(this,i,a),t.prev=10,t.next=13,r.getAvatar();case 13:if(!(c=t.sent)){t.next=16;break}return t.abrupt("return",c.url);case 16:t.next=22;break;case 18:if(t.prev=18,t.t0=t.catch(10),t.t0.code===k.Logger.errors.CALL_EXCEPTION){t.next=22;break}throw t.t0;case 22:return t.prev=22,t.t1=U,t.next=26,this.call({to:i,data:"0x691f3431"+(0,p.VM)(a).substring(2)});case 26:return t.t2=t.sent,s=(0,t.t1)(t.t2,0),t.next=30,this.getResolver(s);case 30:r=t.sent,t.next=38;break;case 33:if(t.prev=33,t.t3=t.catch(22),t.t3.code===k.Logger.errors.CALL_EXCEPTION){t.next=37;break}throw t.t3;case 37:return t.abrupt("return",null);case 38:t.next=45;break;case 40:return t.next=42,this.getResolver(e);case 42:if(r=t.sent){t.next=45;break}return t.abrupt("return",null);case 45:return t.next=47,r.getAvatar();case 47:if(null!=(f=t.sent)){t.next=50;break}return t.abrupt("return",null);case 50:return t.abrupt("return",f.url);case 51:case"end":return t.stop()}}),t,this,[[10,18],[22,33]])})))}},{key:"perform",value:function(e,t){return S.throwError(e+" not implemented",k.Logger.errors.NOT_IMPLEMENTED,{operation:e})}},{key:"_startEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,r){var n=new D(j(e),t,r);return this._events.push(n),this._startEvent(n),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,r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];var i=!1,o=[],c=j(e);return this._events=this._events.filter((function(e){return e.tag!==c||(setTimeout((function(){e.listener.apply(t,n)}),0),i=!0,!e.once||(o.push(e),!1))})),o.forEach((function(e){t._stopEvent(e)})),i}},{key:"listenerCount",value:function(e){if(!e)return this._events.length;var t=j(e);return this._events.filter((function(e){return e.tag===t})).length}},{key:"listeners",value:function(e){if(null==e)return this._events.map((function(e){return e.listener}));var t=j(e);return this._events.filter((function(e){return e.tag===t})).map((function(e){return e.listener}))}},{key:"off",value:function(e,t){var r=this;if(null==t)return this.removeAllListeners(e);var n=[],a=!1,i=j(e);return this._events=this._events.filter((function(e){return e.tag!==i||e.listener!=t||(!!a||(a=!0,n.push(e),!1))})),n.forEach((function(e){r._stopEvent(e)})),this}},{key:"removeAllListeners",value:function(e){var t=this,r=[];if(null==e)r=this._events,this._events=[];else{var n=j(e);this._events=this._events.filter((function(e){return e.tag!==n||(r.push(e),!1)}))}return r.forEach((function(e){t._stopEvent(e)})),this}}],[{key:"getFormatter",value:function(){return null==q&&(q=new I.Mb),q}},{key:"getNetwork",value:function(e){return(0,m.H)(null==e?"homestead":e)}}]),r}(f.zt)},60943:function(e,t,r){"use strict";r.d(t,{H:function(){return L}});var n=r(27853),a=r(84531),i=r(6148),o=r(81020),c=r(18992),s=r(27166),f=r(69745),u=r(2257),d=r(49716),l=r(30520),h=r(22282),b=r(65889),p=r(9970),m=r(66720),x=r(39502),g=r(77059),v=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},y=new x.Logger(g.i);function w(){return(new Date).getTime()}function M(e){for(var t=null,r=0;r<e.length;r++){var n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||y.throwArgumentError("provider mismatch","networks",e):t=n}return t}function k(e,t){e=e.slice().sort();var r=Math.floor(e.length/2);if(e.length%2)return e[r];var n=e[r-1],a=e[r];return null!=t&&Math.abs(n-a)>t?null:(n+a)/2}function A(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(u.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return A(e)})));if("object"===typeof e){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var r=e[t];return r="function"===typeof r?"[function]":A(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var I=1;function E(e){var t=null,r=null,n=new Promise((function(n){t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:function(e){return n=n.then(e)}}}var S=[x.Logger.errors.CALL_EXCEPTION,x.Logger.errors.INSUFFICIENT_FUNDS,x.Logger.errors.NONCE_EXPIRED,x.Logger.errors.REPLACEMENT_UNDERPRICED,x.Logger.errors.UNPREDICTABLE_GAS_LIMIT],_=["address","args","errorArgs","errorSignature","method","transaction"];function N(e,t){var r={weight:e.weight};return Object.defineProperty(r,"provider",{get:function(){return e.provider}}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function j(e,t,r){var n=A;switch(t){case"getBlockNumber":return function(t){var r=t.map((function(e){return e.result})),n=k(t.map((function(e){return e.result})),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),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 k(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":n=function(e){return null==e?null:((e=(0,l.shallowCopy)(e)).confirmations=-1,A(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=(0,l.shallowCopy)(e)).transactions=e.transactions.map((function(e){return(e=(0,l.shallowCopy)(e)).confirmations=-1,e})),A(e))}:function(e){return null==e?null:A(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){var n={};r.forEach((function(t){var r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));for(var a=Object.keys(n),i=0;i<a.length;i++){var o=n[a[i]];if(o.count>=t)return o.result}}}(n,e.quorum)}function C(e,t){return v(this,void 0,void 0,(0,s.Z)().mark((function r(){var n;return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=e.provider).blockNumber&&n.blockNumber>=t||-1===t)){r.next=3;break}return r.abrupt("return",n);case 3:return r.abrupt("return",(0,b.poll)((function(){return new Promise((function(r,a){setTimeout((function(){return n.blockNumber>=t?r(n):e.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n}));case 4:case"end":return r.stop()}}),r)})))}function T(e,t,r,n){return v(this,void 0,void 0,(0,s.Z)().mark((function a(){var i,o;return(0,s.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:i=e.provider,a.t0=r,a.next="getBlockNumber"===a.t0||"getGasPrice"===a.t0?4:"getEtherPrice"===a.t0?5:"getBalance"===a.t0||"getTransactionCount"===a.t0||"getCode"===a.t0?8:"getStorageAt"===a.t0?13:"getBlock"===a.t0?18:"call"===a.t0||"estimateGas"===a.t0?23:"getTransaction"===a.t0||"getTransactionReceipt"===a.t0?30:"getLogs"===a.t0?31:37;break;case 4:return a.abrupt("return",i[r]());case 5:if(!i.getEtherPrice){a.next=7;break}return a.abrupt("return",i.getEtherPrice());case 7:return a.abrupt("break",37);case 8:if(!n.blockTag||!(0,d.isHexString)(n.blockTag)){a.next=12;break}return a.next=11,C(e,t);case 11:i=a.sent;case 12:return a.abrupt("return",i[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!(0,d.isHexString)(n.blockTag)){a.next=17;break}return a.next=16,C(e,t);case 16:i=a.sent;case 17:return a.abrupt("return",i.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!(0,d.isHexString)(n.blockTag)){a.next=22;break}return a.next=21,C(e,t);case 21:i=a.sent;case 22:return a.abrupt("return",i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!(0,d.isHexString)(n.blockTag)){a.next=27;break}return a.next=26,C(e,t);case 26:i=a.sent;case 27:if("call"!==r||!n.blockTag){a.next=29;break}return a.abrupt("return",i[r](n.transaction,n.blockTag));case 29:return a.abrupt("return",i[r](n.transaction));case 30:return a.abrupt("return",i[r](n.transactionHash));case 31:if(!((o=n.filter).fromBlock&&(0,d.isHexString)(o.fromBlock)||o.toBlock&&(0,d.isHexString)(o.toBlock))){a.next=36;break}return a.next=35,C(e,t);case 35:i=a.sent;case 36:return a.abrupt("return",i.getLogs(o));case 37:return a.abrupt("return",y.throwError("unknown method error",x.Logger.errors.UNKNOWN_ERROR,{method:r,params:n}));case 38:case"end":return a.stop()}}),a)})))}var L=function(e){(0,o.Z)(r,e);var t=(0,c.Z)(r);function r(e,a){var o;(0,n.Z)(this,r),0===e.length&&y.throwArgumentError("missing providers","providers",e);var c=e.map((function(e,t){if(f.zt.isProvider(e)){var r=(0,m.Gp)(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}var n=(0,l.shallowCopy)(e);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=(0,m.Gp)(e)?2e3:750),null==n.weight&&(n.weight=1);var a=n.weight;return(a%1||a>512||a<1)&&y.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),a),Object.freeze(n)})),s=c.reduce((function(e,t){return e+t.weight}),0);null==a?a=s/2:a>s&&y.throwArgumentError("quorum will always fail; larger than total weight","quorum",a);var u=M(c.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,l.defineReadOnly)((0,i.Z)(o),"providerConfigs",Object.freeze(c)),(0,l.defineReadOnly)((0,i.Z)(o),"quorum",a),o._highestBlockNumber=-1,o}return(0,a.Z)(r,[{key:"detectNetwork",value:function(){return v(this,void 0,void 0,(0,s.Z)().mark((function e(){var t;return(0,s.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",M(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return v(this,void 0,void 0,(0,s.Z)().mark((function r(){var n,a,i,o,c,f,u,d,b,p,m=this;return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==e){r.next=13;break}return r.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:n=r.sent,a=0;case 5:if(!(a<n.length)){r.next=12;break}if("string"!==typeof(i=n[a])){r.next=9;break}return r.abrupt("return",i);case 9:a++,r.next=5;break;case 12:throw n[0];case 13:if(-1!==this._highestBlockNumber||"getBlockNumber"===e){r.next=16;break}return r.next=16,this.getBlockNumber();case 16:o=j(this,e,t),(c=(0,h.y)(this.providerConfigs.map(l.shallowCopy))).sort((function(e,t){return e.priority-t.priority})),f=this._highestBlockNumber,u=0,d=!0,b=(0,s.Z)().mark((function r(){var n,a,i,h,b,p,x;return(0,s.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:for(n=w(),a=c.filter((function(e){return e.runner&&n-e.start<e.stallTimeout})).reduce((function(e,t){return e+t.weight}),0),i=function(){var r=c[u++],n=I++;r.start=w(),r.staller=E(r.stallTimeout),r.staller.wait((function(){r.staller=null})),r.runner=T(r,f,e,t).then((function(a){r.done=!0,r.result=a,m.listenerCount("debug")&&m.emit("debug",{action:"request",rid:n,backend:N(r,w()),request:{method:e,params:(0,l.deepCopy)(t)},provider:m})}),(function(a){r.done=!0,r.error=a,m.listenerCount("debug")&&m.emit("debug",{action:"request",rid:n,backend:N(r,w()),request:{method:e,params:(0,l.deepCopy)(t)},provider:m})})),m.listenerCount("debug")&&m.emit("debug",{action:"request",rid:n,backend:N(r,null),request:{method:e,params:(0,l.deepCopy)(t)},provider:m}),a+=r.weight};a<m.quorum&&u<c.length;)i();if(h=[],c.forEach((function(e){!e.done&&e.runner&&(h.push(e.runner),e.staller&&h.push(e.staller.getPromise()))})),!h.length){r.next=9;break}return r.next=9,Promise.race(h);case 9:if(!((b=c.filter((function(e){return e.done&&null==e.error}))).length>=m.quorum)){r.next=19;break}if(void 0===(p=o(b))){r.next=15;break}return c.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",{v:p});case 15:if(d){r.next=18;break}return r.next=18,E(100).getPromise();case 18:d=!1;case 19:if(x=c.reduce((function(e,t){if(!t.done||null==t.error)return e;var r=t.error.code;return S.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{}),Object.keys(x).forEach((function(e){var t=x[e];if(!(t.weight<m.quorum)){c.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0}));var r=t.error,n={};_.forEach((function(e){null!=r[e]&&(n[e]=r[e])})),y.throwError(r.reason||r.message,e,n)}})),0!==c.filter((function(e){return!e.done})).length){r.next=23;break}return r.abrupt("return","break");case 23:case"end":return r.stop()}}),r)}));case 23:return r.delegateYield(b(),"t0",25);case 25:if("break"!==(p=r.t0)){r.next=28;break}return r.abrupt("break",32);case 28:if("object"!==typeof p){r.next=30;break}return r.abrupt("return",p.v);case 30:r.next=23;break;case 32:return c.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",y.throwError("failed to meet quorum",x.Logger.errors.SERVER_ERROR,{method:e,params:t,results:c.map((function(e){return N(e)})),provider:this}));case 34:case"end":return r.stop()}}),r,this)})))}}]),r}(p.Zk)},66720:function(e,t,r){"use strict";r.d(t,{Ed:function(){return p},Gp:function(){return m},Mb:function(){return b},vh:function(){return g}});var n=r(27853),a=r(84531),i=r(97419),o=r(2257),c=r(49716),s=r(68624),f=r(30520),u=r(25452),d=r(39502),l=r(77059),h=new d.Logger(l.i),b=function(){function e(){(0,n.Z)(this,e),this.formats=this.getDefaultFormats()}return(0,a.Z)(e,[{key:"getDefaultFormats",value:function(){var t=this,r={},n=this.address.bind(this),a=this.bigNumber.bind(this),i=this.blockTag.bind(this),o=this.data.bind(this),c=this.hash.bind(this),s=this.hex.bind(this),u=this.number.bind(this),d=this.type.bind(this);return r.transaction={hash:c,type:d,accessList:e.allowNull(this.accessList.bind(this),null),blockHash:e.allowNull(c,null),blockNumber:e.allowNull(u,null),transactionIndex:e.allowNull(u,null),confirmations:e.allowNull(u,null),from:n,gasPrice:e.allowNull(a),maxPriorityFeePerGas:e.allowNull(a),maxFeePerGas:e.allowNull(a),gasLimit:a,to:e.allowNull(n,null),value:a,nonce:u,data:o,r:e.allowNull(this.uint256),s:e.allowNull(this.uint256),v:e.allowNull(u),creates:e.allowNull(n,null),raw:e.allowNull(o)},r.transactionRequest={from:e.allowNull(n),nonce:e.allowNull(u),gasLimit:e.allowNull(a),gasPrice:e.allowNull(a),maxPriorityFeePerGas:e.allowNull(a),maxFeePerGas:e.allowNull(a),to:e.allowNull(n),value:e.allowNull(a),data:e.allowNull((function(e){return t.data(e,!0)})),type:e.allowNull(u),accessList:e.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:u,blockNumber:u,transactionHash:c,address:n,topics:e.arrayOf(c),data:o,logIndex:u,blockHash:c},r.receipt={to:e.allowNull(this.address,null),from:e.allowNull(this.address,null),contractAddress:e.allowNull(n,null),transactionIndex:u,root:e.allowNull(s),gasUsed:a,logsBloom:e.allowNull(o),blockHash:c,transactionHash:c,logs:e.arrayOf(this.receiptLog.bind(this)),blockNumber:u,confirmations:e.allowNull(u,null),cumulativeGasUsed:a,effectiveGasPrice:e.allowNull(a),status:e.allowNull(u),type:d},r.block={hash:e.allowNull(c),parentHash:c,number:u,timestamp:u,nonce:e.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:a,gasUsed:a,miner:e.allowNull(n),extraData:o,transactions:e.allowNull(e.arrayOf(c)),baseFeePerGas:e.allowNull(a)},r.blockWithTransactions=(0,f.shallowCopy)(r.block),r.blockWithTransactions.transactions=e.allowNull(e.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:e.allowNull(i,void 0),toBlock:e.allowNull(i,void 0),blockHash:e.allowNull(c,void 0),address:e.allowNull(n,void 0),topics:e.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:e.allowNull(u),blockHash:e.allowNull(c),transactionIndex:u,removed:e.allowNull(this.boolean.bind(this)),address:n,data:e.allowFalsish(o,"0x"),topics:e.arrayOf(c),transactionHash:c,logIndex:u},r}},{key:"accessList",value:function(e){return(0,u.accessListify)(e||[])}},{key:"number",value:function(e){return"0x"===e?0:o.O$.from(e).toNumber()}},{key:"type",value:function(e){return"0x"===e||null==e?0:o.O$.from(e).toNumber()}},{key:"bigNumber",value:function(e){return o.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,c.isHexString)(e))?e.toLowerCase():h.throwArgumentError("invalid hash","value",e)}},{key:"data",value:function(e,t){var r=this.hex(e,t);if(r.length%2!==0)throw new Error("invalid data; odd-length - "+e);return r}},{key:"address",value:function(e){return(0,i.getAddress)(e)}},{key:"callAddress",value:function(e){if(!(0,c.isHexString)(e,32))return null;var t=(0,i.getAddress)((0,c.hexDataSlice)(e,12));return t===s.d?null:t}},{key:"contractAddress",value:function(e){return(0,i.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,c.isHexString)(e))return(0,c.hexValue)(e);throw new Error("invalid blockTag")}},{key:"hash",value:function(e,t){var r=this.hex(e,t);return 32!==(0,c.hexDataLength)(r)?h.throwArgumentError("invalid hash","value",e):r}},{key:"difficulty",value:function(e){if(null==e)return null;var t=o.O$.from(e);try{return t.toNumber()}catch(r){}return null}},{key:"uint256",value:function(e){if(!(0,c.isHexString)(e))throw new Error("invalid uint256");return(0,c.hexZeroPad)(e,32)}},{key:"_block",value:function(t,r){null!=t.author&&null==t.miner&&(t.miner=t.author);var n=null!=t._difficulty?t._difficulty:t.difficulty,a=e.check(r,t);return a._difficulty=null==n?null:o.O$.from(n),a}},{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&&o.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 r=e.check(this.formats.transaction,t);if(null!=t.chainId){var n=t.chainId;(0,c.isHexString)(n)&&(n=o.O$.from(n).toNumber()),r.chainId=n}else{var a=t.networkId;null==a&&null==r.v&&(a=t.chainId),(0,c.isHexString)(a)&&(a=o.O$.from(a).toNumber()),"number"!==typeof a&&null!=r.v&&((a=(r.v-35)/2)<0&&(a=0),a=parseInt(a)),"number"!==typeof a&&(a=0),r.chainId=a}return r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}},{key:"transaction",value:function(e){return(0,u.parse)(e)}},{key:"receiptLog",value:function(t){return e.check(this.formats.receiptLog,t)}},{key:"receipt",value:function(t){var r=e.check(this.formats.receipt,t);if(null!=r.root)if(r.root.length<=4){var n=o.O$.from(r.root).toNumber();0===n||1===n?(null!=r.status&&r.status!==n&&h.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):h.throwArgumentError("invalid alt-root-status","value.root",r.root)}else 66!==r.root.length&&h.throwArgumentError("invalid root hash","value.root",r.root);return null!=r.status&&(r.byzantium=!0),r}},{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 r={};for(var n in e)try{var a=e[n](t[n]);void 0!==a&&(r[n]=a)}catch(i){throw i.checkKey=n,i.checkValue=t[n],i}return r}},{key:"allowNull",value:function(e,t){return function(r){return null==r?t:e(r)}}},{key:"allowFalsish",value:function(e,t){return function(r){return r?e(r):t}}},{key:"arrayOf",value:function(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var r=[];return t.forEach((function(t){r.push(e(t))})),r}}}]),e}();function p(e){return e&&"function"===typeof e.isCommunityResource}function m(e){return p(e)&&e.isCommunityResource()}var x=!1;function g(){x||(x=!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("=========================="))}},11032:function(e,t,r){"use strict";r.r(t),r.d(t,{AlchemyProvider:function(){return o.D},AlchemyWebSocketProvider:function(){return o.V},AnkrProvider:function(){return g},BaseProvider:function(){return i.Zk},CloudflareProvider:function(){return A},EtherscanProvider:function(){return R},FallbackProvider:function(){return B.H},Formatter:function(){return d.Mb},InfuraProvider:function(){return G},InfuraWebSocketProvider:function(){return Y},IpcProvider:function(){return z},JsonRpcBatchProvider:function(){return W},JsonRpcProvider:function(){return H.r},JsonRpcSigner:function(){return H.C},NodesmithProvider:function(){return Q},PocketProvider:function(){return K},Provider:function(){return n.zt},Resolver:function(){return i.H2},StaticJsonRpcProvider:function(){return l.c},UrlJsonRpcProvider:function(){return l.l},Web3Provider:function(){return X.Q},WebSocketProvider:function(){return U.q},getDefaultProvider:function(){return ee},getNetwork:function(){return a.H},isCommunityResourcable:function(){return d.Ed},isCommunityResource:function(){return d.Gp},showThrottleMessage:function(){return d.vh}});var n=r(69745),a=r(79083),i=r(9970),o=r(54345),c=r(27853),s=r(84531),f=r(81020),u=r(18992),d=r(66720),l=r(42412),h=r(39502),b=r(77059),p=new h.Logger(b.i),m="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function x(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 p.throwArgumentError("unsupported network","name",e)}var g=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(){return(0,c.Z)(this,r),t.apply(this,arguments)}return(0,s.Z)(r,[{key:"isCommunityResource",value:function(){return this.apiKey===m}}],[{key:"getApiKey",value:function(e){return null==e?m:e}},{key:"getUrl",value:function(e,t){null==t&&(t=m);var r={allowGzip:!0,url:"https://"+x(e.name)+t,throttleCallback:function(e,r){return t.apiKey===m&&(0,d.vh)(),Promise.resolve(!0)}};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}]),r}(l.l),v=r(27166),y=r(44474),w=r(53538),M=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},k=new h.Logger(b.i),A=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(){return(0,c.Z)(this,r),t.apply(this,arguments)}return(0,s.Z)(r,[{key:"perform",value:function(e,t){var n=this,a=Object.create(null,{perform:{get:function(){return(0,y.Z)((0,w.Z)(r.prototype),"perform",n)}}});return M(this,void 0,void 0,(0,v.Z)().mark((function r(){var n;return(0,v.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("getBlockNumber"!==e){r.next=5;break}return r.next=3,a.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return n=r.sent,r.abrupt("return",n.number);case 5:return r.abrupt("return",a.perform.call(this,e,t));case 6:case"end":return r.stop()}}),r,this)})))}}],[{key:"getApiKey",value:function(e){return null!=e&&k.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var r=null;if("homestead"===e.name)r="https://cloudflare-eth.com/";else k.throwArgumentError("unsupported network","network",arguments[0]);return r}}]),r}(l.l),I=r(6148),E=r(49716),S=r(30520),_=r(25452),N=r(65889),j=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},C=new h.Logger(b.i);function T(e){var t={};for(var r in e)if(null!=e[r]){var n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,E.hexValue)((0,E.hexlify)(n)):"accessList"===r?"["+(0,_.accessListify)(n).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":(0,E.hexlify)(n),t[r]=n)}return t}function L(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 D(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 r=new Error("invalid response");throw r.result=JSON.stringify(e),r}if(e.error){var n=new Error(e.error.message||"unknown error");throw e.error.code&&(n.code=e.error.code),e.error.data&&(n.data=e.error.data),n}return e.result}function O(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function P(e,t,r){if("call"===e&&t.code===h.Logger.errors.SERVER_ERROR){var n=t.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var a=n.data;if(a&&(a="0x"+a.replace(/^.*0x/i,"")),(0,E.isHexString)(a))return a;C.throwError("missing revert data in call exception",h.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var i=t.message;throw t.code===h.Logger.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?i=t.error.message:"string"===typeof t.body?i=t.body:"string"===typeof t.responseText&&(i=t.responseText)),(i=(i||"").toLowerCase()).match(/insufficient funds/)&&C.throwError("insufficient funds for intrinsic transaction cost",h.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&C.throwError("nonce has already been used",h.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),i.match(/another transaction with same nonce/)&&C.throwError("replacement fee too low",h.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),i.match(/execution failed due to an exception|execution reverted/)&&C.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}var R=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(e,n){var a;return(0,c.Z)(this,r),a=t.call(this,e),(0,S.defineReadOnly)((0,I.Z)(a),"baseUrl",a.getBaseUrl()),(0,S.defineReadOnly)((0,I.Z)(a),"apiKey",n||null),a}return(0,s.Z)(r,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-kovan":return"https://api-kovan-optimistic.etherscan.io"}return C.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(e,t){var r=Object.keys(t).reduce((function(e,r){var n=t[r];return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}},{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,r){return j(this,void 0,void 0,(0,v.Z)().mark((function n(){var a,i,o,c,s,f,u=this;return(0,v.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,o="proxy"===e?D:L,this.emit("debug",{action:"request",request:a,provider:this}),c={url:a,throttleSlotInterval:1e3,throttleCallback:function(e,t){return u.isCommunityResource()&&(0,d.vh)(),Promise.resolve(!0)}},s=null,i&&(c.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map((function(e){return"".concat(e,"=").concat(i[e])})).join("&")),n.next=9,(0,N.fetchJson)(c,s,o||D);case 9:return f=n.sent,this.emit("debug",{action:"response",request:a,response:(0,S.deepCopy)(f),provider:this}),n.abrupt("return",f);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return j(this,void 0,void 0,(0,v.Z)().mark((function e(){return(0,v.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 n=this,a=Object.create(null,{perform:{get:function(){return(0,y.Z)((0,w.Z)(r.prototype),"perform",n)}}});return j(this,void 0,void 0,(0,v.Z)().mark((function r(){var n,i,o,c,s,f,u,d,l;return(0,v.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=e,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72;break;case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return P("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){r.next=12;break}return r.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 r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){r.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(n=T(t.transaction)).module="proxy",n.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",n,!0);case 23:return r.abrupt("return",r.sent);case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",P("call",r.t1,t.transaction));case 29:return(i=T(t.transaction)).module="proxy",i.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",i,!0);case 35:return r.abrupt("return",r.sent);case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",P("estimateGas",r.t2,t.transaction));case 41:return o={action:"getLogs"},t.filter.fromBlock&&(o.fromBlock=O(t.filter.fromBlock)),t.filter.toBlock&&(o.toBlock=O(t.filter.toBlock)),t.filter.address&&(o.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&C.throwError("unsupported topic count",h.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"===typeof(c=t.filter.topics[0])&&66===c.length||C.throwError("unsupported topic format",h.Logger.errors.UNSUPPORTED_OPERATION,{topic0:c}),o.topic0=c)),r.next=48,this.fetch("logs",o);case 48:s=r.sent,f={},u=0;case 51:if(!(u<s.length)){r.next=64;break}if(null==(d=s[u]).blockHash){r.next=55;break}return r.abrupt("continue",61);case 55:if(null!=f[d.blockNumber]){r.next=60;break}return r.next=58,this.getBlock(d.blockNumber);case 58:(l=r.sent)&&(f[d.blockNumber]=l.hash);case 60:d.blockHash=f[d.blockNumber];case 61:u++,r.next=51;break;case 64:return r.abrupt("return",s);case 65:if("homestead"===this.network.name){r.next=67;break}return r.abrupt("return",0);case 67:return r.t3=parseFloat,r.next=70,this.fetch("stats",{action:"ethprice"});case 70:return r.t4=r.sent.ethusd,r.abrupt("return",(0,r.t3)(r.t4));case 72:return r.abrupt("break",73);case 73:return r.abrupt("return",a.perform.call(this,e,t));case 74:case"end":return r.stop()}}),r,this,[[20,26],[32,38]])})))}},{key:"getHistory",value:function(e,t,r){return j(this,void 0,void 0,(0,v.Z)().mark((function n(){var a,i,o=this;return(0,v.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.resolveName(e);case 2:return n.t0=n.sent,n.t1=null==t?0:t,n.t2=null==r?99999999:r,a={action:"txlist",address:n.t0,startblock:n.t1,endblock:n.t2,sort:"asc"},n.next=8,this.fetch("account",a);case 8:return i=n.sent,n.abrupt("return",i.map((function(e){["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);var t=o.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t})));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"isCommunityResource",value:function(){return null==this.apiKey}}]),r}(i.Zk),B=r(60943),z=null,U=r(75080),Z=new h.Logger(b.i),F="84842078b09946638c03157f83405213",Y=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(e,n){var a;(0,c.Z)(this,r);var i=new G(e,n),o=i.connection;o.password&&Z.throwError("INFURA WebSocket project secrets unsupported",h.Logger.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});var s=o.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");return a=t.call(this,s,e),(0,S.defineReadOnly)((0,I.Z)(a),"apiKey",i.projectId),(0,S.defineReadOnly)((0,I.Z)(a),"projectId",i.projectId),(0,S.defineReadOnly)((0,I.Z)(a),"projectSecret",i.projectSecret),a}return(0,s.Z)(r,[{key:"isCommunityResource",value:function(){return this.projectId===F}}]),r}(U.q),G=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(){return(0,c.Z)(this,r),t.apply(this,arguments)}return(0,s.Z)(r,[{key:"isCommunityResource",value:function(){return this.projectId===F}}],[{key:"getWebSocketProvider",value:function(e,t){return new Y(e,t)}},{key:"getApiKey",value:function(e){var t={apiKey:F,projectId:F,projectSecret:null};return null==e||("string"===typeof e?t.projectId=e:null!=e.projectSecret?(Z.assertArgument("string"===typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Z.assertArgument("string"===typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}},{key:"getUrl",value:function(e,t){var r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"ropsten":r="ropsten.infura.io";break;case"rinkeby":r="rinkeby.infura.io";break;case"kovan":r="kovan.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-kovan":r="optimism-kovan.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-rinkeby":r="arbitrum-rinkeby.infura.io";break;default:Z.throwError("unsupported network",h.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}var n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:function(e,r){return t.projectId===F&&(0,d.vh)(),Promise.resolve(!0)}};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}}]),r}(l.l),H=r(11420),W=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(){return(0,c.Z)(this,r),t.apply(this,arguments)}return(0,s.Z)(r,[{key:"send",value:function(e,t){var r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);var a={request:n,resolve:null,reject:null},i=new Promise((function(e,t){a.resolve=e,a.reject=t}));return this._pendingBatch.push(a),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((function(){var e=r._pendingBatch;r._pendingBatch=null,r._pendingBatchAggregator=null;var t=e.map((function(e){return e.request}));return r.emit("debug",{action:"requestBatch",request:(0,S.deepCopy)(t),provider:r}),(0,N.fetchJson)(r.connection,JSON.stringify(t)).then((function(n){r.emit("debug",{action:"response",request:t,response:n,provider:r}),e.forEach((function(e,t){var r=n[t];if(r.error){var a=new Error(r.error.message);a.code=r.error.code,a.data=r.error.data,e.reject(a)}else e.resolve(r.result)}))}),(function(n){r.emit("debug",{action:"response",error:n,request:t,provider:r}),e.forEach((function(e){e.reject(n)}))}))}),10)),i}}]),r}(H.r),q=new h.Logger(b.i),Q=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(){return(0,c.Z)(this,r),t.apply(this,arguments)}return(0,s.Z)(r,null,[{key:"getApiKey",value:function(e){return e&&"string"!==typeof e&&q.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}},{key:"getUrl",value:function(e,t){q.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");var r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:q.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}]),r}(l.l),V=new h.Logger(b.i),J="62e1ad51b37b8e00394bda3b",K=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(){return(0,c.Z)(this,r),t.apply(this,arguments)}return(0,s.Z)(r,[{key:"isCommunityResource",value:function(){return this.applicationId===J}}],[{key:"getApiKey",value:function(e){var t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId=J:"string"===typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:V.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}},{key:"getUrl",value:function(e,t){var r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:V.throwError("unsupported network",h.Logger.errors.INVALID_ARGUMENT,{argument:"network",value:e})}var n={headers:{},url:"https://".concat(r,"/v1/lb/").concat(t.applicationId)};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}}]),r}(l.l),X=r(60723),$=new h.Logger(b.i);function ee(e,t){if(null==e&&(e="homestead"),"string"===typeof e){var r=e.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new H.r(e);case"ws":case"wss":return new U.q(e);default:$.throwArgumentError("unsupported URL scheme","network",e)}}var n=(0,a.H)(e);return n&&n._defaultProvider||$.throwError("unsupported getDefaultProvider network",h.Logger.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),n._defaultProvider({FallbackProvider:B.H,AlchemyProvider:o.D,AnkrProvider:g,CloudflareProvider:A,EtherscanProvider:R,InfuraProvider:G,JsonRpcProvider:H.r,NodesmithProvider:Q,PocketProvider:K,Web3Provider:X.Q,IpcProvider:z},t)}},11420:function(e,t,r){"use strict";r.d(t,{C:function(){return C},r:function(){return D}});var n=r(44474),a=r(53538),i=r(27166),o=r(27853),c=r(84531),s=r(6148),f=r(81020),u=r(18992),d=r(68408),l=r(2257),h=r(49716),b=r(35992),p=r(30520),m=r(83374),x=r(25452),g=r(65889),v=r(39502),y=r(77059),w=r(9970),M=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},k=new v.Logger(y.i),A=["call","estimateGas"];function I(e,t){if(null==e)return null;if("string"===typeof e.message&&e.message.match("reverted")){var r=(0,h.isHexString)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"===typeof e){for(var n in e){var a=I(e[n],t);if(a)return a}return null}if("string"===typeof e)try{return I(JSON.parse(e),t)}catch(i){}return null}function E(e,t,r){var n=r.transaction||r.signedTransaction;if("call"===e){var a=I(t,!0);if(a)return a.data;k.throwError("missing revert data in call exception; Transaction reverted without a reason string",v.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){var i=I(t.body,!1);null==i&&(i=I(t,!1)),i&&k.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",v.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:i.message,method:e,transaction:n,error:t})}var o=t.message;throw t.code===v.Logger.errors.SERVER_ERROR&&t.error&&"string"===typeof t.error.message?o=t.error.message:"string"===typeof t.body?o=t.body:"string"===typeof t.responseText&&(o=t.responseText),(o=(o||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit/i)&&k.throwError("insufficient funds for intrinsic transaction cost",v.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),o.match(/nonce (is )?too low/i)&&k.throwError("nonce has already been used",v.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&k.throwError("replacement fee too low",v.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),o.match(/only replay-protected/i)&&k.throwError("legacy pre-eip-155 transactions not supported",v.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),A.indexOf(e)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&k.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",v.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function S(e){return new Promise((function(t){setTimeout(t,e)}))}function _(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 N(e){return e?e.toLowerCase():e}var j={},C=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(e,n,a){var i;if((0,o.Z)(this,r),i=t.call(this),e!==j)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return(0,p.defineReadOnly)((0,s.Z)(i),"provider",n),null==a&&(a=0),"string"===typeof a?((0,p.defineReadOnly)((0,s.Z)(i),"_address",i.provider.formatter.address(a)),(0,p.defineReadOnly)((0,s.Z)(i),"_index",null)):"number"===typeof a?((0,p.defineReadOnly)((0,s.Z)(i),"_index",a),(0,p.defineReadOnly)((0,s.Z)(i),"_address",null)):k.throwArgumentError("invalid address or index","addressOrIndex",a),i}return(0,c.Z)(r,[{key:"connect",value:function(e){return k.throwError("cannot alter JSON-RPC Signer connection",v.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new T(j,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&&k.throwError("unknown account #"+e._index,v.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=(0,p.shallowCopy)(e);var r=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var n=(0,p.shallowCopy)(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return M(t,void 0,void 0,(0,i.Z)().mark((function t(){var r;return(0,i.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==(r=t.sent)&&k.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))}))),(0,p.resolveProperties)({tx:(0,p.resolveProperties)(e),sender:r}).then((function(r){var n=r.tx,a=r.sender;null!=n.from?n.from.toLowerCase()!==a&&k.throwArgumentError("from address mismatch","transaction",e):n.from=a;var i=t.provider.constructor.hexlifyTransaction(n,{from:!0});return t.provider.send("eth_sendTransaction",[i]).then((function(e){return e}),(function(e){return"string"===typeof e.message&&e.message.match(/user denied/i)&&k.throwError("user rejected transaction",v.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),E("sendTransaction",e,i)}))}))}},{key:"signTransaction",value:function(e){return k.throwError("signing transactions is unsupported",v.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return M(this,void 0,void 0,(0,i.Z)().mark((function t(){var r,n,a=this;return(0,i.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 r=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return n=t.sent,t.prev=6,t.next=9,(0,g.poll)((function(){return M(a,void 0,void 0,(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.provider.getTransaction(n);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,n,r));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=n,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return M(this,void 0,void 0,(0,i.Z)().mark((function t(){var r,n;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"===typeof e?(0,m.Y0)(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[(0,h.hexlify)(r),n.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)&&k.throwError("user rejected signing",v.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(e){return M(this,void 0,void 0,(0,i.Z)().mark((function t(){var r,n;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"===typeof e?(0,m.Y0)(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("eth_sign",[n.toLowerCase(),(0,h.hexlify)(r)]);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)&&k.throwError("user rejected signing",v.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_signTypedData",value:function(e,t,r){return M(this,void 0,void 0,(0,i.Z)().mark((function n(){var a,o,c=this;return(0,i.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,b.E.resolveNames(e,t,r,(function(e){return c.provider.resolveName(e)}));case 2:return a=n.sent,n.next=5,this.getAddress();case 5:return o=n.sent,n.prev=6,n.next=9,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(b.E.getPayload(a.domain,t,a.value))]);case 9:return n.abrupt("return",n.sent);case 12:throw n.prev=12,n.t0=n.catch(6),"string"===typeof n.t0.message&&n.t0.message.match(/user denied/i)&&k.throwError("user rejected signing",v.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:a.domain,types:t,value:a.value}}),n.t0;case 16:case"end":return n.stop()}}),n,this,[[6,12]])})))}},{key:"unlock",value:function(e){return M(this,void 0,void 0,(0,i.Z)().mark((function t(){var r,n;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.provider,t.next=3,this.getAddress();case 3:return n=t.sent,t.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),r}(d.Signer),T=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(){return(0,o.Z)(this,r),t.apply(this,arguments)}return(0,c.Z)(r,[{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(r){return t.provider.waitForTransaction(e,r)}}}))}}]),r}(C),L={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},D=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(e,n){var a;(0,o.Z)(this,r);var i=n;return null==i&&(i=new Promise((function(e,t){setTimeout((function(){a.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),a=t.call(this,i),e||(e=(0,p.getStatic)(a.constructor,"defaultUrl")()),"string"===typeof e?(0,p.defineReadOnly)((0,s.Z)(a),"connection",Object.freeze({url:e})):(0,p.defineReadOnly)((0,s.Z)(a),"connection",Object.freeze((0,p.shallowCopy)(e))),a._nextId=42,a}return(0,c.Z)(r,[{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 M(this,void 0,void 0,(0,i.Z)().mark((function e(){var t,r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(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 r=(0,p.getStatic)(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",r(l.O$.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",k.throwError("could not detect network",v.Logger.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",k.throwError("could not detect network",v.Logger.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 C(j,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 r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,p.deepCopy)(n),provider:this});var a=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(a&&this._cache[e])return this._cache[e];var i=(0,g.fetchJson)(this.connection,JSON.stringify(n),_).then((function(e){return r.emit("debug",{action:"response",request:n,response:e,provider:r}),e}),(function(e){throw r.emit("debug",{action:"response",error:e,request:n,provider:r}),e}));return a&&(this._cache[e]=i,setTimeout((function(){r._cache[e]=null}),0)),i}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[N(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[N(t.address),t.blockTag]];case"getCode":return["eth_getCode",[N(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[N(t.address),(0,h.hexZeroPad)(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,p.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,p.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=N(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return M(this,void 0,void 0,(0,i.Z)().mark((function r(){var n,a,o;return(0,i.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==e&&"estimateGas"!==e){r.next=8;break}if(!(n=t.transaction)||null==n.type||!l.O$.from(n.type).isZero()){r.next=8;break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8;break}return r.next=6,this.getFeeData();case 6:null==(a=r.sent).maxFeePerGas&&null==a.maxPriorityFeePerGas&&((t=(0,p.shallowCopy)(t)).transaction=(0,p.shallowCopy)(n),delete t.transaction.type);case 8:return null==(o=this.prepareRequest(e,t))&&k.throwError(e+" not implemented",v.Logger.errors.NOT_IMPLEMENTED,{operation:e}),r.prev=10,r.next=13,this.send(o[0],o[1]);case 13:return r.abrupt("return",r.sent);case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",E(e,r.t0,t));case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),(0,n.Z)((0,a.Z)(r.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(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;var n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return S(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((function(e){}))}(),r})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),(0,n.Z)((0,a.Z)(r.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var r=(0,p.shallowCopy)(L);if(t)for(var n in t)t[n]&&(r[n]=!0);(0,p.checkProperties)(e,r);var a={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var r=(0,h.hexValue)(l.O$.from(e[t]));"gasLimit"===t&&(t="gas"),a[t]=r}})),["from","to","data"].forEach((function(t){null!=e[t]&&(a[t]=(0,h.hexlify)(e[t]))})),e.accessList&&(a.accessList=(0,x.accessListify)(e.accessList)),a}}]),r}(w.Zk)},42412:function(e,t,r){"use strict";r.d(t,{c:function(){return x},l:function(){return g}});var n=r(6148),a=r(27166),i=r(27853),o=r(84531),c=r(44474),s=r(53538),f=r(81020),u=r(18992),d=r(30520),l=r(39502),h=r(77059),b=r(11420),p=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},m=new l.Logger(h.i),x=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(){return(0,i.Z)(this,r),t.apply(this,arguments)}return(0,o.Z)(r,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return(0,c.Z)((0,s.Z)(r.prototype),"detectNetwork",e)}}});return p(this,void 0,void 0,(0,a.Z)().mark((function e(){var r;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=this.network)){e.next=7;break}return e.next=4,t.detectNetwork.call(this);case 4:(r=e.sent)||m.throwError("no network detected",l.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,d.defineReadOnly)(this,"_network",r),this.emit("network",r,null));case 7:return e.abrupt("return",r);case 8:case"end":return e.stop()}}),e,this)})))}}]),r}(b.r),g=function(e){(0,f.Z)(r,e);var t=(0,u.Z)(r);function r(e,a){var o;(0,i.Z)(this,r),m.checkAbstract(this instanceof r?this.constructor:void 0,r),e=(0,d.getStatic)(this instanceof r?this.constructor:void 0,"getNetwork")(e),a=(0,d.getStatic)(this instanceof r?this.constructor:void 0,"getApiKey")(a);var c=(0,d.getStatic)(this instanceof r?this.constructor:void 0,"getUrl")(e,a);return o=t.call(this,c,e),"string"===typeof a?(0,d.defineReadOnly)((0,n.Z)(o),"apiKey",a):null!=a&&Object.keys(a).forEach((function(e){(0,d.defineReadOnly)((0,n.Z)(o),e,a[e])})),o}return(0,o.Z)(r,[{key:"_startPending",value:function(){m.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return m.throwError("API provider does not support signing",l.Logger.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 m.throwError("not implemented; sub-classes must override getUrl",l.Logger.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),r}(x)},60723:function(e,t,r){"use strict";r.d(t,{Q:function(){return p}});var n=r(27853),a=r(84531),i=r(6148),o=r(81020),c=r(18992),s=r(30520),f=r(39502),u=r(77059),d=r(11420),l=new f.Logger(u.i),h=1;function b(e,t){var r="Web3LegacyFetcher";return function(e,n){var a=this,i={method:e,params:n,id:h++,jsonrpc:"2.0"};return new Promise((function(e,n){a.emit("debug",{action:"request",fetcher:r,request:(0,s.deepCopy)(i),provider:a}),t(i,(function(t,o){if(t)return a.emit("debug",{action:"response",fetcher:r,error:t,request:i,provider:a}),n(t);if(a.emit("debug",{action:"response",fetcher:r,request:i,response:o,provider:a}),o.error){var c=new Error(o.error.message);return c.code=o.error.code,c.data=o.error.data,n(c)}e(o.result)}))}))}}var p=function(e){(0,o.Z)(r,e);var t=(0,c.Z)(r);function r(e,a){var o;(0,n.Z)(this,r),null==e&&l.throwArgumentError("missing provider","provider",e);var c=null,f=null,u=null;return"function"===typeof e?(c="unknown:",f=e):(!(c=e.host||e.path||"")&&e.isMetaMask&&(c="metamask"),u=e,e.request?(""===c&&(c="eip-1193:"),f=function(e){return function(t,r){var n=this;null==r&&(r=[]);var a={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,s.deepCopy)(a),provider:this}),e.request(a).then((function(e){return n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:a,response:e,provider:n}),e}),(function(e){throw n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:a,error:e,provider:n}),e}))}}(e)):e.sendAsync?f=b(0,e.sendAsync.bind(e)):e.send?f=b(0,e.send.bind(e)):l.throwArgumentError("unsupported provider","provider",e),c||(c="unknown:")),o=t.call(this,c,a),(0,s.defineReadOnly)((0,i.Z)(o),"jsonRpcFetchFunc",f),(0,s.defineReadOnly)((0,i.Z)(o),"provider",u),o}return(0,a.Z)(r,[{key:"send",value:function(e,t){return this.jsonRpcFetchFunc(e,t)}}]),r}(d.r)},75080:function(e,t,r){"use strict";r.d(t,{q:function(){return M}});var n=r(27166),a=r(27853),i=r(84531),o=r(55679),c=r(6148),s=r(81020),f=r(18992),u=r(44474),d=r(53538),l=r(2257),h=r(30520),b=r(11420),p=r(39502),m=r(77059),x=null;try{if(null==(x=WebSocket))throw new Error("inject please")}catch(k){var g=new p.Logger(m.i);x=function(){g.throwError("WebSockets not supported in this environment",p.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var v=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},y=new p.Logger(m.i),w=1,M=function(e){(0,s.Z)(r,e);var t=(0,f.Z)(r);function r(e,n){var i,s;(0,a.Z)(this,r),"any"===n&&y.throwError("WebSocketProvider does not support 'any' network yet",p.Logger.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(s="string"===typeof e?t.call(this,e,n):t.call(this,"_websocket",n))._pollingInterval=-1,s._wsReady=!1,"string"===typeof e?(0,h.defineReadOnly)((0,c.Z)(s),"_websocket",new x(s.connection.url)):(0,h.defineReadOnly)((0,c.Z)(s),"_websocket",e),(0,h.defineReadOnly)((0,c.Z)(s),"_requests",{}),(0,h.defineReadOnly)((0,c.Z)(s),"_subs",{}),(0,h.defineReadOnly)((0,c.Z)(s),"_subIds",{}),(0,h.defineReadOnly)((0,c.Z)(s),"_detectNetwork",(0,u.Z)((i=(0,c.Z)(s),(0,d.Z)(r.prototype)),"detectNetwork",i).call(i)),s.websocket.onopen=function(){s._wsReady=!0,Object.keys(s._requests).forEach((function(e){s.websocket.send(s._requests[e].payload)}))},s.websocket.onmessage=function(e){var t=e.data,r=JSON.parse(t);if(null!=r.id){var n=String(r.id),a=s._requests[n];if(delete s._requests[n],void 0!==r.result)a.callback(null,r.result),s.emit("debug",{action:"response",request:JSON.parse(a.payload),response:r.result,provider:(0,c.Z)(s)});else{var i=null;r.error?(i=new Error(r.error.message||"unknown error"),(0,h.defineReadOnly)(i,"code",r.error.code||null),(0,h.defineReadOnly)(i,"response",t)):i=new Error("unknown error"),a.callback(i,void 0),s.emit("debug",{action:"response",error:i,request:JSON.parse(a.payload),provider:(0,c.Z)(s)})}}else if("eth_subscription"===r.method){var o=s._subs[r.params.subscription];o&&o.processFunc(r.params.result)}else console.warn("this should not happen")};var f=setInterval((function(){s.emit("poll")}),1e3);return f.unref&&f.unref(),(0,o.Z)(s)}return(0,i.Z)(r,[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){y.throwError("cannot set polling interval on WebSocketProvider",p.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){y.throwError("cannot reset events block on WebSocketProvider",p.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return v(this,void 0,void 0,(0,n.Z)().mark((function e(){return(0,n.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&&y.throwError("cannot set polling on WebSocketProvider",p.Logger.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var r=this,n=w++;return new Promise((function(a,i){var o=JSON.stringify({method:e,params:t,id:n,jsonrpc:"2.0"});r.emit("debug",{action:"request",request:JSON.parse(o),provider:r}),r._requests[String(n)]={callback:function(e,t){return e?i(e):a(t)},payload:o},r._wsReady&&r.websocket.send(o)}))}},{key:"_subscribe",value:function(e,t,r){return v(this,void 0,void 0,(0,n.Z)().mark((function a(){var i,o,c=this;return(0,n.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==(i=this._subIds[e])&&(i=Promise.all(t).then((function(e){return c.send("eth_subscribe",e)})),this._subIds[e]=i),n.next=4,i;case 4:o=n.sent,this._subs[o]={tag:e,processFunc:r};case 6:case"end":return n.stop()}}),a,this)})))}},{key:"_startEvent",value:function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],(function(e){var r=l.O$.from(e.number).toNumber();t._emitted.block=r,t.emit("block",r)}));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(r){null==r.removed&&(r.removed=!1),t.emit(e.filter,t.formatter.filterLog(r))}));break;case"tx":var r=function(e){var r=e.hash;t.getTransactionReceipt(r).then((function(e){e&&t.emit(r,e)}))};r(e),this._subscribe("tx",["newHeads"],(function(e){t._events.filter((function(e){return"tx"===e.type})).forEach(r)}));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,r=e.tag;if("tx"===e.type){if(this._events.filter((function(e){return"tx"===e.type})).length)return;r="tx"}else if(this.listenerCount(e.event))return;var n=this._subIds[r];n&&(delete this._subIds[r],n.then((function(e){t._subs[e]&&(delete t._subs[e],t.send("eth_unsubscribe",[e]))})))}},{key:"destroy",value:function(){return v(this,void 0,void 0,(0,n.Z)().mark((function e(){var t=this;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.websocket.readyState!==x.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"}}]),r}(b.r)},53770:function(e,t,r){"use strict";r.r(t),r.d(t,{randomBytes:function(){return n.O},shuffled:function(){return a.y}});var n=r(15244),a=r(22282)},15244:function(e,t,r){"use strict";r.d(t,{O:function(){return s}});var n=r(49716),a=r(39502),i=new a.Logger("random/5.7.0");var o=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw new Error("unable to locate global object")}(),c=o.crypto||o.msCrypto;function s(e){(e<=0||e>1024||e%1||e!=e)&&i.throwArgumentError("invalid length","length",e);var t=new Uint8Array(e);return c.getRandomValues(t),(0,n.arrayify)(t)}c&&c.getRandomValues||(i.warn("WARNING: Missing strong random number source"),c={getRandomValues:function(e){return i.throwError("no secure random source avaialble",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},22282:function(e,t,r){"use strict";function n(e){for(var t=(e=e.slice()).length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}r.d(t,{y:function(){return n}})},17986:function(e,t,r){"use strict";r.r(t),r.d(t,{decode:function(){return l},encode:function(){return f}});var n=r(49716),a=r(39502),i=new a.Logger("rlp/5.7.0");function o(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function c(e,t,r){for(var n=0,a=0;a<r;a++)n=256*n+e[t+a];return n}function s(e){if(Array.isArray(e)){var t=[];if(e.forEach((function(e){t=t.concat(s(e))})),t.length<=55)return t.unshift(192+t.length),t;var r=o(t.length);return r.unshift(247+r.length),r.concat(t)}(0,n.isBytesLike)(e)||i.throwArgumentError("RLP object must be BytesLike","object",e);var a=Array.prototype.slice.call((0,n.arrayify)(e));if(1===a.length&&a[0]<=127)return a;if(a.length<=55)return a.unshift(128+a.length),a;var c=o(a.length);return c.unshift(183+c.length),c.concat(a)}function f(e){return(0,n.hexlify)(s(e))}function u(e,t,r,n){for(var o=[];r<t+1+n;){var c=d(e,r);o.push(c.result),(r+=c.consumed)>t+1+n&&i.throwError("child data too short",a.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function d(e,t){if(0===e.length&&i.throwError("data too short",a.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&i.throwError("data short segment too short",a.Logger.errors.BUFFER_OVERRUN,{});var o=c(e,t+1,r);return t+1+r+o>e.length&&i.throwError("data long segment too short",a.Logger.errors.BUFFER_OVERRUN,{}),u(e,t,t+1+r,r+o)}if(e[t]>=192){var s=e[t]-192;return t+1+s>e.length&&i.throwError("data array too short",a.Logger.errors.BUFFER_OVERRUN,{}),u(e,t,t+1,s)}if(e[t]>=184){var f=e[t]-183;t+1+f>e.length&&i.throwError("data array too short",a.Logger.errors.BUFFER_OVERRUN,{});var d=c(e,t+1,f);return t+1+f+d>e.length&&i.throwError("data array too short",a.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+f+d,result:(0,n.hexlify)(e.slice(t+1+f,t+1+f+d))}}if(e[t]>=128){var l=e[t]-128;return t+1+l>e.length&&i.throwError("data too short",a.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+l,result:(0,n.hexlify)(e.slice(t+1,t+1+l))}}return{consumed:1,result:(0,n.hexlify)(e[t])}}function l(e){var t=(0,n.arrayify)(e),r=d(t,0);return r.consumed!==t.length&&i.throwArgumentError("invalid rlp data","data",e),r.result}},86620:function(e,t,r){"use strict";r.r(t),r.d(t,{SupportedAlgorithm:function(){return a.p},computeHmac:function(){return n.Gy},ripemd160:function(){return n.bP},sha256:function(){return n.JQ},sha512:function(){return n.o}});var n=r(39598),a=r(24667)},39598:function(e,t,r){"use strict";r.d(t,{Gy:function(){return l},bP:function(){return f},JQ:function(){return u},o:function(){return d}});var n=r(33125),a=r.n(n),i=r(49716),o=r(24667),c=r(39502),s=new c.Logger("sha2/5.7.0");function f(e){return"0x"+a().ripemd160().update((0,i.arrayify)(e)).digest("hex")}function u(e){return"0x"+a().sha256().update((0,i.arrayify)(e)).digest("hex")}function d(e){return"0x"+a().sha512().update((0,i.arrayify)(e)).digest("hex")}function l(e,t,r){return o.p[e]||s.throwError("unsupported algorithm "+e,c.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+a().hmac(a()[e],(0,i.arrayify)(t)).update((0,i.arrayify)(r)).digest("hex")}},24667:function(e,t,r){"use strict";var n;r.d(t,{p:function(){return n}}),function(e){e.sha256="sha256",e.sha512="sha512"}(n||(n={}))},78865:function(e,t,r){"use strict";r.r(t),r.d(t,{SigningKey:function(){return J},computePublicKey:function(){return X},recoverPublicKey:function(){return K}});var n=r(27853),a=r(84531),i=r(29286),o=r.n(i),c=r(33125),s=r.n(c);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:"undefined"!==typeof self&&self;function f(e,t,r){return r={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)&&r.path)}},e(r,r.exports),r.exports}var u=d;function d(e,t){if(!e)throw new Error(t||"Assertion failed")}d.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var l=f((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!==typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var a=e.charCodeAt(n),i=a>>8,o=255&a;i?r.push(i,o):r.push(o)}return r},r.zero2=n,r.toHex=a,r.encode=function(e,t){return"hex"===t?a(e):e}})),h=f((function(e,t){var r=t;r.assert=u,r.toArray=l.toArray,r.zero2=l.zero2,r.toHex=l.toHex,r.encode=l.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var a=1<<t+1,i=e.clone(),o=0;o<n.length;o++){var c,s=i.andln(a-1);i.isOdd()?(c=s>(a>>1)-1?(a>>1)-s:s,i.isubn(c)):c=0,n[o]=c,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,c,s=e.andln(3)+a&3,f=t.andln(3)+i&3;3===s&&(s=-1),3===f&&(f=-1),o=0===(1&s)?0:3!==(n=e.andln(7)+a&7)&&5!==n||2!==f?s:-s,r[0].push(o),c=0===(1&f)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==s?f:-f,r[1].push(c),2*a===o+1&&(a=1-a),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(o())(e,"hex","le")}})),b=h.getNAF,p=h.getJSF,m=h.assert;function x(e,t){this.type=e,this.p=new(o())(t.p,16),this.red=t.prime?o().red(t.prime):o().mont(this.p),this.zero=new(o())(0).toRed(this.red),this.one=new(o())(1).toRed(this.red),this.two=new(o())(2).toRed(this.red),this.n=t.n&&new(o())(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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var g=x;function v(e,t){this.curve=e,this.type=t,this.precomputed=null}x.prototype.point=function(){throw new Error("Not implemented")},x.prototype.validate=function(){throw new Error("Not implemented")},x.prototype._fixedNafMul=function(e,t){m(e.precomputed);var r=e._getDoubles(),n=b(t,1,this._bitLength),a=(1<<r.step+1)-(r.step%2===0?2:1);a/=3;var i,o,c=[];for(i=0;i<n.length;i+=r.step){o=0;for(var s=i+r.step-1;s>=i;s--)o=(o<<1)+n[s];c.push(o)}for(var f=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=a;d>0;d--){for(i=0;i<c.length;i++)(o=c[i])===d?u=u.mixedAdd(r.points[i]):o===-d&&(u=u.mixedAdd(r.points[i].neg()));f=f.add(u)}return f.toP()},x.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var a=n.points,i=b(t,r,this._bitLength),o=this.jpoint(null,null,null),c=i.length-1;c>=0;c--){for(var s=0;c>=0&&0===i[c];c--)s++;if(c>=0&&s++,o=o.dblp(s),c<0)break;var f=i[c];m(0!==f),o="affine"===e.type?f>0?o.mixedAdd(a[f-1>>1]):o.mixedAdd(a[-f-1>>1].neg()):f>0?o.add(a[f-1>>1]):o.add(a[-f-1>>1].neg())}return"affine"===e.type?o.toP():o},x.prototype._wnafMulAdd=function(e,t,r,n,a){var i,o,c,s=this._wnafT1,f=this._wnafT2,u=this._wnafT3,d=0;for(i=0;i<n;i++){var l=(c=t[i])._getNAFPoints(e);s[i]=l.wnd,f[i]=l.points}for(i=n-1;i>=1;i-=2){var h=i-1,m=i;if(1===s[h]&&1===s[m]){var x=[t[h],null,null,t[m]];0===t[h].y.cmp(t[m].y)?(x[1]=t[h].add(t[m]),x[2]=t[h].toJ().mixedAdd(t[m].neg())):0===t[h].y.cmp(t[m].y.redNeg())?(x[1]=t[h].toJ().mixedAdd(t[m]),x[2]=t[h].add(t[m].neg())):(x[1]=t[h].toJ().mixedAdd(t[m]),x[2]=t[h].toJ().mixedAdd(t[m].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=p(r[h],r[m]);for(d=Math.max(v[0].length,d),u[h]=new Array(d),u[m]=new Array(d),o=0;o<d;o++){var y=0|v[0][o],w=0|v[1][o];u[h][o]=g[3*(y+1)+(w+1)],u[m][o]=0,f[h]=x}}else u[h]=b(r[h],s[h],this._bitLength),u[m]=b(r[m],s[m],this._bitLength),d=Math.max(u[h].length,d),d=Math.max(u[m].length,d)}var M=this.jpoint(null,null,null),k=this._wnafT4;for(i=d;i>=0;i--){for(var A=0;i>=0;){var I=!0;for(o=0;o<n;o++)k[o]=0|u[o][i],0!==k[o]&&(I=!1);if(!I)break;A++,i--}if(i>=0&&A++,M=M.dblp(A),i<0)break;for(o=0;o<n;o++){var E=k[o];0!==E&&(E>0?c=f[o][E-1>>1]:E<0&&(c=f[o][-E-1>>1].neg()),M="affine"===c.type?M.mixedAdd(c):M.add(c))}}for(i=0;i<n;i++)f[i]=null;return a?M:M.toP()},x.BasePoint=v,v.prototype.eq=function(){throw new Error("Not implemented")},v.prototype.validate=function(){return this.curve.validate(this)},x.prototype.decodePoint=function(e,t){e=h.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1===2*r)return 6===e[0]?m(e[e.length-1]%2===0):7===e[0]&&m(e[e.length-1]%2===1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},v.prototype.encodeCompressed=function(e){return this.encode(e,!0)},v.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},v.prototype.encode=function(e,t){return h.encode(this._encode(t),e)},v.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},v.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},v.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,a=0;a<t;a+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},v.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),a=1;a<r;a++)t[a]=t[a-1].add(n);return{wnd:e,points:t}},v.prototype._getBeta=function(){return null},v.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var y=f((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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),w=h.assert;function M(e){g.call(this,"short",e),this.a=new(o())(e.a,16).toRed(this.red),this.b=new(o())(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}y(M,g);var k=M;function A(e,t,r,n){g.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(o())(t,16),this.y=new(o())(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function I(e,t,r,n){g.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(o())(0)):(this.x=new(o())(t,16),this.y=new(o())(r,16),this.z=new(o())(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}M.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(o())(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new(o())(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))?r=a[0]:(r=a[1],w(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new(o())(e.a,16),b:new(o())(e.b,16)}})):this._getEndoBasis(r)}}},M.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:o().mont(e),r=new(o())(2).toRed(t).redInvm(),n=r.redNeg(),a=new(o())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(a).fromRed(),n.redSub(a).fromRed()]},M.prototype._getEndoBasis=function(e){for(var t,r,n,a,i,c,s,f,u,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,h=this.n.clone(),b=new(o())(1),p=new(o())(0),m=new(o())(0),x=new(o())(1),g=0;0!==l.cmpn(0);){var v=h.div(l);f=h.sub(v.mul(l)),u=m.sub(v.mul(b));var y=x.sub(v.mul(p));if(!n&&f.cmp(d)<0)t=s.neg(),r=b,n=f.neg(),a=u;else if(n&&2===++g)break;s=f,h=l,l=f,m=b,b=u,x=p,p=y}i=f.neg(),c=u;var w=n.sqr().add(a.sqr());return i.sqr().add(c.sqr()).cmp(w)>=0&&(i=t,c=r),n.negative&&(n=n.neg(),a=a.neg()),i.negative&&(i=i.neg(),c=c.neg()),[{a:n,b:a},{a:i,b:c}]},M.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),o=a.mul(r.a),c=i.mul(n.a),s=a.mul(r.b),f=i.mul(n.b);return{k1:e.sub(o).sub(c),k2:s.add(f).neg()}},M.prototype.pointFromX=function(e,t){(e=new(o())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)},M.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(a).cmpn(0)},M.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,a=this._endoWnafT2,i=0;i<e.length;i++){var o=this._endoSplit(t[i]),c=e[i],s=c._getBeta();o.k1.negative&&(o.k1.ineg(),c=c.neg(!0)),o.k2.negative&&(o.k2.ineg(),s=s.neg(!0)),n[2*i]=c,n[2*i+1]=s,a[2*i]=o.k1,a[2*i+1]=o.k2}for(var f=this._wnafMulAdd(1,n,a,2*i,r),u=0;u<2*i;u++)n[u]=null,a[u]=null;return f},y(A,g.BasePoint),M.prototype.point=function(e,t,r){return new A(this,e,t,r)},M.prototype.pointFromJSON=function(e,t){return A.fromJSON(this,e,t)},A.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},A.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},A.fromJSON=function(e,t,r){"string"===typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function a(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(a))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(a))}},n},A.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},A.prototype.isInfinity=function(){return this.inf},A.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 r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},A.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,r=this.x.redSqr(),n=e.redInvm(),a=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,o)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(e){return e=new(o())(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)},A.prototype.mulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)},A.prototype.jmulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)},A.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))},A.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(I,g.BasePoint),M.prototype.jpoint=function(e,t,r){return new I(this,e,t,r)},I.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},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(),r=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),c=n.redSub(a),s=i.redSub(o);if(0===c.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=c.redSqr(),u=f.redMul(c),d=n.redMul(f),l=s.redSqr().redIAdd(u).redISub(d).redISub(d),h=s.redMul(d.redISub(l)).redISub(i.redMul(u)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(l,h,b)},I.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),a=this.y,i=e.y.redMul(t).redMul(this.z),o=r.redSub(n),c=a.redSub(i);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=o.redSqr(),f=s.redMul(o),u=r.redMul(s),d=c.redSqr().redIAdd(f).redISub(u).redISub(u),l=c.redMul(u.redISub(d)).redISub(a.redMul(f)),h=this.z.redMul(o);return this.curve.jpoint(d,l,h)},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 r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,a=this.curve.tinv,i=this.x,o=this.y,c=this.z,s=c.redSqr().redSqr(),f=o.redAdd(o);for(t=0;t<e;t++){var u=i.redSqr(),d=f.redSqr(),l=d.redSqr(),h=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(s)),b=i.redMul(d),p=h.redSqr().redISub(b.redAdd(b)),m=b.redISub(p),x=h.redMul(m);x=x.redIAdd(x).redISub(l);var g=f.redMul(c);t+1<e&&(s=s.redMul(l)),i=p,c=g,f=x}return this.curve.jpoint(i,f.redMul(a),c)},I.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},I.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),i=a.redSqr(),o=this.x.redAdd(a).redSqr().redISub(n).redISub(i);o=o.redIAdd(o);var c=n.redAdd(n).redIAdd(n),s=c.redSqr().redISub(o).redISub(o),f=i.redIAdd(i);f=(f=f.redIAdd(f)).redIAdd(f),e=s,t=c.redMul(o.redISub(s)).redISub(f),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),d=this.y.redSqr(),l=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(u).redISub(l);h=h.redIAdd(h);var b=u.redAdd(u).redIAdd(u),p=b.redSqr(),m=l.redIAdd(l);m=(m=m.redIAdd(m)).redIAdd(m),e=p.redISub(h).redISub(h),t=b.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},I.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),i=a.redSqr(),o=this.x.redAdd(a).redSqr().redISub(n).redISub(i);o=o.redIAdd(o);var c=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=c.redSqr().redISub(o).redISub(o);e=s;var f=i.redIAdd(i);f=(f=f.redIAdd(f)).redIAdd(f),t=c.redMul(o.redISub(s)).redISub(f),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),d=this.y.redSqr(),l=this.x.redMul(d),h=this.x.redSub(u).redMul(this.x.redAdd(u));h=h.redAdd(h).redIAdd(h);var b=l.redIAdd(l),p=(b=b.redIAdd(b)).redAdd(b);e=h.redSqr().redISub(p),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(u);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(b.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},I.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,a=n.redSqr().redSqr(),i=t.redSqr(),o=r.redSqr(),c=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(a)),s=t.redAdd(t),f=(s=s.redIAdd(s)).redMul(o),u=c.redSqr().redISub(f.redAdd(f)),d=f.redISub(u),l=o.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var h=c.redMul(d).redISub(l),b=r.redAdd(r).redMul(n);return this.curve.jpoint(u,h,b)},I.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),a=e.redAdd(e).redIAdd(e),i=a.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(n),c=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(i)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var f=a.redIAdd(o).redSqr().redISub(i).redISub(c).redISub(s),u=t.redMul(f);u=(u=u.redIAdd(u)).redIAdd(u);var d=this.x.redMul(c).redISub(u);d=(d=d.redIAdd(d)).redIAdd(d);var l=this.y.redMul(f.redMul(s.redISub(f)).redISub(o.redMul(c)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var h=this.z.redAdd(o).redSqr().redISub(r).redISub(c);return this.curve.jpoint(d,l,h)},I.prototype.mul=function(e,t){return e=new(o())(e,t),this.curve._wnafMul(this,e)},I.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),a=r.redMul(e.z);return 0===this.y.redMul(a).redISub(e.y.redMul(n)).cmpn(0)},I.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),a=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(a),0===this.x.cmp(r))return!0}},I.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},I.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var E=f((function(e,t){var r=t;r.base=g,r.short=k,r.mont=null,r.edwards=null})),S=f((function(e,t){var r,n=t,a=h.assert;function i(e){"short"===e.type?this.curve=new E.short(e):"edwards"===e.type?this.curve=new E.edwards(e):this.curve=new E.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(c){r=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function _(e){if(!(this instanceof _))return new _(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=l.toArray(e.entropy,e.entropyEnc||"hex"),r=l.toArray(e.nonce,e.nonceEnc||"hex"),n=l.toArray(e.pers,e.persEnc||"hex");u(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var N=_;_.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},_.prototype._hmac=function(){return new(s().hmac)(this.hash,this.K)},_.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},_.prototype.reseed=function(e,t,r,n){"string"!==typeof t&&(n=r,r=t,t=null),e=l.toArray(e,t),r=l.toArray(r,n),u(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},_.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(n=r,r=t,t=null),r&&(r=l.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var i=a.slice(0,e);return this._update(r),this._reseed++,l.encode(i,t)};var j=h.assert;function C(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var T=C;C.fromPublic=function(e,t,r){return t instanceof C?t:new C(e,{pub:t,pubEnc:r})},C.fromPrivate=function(e,t,r){return t instanceof C?t:new C(e,{priv:t,privEnc:r})},C.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},C.prototype.getPublic=function(e,t){return"string"===typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},C.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},C.prototype._importPrivate=function(e,t){this.priv=new(o())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},C.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?j(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||j(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},C.prototype.derive=function(e){return e.validate()||j(e.validate(),"public point not validated"),e.mul(this.priv).getX()},C.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},C.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},C.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var L=h.assert;function D(e,t){if(e instanceof D)return e;this._importDER(e,t)||(L(e.r&&e.s,"Signature without r or s"),this.r=new(o())(e.r,16),this.s=new(o())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var O=D;function P(){this.place=0}function R(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var a=0,i=0,o=t.place;i<n;i++,o++)a<<=8,a|=e[o],a>>>=0;return!(a<=127)&&(t.place=o,a)}function B(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function z(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}D.prototype._importDER=function(e,t){e=h.toArray(e,t);var r=new P;if(48!==e[r.place++])return!1;var n=R(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=R(e,r);if(!1===a)return!1;var i=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var c=R(e,r);if(!1===c)return!1;if(e.length!==c+r.place)return!1;var s=e.slice(r.place,c+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(o())(i),this.s=new(o())(s),this.recoveryParam=null,!0},D.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=B(t),r=B(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];z(n,t.length),(n=n.concat(t)).push(2),z(n,r.length);var a=n.concat(r),i=[48];return z(i,a.length),i=i.concat(a),h.encode(i,e)};var U=function(){throw new Error("unsupported")},Z=h.assert;function F(e){if(!(this instanceof F))return new F(e);"string"===typeof e&&(Z(Object.prototype.hasOwnProperty.call(S,e),"Unknown curve "+e),e=S[e]),e instanceof S.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 Y=F;F.prototype.keyPair=function(e){return new T(this,e)},F.prototype.keyFromPrivate=function(e,t){return T.fromPrivate(this,e,t)},F.prototype.keyFromPublic=function(e,t){return T.fromPublic(this,e,t)},F.prototype.genKeyPair=function(e){e||(e={});for(var t=new N({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||U(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(o())(2));;){var a=new(o())(t.generate(r));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}},F.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},F.prototype.sign=function(e,t,r,n){"object"===typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(o())(e,16));for(var a=this.n.byteLength(),i=t.getPrivate().toArray("be",a),c=e.toArray("be",a),s=new N({hash:this.hash,entropy:i,nonce:c,pers:n.pers,persEnc:n.persEnc||"utf8"}),f=this.n.sub(new(o())(1)),u=0;;u++){var d=n.k?n.k(u):new(o())(s.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var l=this.g.mul(d);if(!l.isInfinity()){var h=l.getX(),b=h.umod(this.n);if(0!==b.cmpn(0)){var p=d.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(l.getY().isOdd()?1:0)|(0!==h.cmp(b)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new O({r:b,s:p,recoveryParam:m})}}}}}},F.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(o())(e,16)),r=this.keyFromPublic(r,n);var a=(t=new O(t,"hex")).r,i=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var c,s=i.invm(this.n),f=s.mul(e).umod(this.n),u=s.mul(a).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(f,r.getPublic(),u)).isInfinity()&&c.eqXToP(a):!(c=this.g.mulAdd(f,r.getPublic(),u)).isInfinity()&&0===c.getX().umod(this.n).cmp(a)},F.prototype.recoverPubKey=function(e,t,r,n){Z((3&r)===r,"The recovery param is more than two bits"),t=new O(t,n);var a=this.n,i=new(o())(e),c=t.r,s=t.s,f=1&r,u=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");c=u?this.curve.pointFromX(c.add(this.curve.n),f):this.curve.pointFromX(c,f);var d=t.r.invm(a),l=a.sub(i).mul(d).umod(a),h=s.mul(d).umod(a);return this.g.mulAdd(l,c,h)},F.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new O(t,n)).recoveryParam)return t.recoveryParam;for(var a=0;a<4;a++){var i;try{i=this.recoverPubKey(e,t,a)}catch(e){continue}if(i.eq(r))return a}throw new Error("Unable to find valid recovery factor")};var G=f((function(e,t){var r=t;r.version="6.5.4",r.utils=h,r.rand=function(){throw new Error("unsupported")},r.curve=E,r.curves=S,r.ec=Y,r.eddsa=null})).ec,H=r(49716),W=r(30520),q=new(r(39502).Logger)("signing-key/5.7.0"),Q=null;function V(){return Q||(Q=new G("secp256k1")),Q}var J=function(){function e(t){(0,n.Z)(this,e),(0,W.defineReadOnly)(this,"curve","secp256k1"),(0,W.defineReadOnly)(this,"privateKey",(0,H.hexlify)(t)),32!==(0,H.hexDataLength)(this.privateKey)&&q.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=V().keyFromPrivate((0,H.arrayify)(this.privateKey));(0,W.defineReadOnly)(this,"publicKey","0x"+r.getPublic(!1,"hex")),(0,W.defineReadOnly)(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),(0,W.defineReadOnly)(this,"_isSigningKey",!0)}return(0,a.Z)(e,[{key:"_addPoint",value:function(e){var t=V().keyFromPublic((0,H.arrayify)(this.publicKey)),r=V().keyFromPublic((0,H.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=V().keyFromPrivate((0,H.arrayify)(this.privateKey)),r=(0,H.arrayify)(e);32!==r.length&&q.throwArgumentError("bad digest length","digest",e);var n=t.sign(r,{canonical:!0});return(0,H.splitSignature)({recoveryParam:n.recoveryParam,r:(0,H.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,H.hexZeroPad)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=V().keyFromPrivate((0,H.arrayify)(this.privateKey)),r=V().keyFromPublic((0,H.arrayify)(X(e)));return(0,H.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function K(e,t){var r=(0,H.splitSignature)(t),n={r:(0,H.arrayify)(r.r),s:(0,H.arrayify)(r.s)};return"0x"+V().recoverPubKey((0,H.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function X(e,t){var r=(0,H.arrayify)(e);if(32===r.length){var n=new J(r);return t?"0x"+V().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?t?(0,H.hexlify)(r):"0x"+V().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+V().keyFromPublic(r).getPublic(!0,"hex"):(0,H.hexlify)(r):q.throwArgumentError("invalid public or private key","key","[REDACTED]")}},29286:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(62808).Buffer}catch(_){}function c(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,r){var n=c(e,r);return r-1>=t&&(n|=c(e,r-1)<<4),n}function f(e,t,r,a){for(var i=0,o=0,c=Math.min(e.length,r),s=t;s<c;s++){var f=e.charCodeAt(s)-48;i*=a,o=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&o<a,"Invalid character"),i+=o}return i}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a<e.length&&(16===t?this._parseHex(e,a,r):(this._parseBase(e,t,a),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var i,o,c=0;if("be"===r)for(a=e.length-1,i=0;a>=0;a-=3)o=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(a=0,i=0;a<e.length;a+=3)o=e[a]|e[a+1]<<8|e[a+2]<<16,this.words[i]|=o<<c&67108863,this.words[i+1]=o>>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,i=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)a=s(e,t,n)<<i,this.words[o]|=67108863&a,i>=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,s=0,u=r;u<c;u+=n)s=f(e,u,u+n,t),this.imuln(a),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==o){var d=1;for(s=f(e,u,e.length,t),u=0;u<o;u++)d*=t;this.imuln(d),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){u(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(_){i.prototype.inspect=d}else i.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","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"],h=[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],b=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,i=0,o=0;o<this.length;o++){var c=this.words[o],s=(16777215&(c<<a|i)).toString(16);i=c>>>24-a&16777215,(a+=2)>=26&&(a-=26,o--),r=0!==i||o!==this.length-1?l[6-s.length]+s+r:s+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=h[e],u=b[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modrn(u).toString(e);r=(d=d.idivn(u)).isZero()?p+r:l[f-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,s=o/67108864|0;r.words[0]=c;for(var f=1;f<n;f++){for(var u=s>>>26,d=67108863&s,l=Math.min(f,t.length-1),h=Math.max(0,f-e.length+1);h<=l;h++){var b=f-h|0;u+=(o=(a=0|e.words[b])*(i=0|t.words[h])+d)/67108864|0,d=67108863&o}r.words[f]=0|d,s=0|u}return 0!==s?r.words[f]=0|s:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,a),o},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===i?(r<e.length&&(e[r++]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,a=0,i=0;a<this.length;a++){var o=this.words[a]<<i|n;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a<t;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<a:this.words[r]&~(1<<a),this._strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&t,a=t>>>26;for(;0!==a&&i<r.length;i++)t=(0|r.words[i])+a,this.words[i]=67108863&t,a=t>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.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 r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)i=(t=(0|r.words[o])-(0|n.words[o])+i)>>26,this.words[o]=67108863&t;for(;0!==i&&o<r.length;o++)i=(t=(0|r.words[o])+i)>>26,this.words[o]=67108863&t;if(0===i&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,a,i,o=e.words,c=t.words,s=r.words,f=0,u=0|o[0],d=8191&u,l=u>>>13,h=0|o[1],b=8191&h,p=h>>>13,m=0|o[2],x=8191&m,g=m>>>13,v=0|o[3],y=8191&v,w=v>>>13,M=0|o[4],k=8191&M,A=M>>>13,I=0|o[5],E=8191&I,S=I>>>13,_=0|o[6],N=8191&_,j=_>>>13,C=0|o[7],T=8191&C,L=C>>>13,D=0|o[8],O=8191&D,P=D>>>13,R=0|o[9],B=8191&R,z=R>>>13,U=0|c[0],Z=8191&U,F=U>>>13,Y=0|c[1],G=8191&Y,H=Y>>>13,W=0|c[2],q=8191&W,Q=W>>>13,V=0|c[3],J=8191&V,K=V>>>13,X=0|c[4],$=8191&X,ee=X>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],se=8191&ce,fe=ce>>>13,ue=0|c[8],de=8191&ue,le=ue>>>13,he=0|c[9],be=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(f+(n=Math.imul(d,Z))|0)+((8191&(a=(a=Math.imul(d,F))+Math.imul(l,Z)|0))<<13)|0;f=((i=Math.imul(l,F))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(b,Z),a=(a=Math.imul(b,F))+Math.imul(p,Z)|0,i=Math.imul(p,F);var xe=(f+(n=n+Math.imul(d,G)|0)|0)+((8191&(a=(a=a+Math.imul(d,H)|0)+Math.imul(l,G)|0))<<13)|0;f=((i=i+Math.imul(l,H)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,Z),a=(a=Math.imul(x,F))+Math.imul(g,Z)|0,i=Math.imul(g,F),n=n+Math.imul(b,G)|0,a=(a=a+Math.imul(b,H)|0)+Math.imul(p,G)|0,i=i+Math.imul(p,H)|0;var ge=(f+(n=n+Math.imul(d,q)|0)|0)+((8191&(a=(a=a+Math.imul(d,Q)|0)+Math.imul(l,q)|0))<<13)|0;f=((i=i+Math.imul(l,Q)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(y,Z),a=(a=Math.imul(y,F))+Math.imul(w,Z)|0,i=Math.imul(w,F),n=n+Math.imul(x,G)|0,a=(a=a+Math.imul(x,H)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,H)|0,n=n+Math.imul(b,q)|0,a=(a=a+Math.imul(b,Q)|0)+Math.imul(p,q)|0,i=i+Math.imul(p,Q)|0;var ve=(f+(n=n+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,K)|0)+Math.imul(l,J)|0))<<13)|0;f=((i=i+Math.imul(l,K)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(k,Z),a=(a=Math.imul(k,F))+Math.imul(A,Z)|0,i=Math.imul(A,F),n=n+Math.imul(y,G)|0,a=(a=a+Math.imul(y,H)|0)+Math.imul(w,G)|0,i=i+Math.imul(w,H)|0,n=n+Math.imul(x,q)|0,a=(a=a+Math.imul(x,Q)|0)+Math.imul(g,q)|0,i=i+Math.imul(g,Q)|0,n=n+Math.imul(b,J)|0,a=(a=a+Math.imul(b,K)|0)+Math.imul(p,J)|0,i=i+Math.imul(p,K)|0;var ye=(f+(n=n+Math.imul(d,$)|0)|0)+((8191&(a=(a=a+Math.imul(d,ee)|0)+Math.imul(l,$)|0))<<13)|0;f=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(E,Z),a=(a=Math.imul(E,F))+Math.imul(S,Z)|0,i=Math.imul(S,F),n=n+Math.imul(k,G)|0,a=(a=a+Math.imul(k,H)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,H)|0,n=n+Math.imul(y,q)|0,a=(a=a+Math.imul(y,Q)|0)+Math.imul(w,q)|0,i=i+Math.imul(w,Q)|0,n=n+Math.imul(x,J)|0,a=(a=a+Math.imul(x,K)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,K)|0,n=n+Math.imul(b,$)|0,a=(a=a+Math.imul(b,ee)|0)+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0;var we=(f+(n=n+Math.imul(d,re)|0)|0)+((8191&(a=(a=a+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;f=((i=i+Math.imul(l,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(N,Z),a=(a=Math.imul(N,F))+Math.imul(j,Z)|0,i=Math.imul(j,F),n=n+Math.imul(E,G)|0,a=(a=a+Math.imul(E,H)|0)+Math.imul(S,G)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(k,q)|0,a=(a=a+Math.imul(k,Q)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,Q)|0,n=n+Math.imul(y,J)|0,a=(a=a+Math.imul(y,K)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,K)|0,n=n+Math.imul(x,$)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(b,re)|0,a=(a=a+Math.imul(b,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var Me=(f+(n=n+Math.imul(d,ie)|0)|0)+((8191&(a=(a=a+Math.imul(d,oe)|0)+Math.imul(l,ie)|0))<<13)|0;f=((i=i+Math.imul(l,oe)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(T,Z),a=(a=Math.imul(T,F))+Math.imul(L,Z)|0,i=Math.imul(L,F),n=n+Math.imul(N,G)|0,a=(a=a+Math.imul(N,H)|0)+Math.imul(j,G)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(E,q)|0,a=(a=a+Math.imul(E,Q)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,Q)|0,n=n+Math.imul(k,J)|0,a=(a=a+Math.imul(k,K)|0)+Math.imul(A,J)|0,i=i+Math.imul(A,K)|0,n=n+Math.imul(y,$)|0,a=(a=a+Math.imul(y,ee)|0)+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(b,ie)|0,a=(a=a+Math.imul(b,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var ke=(f+(n=n+Math.imul(d,se)|0)|0)+((8191&(a=(a=a+Math.imul(d,fe)|0)+Math.imul(l,se)|0))<<13)|0;f=((i=i+Math.imul(l,fe)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,Z),a=(a=Math.imul(O,F))+Math.imul(P,Z)|0,i=Math.imul(P,F),n=n+Math.imul(T,G)|0,a=(a=a+Math.imul(T,H)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,H)|0,n=n+Math.imul(N,q)|0,a=(a=a+Math.imul(N,Q)|0)+Math.imul(j,q)|0,i=i+Math.imul(j,Q)|0,n=n+Math.imul(E,J)|0,a=(a=a+Math.imul(E,K)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(k,$)|0,a=(a=a+Math.imul(k,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,a=(a=a+Math.imul(y,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,oe)|0,n=n+Math.imul(b,se)|0,a=(a=a+Math.imul(b,fe)|0)+Math.imul(p,se)|0,i=i+Math.imul(p,fe)|0;var Ae=(f+(n=n+Math.imul(d,de)|0)|0)+((8191&(a=(a=a+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;f=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,Z),a=(a=Math.imul(B,F))+Math.imul(z,Z)|0,i=Math.imul(z,F),n=n+Math.imul(O,G)|0,a=(a=a+Math.imul(O,H)|0)+Math.imul(P,G)|0,i=i+Math.imul(P,H)|0,n=n+Math.imul(T,q)|0,a=(a=a+Math.imul(T,Q)|0)+Math.imul(L,q)|0,i=i+Math.imul(L,Q)|0,n=n+Math.imul(N,J)|0,a=(a=a+Math.imul(N,K)|0)+Math.imul(j,J)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(E,$)|0,a=(a=a+Math.imul(E,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(k,re)|0,a=(a=a+Math.imul(k,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(y,ie)|0,a=(a=a+Math.imul(y,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,se)|0,a=(a=a+Math.imul(x,fe)|0)+Math.imul(g,se)|0,i=i+Math.imul(g,fe)|0,n=n+Math.imul(b,de)|0,a=(a=a+Math.imul(b,le)|0)+Math.imul(p,de)|0,i=i+Math.imul(p,le)|0;var Ie=(f+(n=n+Math.imul(d,be)|0)|0)+((8191&(a=(a=a+Math.imul(d,pe)|0)+Math.imul(l,be)|0))<<13)|0;f=((i=i+Math.imul(l,pe)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,G),a=(a=Math.imul(B,H))+Math.imul(z,G)|0,i=Math.imul(z,H),n=n+Math.imul(O,q)|0,a=(a=a+Math.imul(O,Q)|0)+Math.imul(P,q)|0,i=i+Math.imul(P,Q)|0,n=n+Math.imul(T,J)|0,a=(a=a+Math.imul(T,K)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,K)|0,n=n+Math.imul(N,$)|0,a=(a=a+Math.imul(N,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(E,re)|0,a=(a=a+Math.imul(E,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(k,ie)|0,a=(a=a+Math.imul(k,oe)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,oe)|0,n=n+Math.imul(y,se)|0,a=(a=a+Math.imul(y,fe)|0)+Math.imul(w,se)|0,i=i+Math.imul(w,fe)|0,n=n+Math.imul(x,de)|0,a=(a=a+Math.imul(x,le)|0)+Math.imul(g,de)|0,i=i+Math.imul(g,le)|0;var Ee=(f+(n=n+Math.imul(b,be)|0)|0)+((8191&(a=(a=a+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;f=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,Q))+Math.imul(z,q)|0,i=Math.imul(z,Q),n=n+Math.imul(O,J)|0,a=(a=a+Math.imul(O,K)|0)+Math.imul(P,J)|0,i=i+Math.imul(P,K)|0,n=n+Math.imul(T,$)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(L,$)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(N,re)|0,a=(a=a+Math.imul(N,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(E,ie)|0,a=(a=a+Math.imul(E,oe)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,oe)|0,n=n+Math.imul(k,se)|0,a=(a=a+Math.imul(k,fe)|0)+Math.imul(A,se)|0,i=i+Math.imul(A,fe)|0,n=n+Math.imul(y,de)|0,a=(a=a+Math.imul(y,le)|0)+Math.imul(w,de)|0,i=i+Math.imul(w,le)|0;var Se=(f+(n=n+Math.imul(x,be)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(g,be)|0))<<13)|0;f=((i=i+Math.imul(g,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,J),a=(a=Math.imul(B,K))+Math.imul(z,J)|0,i=Math.imul(z,K),n=n+Math.imul(O,$)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(N,ie)|0,a=(a=a+Math.imul(N,oe)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,oe)|0,n=n+Math.imul(E,se)|0,a=(a=a+Math.imul(E,fe)|0)+Math.imul(S,se)|0,i=i+Math.imul(S,fe)|0,n=n+Math.imul(k,de)|0,a=(a=a+Math.imul(k,le)|0)+Math.imul(A,de)|0,i=i+Math.imul(A,le)|0;var _e=(f+(n=n+Math.imul(y,be)|0)|0)+((8191&(a=(a=a+Math.imul(y,pe)|0)+Math.imul(w,be)|0))<<13)|0;f=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,$),a=(a=Math.imul(B,ee))+Math.imul(z,$)|0,i=Math.imul(z,ee),n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(N,se)|0,a=(a=a+Math.imul(N,fe)|0)+Math.imul(j,se)|0,i=i+Math.imul(j,fe)|0,n=n+Math.imul(E,de)|0,a=(a=a+Math.imul(E,le)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,le)|0;var Ne=(f+(n=n+Math.imul(k,be)|0)|0)+((8191&(a=(a=a+Math.imul(k,pe)|0)+Math.imul(A,be)|0))<<13)|0;f=((i=i+Math.imul(A,pe)|0)+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,re),a=(a=Math.imul(B,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(T,se)|0,a=(a=a+Math.imul(T,fe)|0)+Math.imul(L,se)|0,i=i+Math.imul(L,fe)|0,n=n+Math.imul(N,de)|0,a=(a=a+Math.imul(N,le)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,le)|0;var je=(f+(n=n+Math.imul(E,be)|0)|0)+((8191&(a=(a=a+Math.imul(E,pe)|0)+Math.imul(S,be)|0))<<13)|0;f=((i=i+Math.imul(S,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(B,ie),a=(a=Math.imul(B,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(O,se)|0,a=(a=a+Math.imul(O,fe)|0)+Math.imul(P,se)|0,i=i+Math.imul(P,fe)|0,n=n+Math.imul(T,de)|0,a=(a=a+Math.imul(T,le)|0)+Math.imul(L,de)|0,i=i+Math.imul(L,le)|0;var Ce=(f+(n=n+Math.imul(N,be)|0)|0)+((8191&(a=(a=a+Math.imul(N,pe)|0)+Math.imul(j,be)|0))<<13)|0;f=((i=i+Math.imul(j,pe)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,se),a=(a=Math.imul(B,fe))+Math.imul(z,se)|0,i=Math.imul(z,fe),n=n+Math.imul(O,de)|0,a=(a=a+Math.imul(O,le)|0)+Math.imul(P,de)|0,i=i+Math.imul(P,le)|0;var Te=(f+(n=n+Math.imul(T,be)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(L,be)|0))<<13)|0;f=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,de),a=(a=Math.imul(B,le))+Math.imul(z,de)|0,i=Math.imul(z,le);var Le=(f+(n=n+Math.imul(O,be)|0)|0)+((8191&(a=(a=a+Math.imul(O,pe)|0)+Math.imul(P,be)|0))<<13)|0;f=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(Le>>>26)|0,Le&=67108863;var De=(f+(n=Math.imul(B,be))|0)+((8191&(a=(a=Math.imul(B,pe))+Math.imul(z,be)|0))<<13)|0;return f=((i=Math.imul(z,pe))+(a>>>13)|0)+(De>>>26)|0,De&=67108863,s[0]=me,s[1]=xe,s[2]=ge,s[3]=ve,s[4]=ye,s[5]=we,s[6]=Me,s[7]=ke,s[8]=Ae,s[9]=Ie,s[10]=Ee,s[11]=Se,s[12]=_e,s[13]=Ne,s[14]=je,s[15]=Ce,s[16]=Te,s[17]=Le,s[18]=De,0!==f&&(s[19]=f,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var o=a;a=0;for(var c=67108863&n,s=Math.min(i,t.length-1),f=Math.max(0,i-e.length+1);f<=s;f++){var u=i-f,d=(0|e.words[u])*(0|t.words[f]),l=67108863&d;c=67108863&(l=l+c|0),a+=(o=(o=o+(d/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function g(e,t,r){return x(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?x(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,a=0;a<t;a++)n|=(1&e)<<t-a-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o<i;o++)n[o]=t[e[o]],a[o]=r[e[o]]},v.prototype.transform=function(e,t,r,n,a,i){this.permute(i,e,t,r,n,a);for(var o=1;o<a;o<<=1)for(var c=o<<1,s=Math.cos(2*Math.PI/c),f=Math.sin(2*Math.PI/c),u=0;u<a;u+=c)for(var d=s,l=f,h=0;h<o;h++){var b=r[u+h],p=n[u+h],m=r[u+h+o],x=n[u+h+o],g=d*m-l*x;x=d*x+l*m,m=g,r[u+h]=b+m,n[u+h]=p+x,r[u+h+o]=b-m,n[u+h+o]=p-x,h!==c&&(g=s*d-f*l,l=s*l+f*d,d=g)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=e[n];e[n]=e[r-n-1],e[r-n-1]=a,a=t[n],t[n]=-t[r-n-1],t[r-n-1]=-a}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var a=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&a,r=a<67108864?0:a/67108864|0}return e},v.prototype.convert13b=function(e,t,r,a){for(var i=0,o=0;o<t;o++)i+=0|e[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o<a;++o)r[o]=0;n(0===i),n(0===(-8192&i))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),a=this.makeRBT(n),i=this.stub(n),o=new Array(n),c=new Array(n),s=new Array(n),f=new Array(n),u=new Array(n),d=new Array(n),l=r.words;l.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,f,n),this.transform(o,i,c,s,n,a),this.transform(f,i,u,d,n,a);for(var h=0;h<n;h++){var b=c[h]*u[h]-s[h]*d[h];s[h]=c[h]*d[h]+s[h]*u[h],c[h]=b}return this.conjugate(c,s,n),this.transform(c,s,l,i,n,a),this.conjugate(l,i,n),this.normalize13b(l,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"===typeof e),n(e<67108864);for(var r=0,a=0;a<this.length;a++){var i=(0|this.words[a])*e,o=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=o>>>26,this.words[a]=67108863&o}return 0!==r&&(this.words[a]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,a=r%26;t[r]=e.words[n]>>>a&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,a=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var c=this.words[t]&i,s=(0|this.words[t])-c<<r;this.words[t]=s|o,o=c>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t<a;t++)this.words[t]=0;this.length+=a}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var a;n("number"===typeof e&&e>=0),a=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<<i,s=r;if(a-=o,a=Math.max(0,a),s){for(var f=0;f<o;f++)s.words[f]=this.words[f];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;var u=0;for(f=this.length-1;f>=0&&(0!==u||f>=a);f--){var d=0|this.words[f];this.words[f]=u<<26-i|d>>>i,u=d&c}return s&&0!==u&&(s.words[s.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<<t;return!(this.length<=r)&&!!(this.words[r]&a)},i.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<<t;this.words[this.length-1]&=a}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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},i.prototype.isubn=function(e){if(n("number"===typeof e),n(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var a,i,o=e.length+r;this._expand(o);var c=0;for(a=0;a<e.length;a++){i=(0|this.words[a+r])+c;var s=(0|e.words[a])*t;c=((i-=67108863&s)>>26)-(s/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)c=(i=(0|this.words[a+r])+c)>>26,this.words[a+r]=67108863&i;if(0===c)return this._strip();for(n(-1===c),c=0,a=0;a<this.length;a++)c=(i=-(0|this.words[a])+c)>>26,this.words[a]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var c,s=n.length-a.length;if("mod"!==t){(c=new i(null)).length=s+1,c.words=new Array(c.length);for(var f=0;f<c.length;f++)c.words[f]=0}var u=n.clone()._ishlnsubmul(a,1,s);0===u.negative&&(n=u,c&&(c.words[s]=1));for(var d=s-1;d>=0;d--){var l=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),n._ishlnsubmul(a,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);c&&(c.words[d]=l)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(a=c.div.neg()),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(a=c.div.neg()),{div:a,mod:c.mod}):0!==(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(o=c.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:c.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,c},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,a=0,i=this.length-1;i>=0;i--)a=(r*a+(0|this.words[i]))%e;return t?-a:a},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,a=this.length-1;a>=0;a--){var i=(0|this.words[a])+67108864*r;this.words[a]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),c=new i(0),s=new i(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var u=r.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0===(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(u),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var b=0,p=1;0===(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(c.isOdd()||s.isOdd())&&(c.iadd(u),s.isub(d)),c.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(c),o.isub(s)):(r.isub(t),c.isub(a),s.isub(o))}return{a:c,b:s,gcd:r.iushln(f)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),c=new i(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,u=1;0===(t.words[0]&u)&&f<26;++f,u<<=1);if(f>0)for(t.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var d=0,l=1;0===(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)c.isOdd()&&c.iadd(s),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(c)):(r.isub(t),c.isub(o))}return(a=0===t.cmpn(1)?o:c).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,a=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,o=r;0!==i&&o<this.length;o++){var c=0|this.words[o];i=(c+=i)>>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:a<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){n<a?t=-1:n>a&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},a(M,w),M.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a<n;a++)t.words[a]=e.words[a];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,a=10;a<e.length;a++){var o=0|e.words[a];e.words[a-10]=(o&r)<<4|i>>>22,i=o}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(k,w),a(A,w),a(I,w),I.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,a=67108863&n;n>>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new k;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return y[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var c=new i(1).toRed(this),s=c.redNeg(),f=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,f).cmp(s);)u.redIAdd(s);for(var d=this.pow(u,a),l=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),b=o;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();n(m<b);var x=this.pow(d,new i(1).iushln(b-m-1));l=l.redMul(x),d=x.redSqr(),h=h.redMul(d),b=m}return l},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,c=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],u=s-1;u>=0;u--){var d=f>>u&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++c||0===n&&0===u)&&(a=this.mul(a,r[o]),c=0,o=0)):c=0}s=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},a(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},84530:function(e,t,r){"use strict";r.r(t),r.d(t,{keccak256:function(){return p},pack:function(){return b},sha256:function(){return m}});var n=r(2257),a=r(49716),i=r(88062),o=r(39598),c=r(83374),s=r(39502),f=new RegExp("^bytes([0-9]+)$"),u=new RegExp("^(u?int)([0-9]*)$"),d=new RegExp("^(.*)\\[([0-9]*)\\]$"),l=new s.Logger("solidity/5.7.0");function h(e,t,r){switch(e){case"address":return r?(0,a.zeroPad)(t,32):(0,a.arrayify)(t);case"string":return(0,c.Y0)(t);case"bytes":return(0,a.arrayify)(t);case"bool":return t=t?"0x01":"0x00",r?(0,a.zeroPad)(t,32):(0,a.arrayify)(t)}var i=e.match(u);if(i){var o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!==0||0===o||o>256)&&l.throwArgumentError("invalid number type","type",e),r&&(o=256),t=n.O$.from(t).toTwos(o),(0,a.zeroPad)(t,o/8)}if(i=e.match(f)){var s=parseInt(i[1]);return(String(s)!==i[1]||0===s||s>32)&&l.throwArgumentError("invalid bytes type","type",e),(0,a.arrayify)(t).byteLength!==s&&l.throwArgumentError("invalid value for ".concat(e),"value",t),r?(0,a.arrayify)((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if((i=e.match(d))&&Array.isArray(t)){var b=i[1];parseInt(i[2]||String(t.length))!=t.length&&l.throwArgumentError("invalid array length for ".concat(e),"value",t);var p=[];return t.forEach((function(e){p.push(h(b,e,!0))})),(0,a.concat)(p)}return l.throwArgumentError("invalid type","type",e)}function b(e,t){e.length!=t.length&&l.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);var r=[];return e.forEach((function(e,n){r.push(h(e,t[n]))})),(0,a.hexlify)((0,a.concat)(r))}function p(e,t){return(0,i.keccak256)(b(e,t))}function m(e,t){return(0,o.JQ)(b(e,t))}},23902:function(e,t,r){"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:function(){return i.Uj},Utf8ErrorFuncs:function(){return i.te},Utf8ErrorReason:function(){return i.Uw},_toEscapedUtf8String:function(){return i.U$},formatBytes32String:function(){return o},nameprep:function(){return g},parseBytes32String:function(){return c},toUtf8Bytes:function(){return i.Y0},toUtf8CodePoints:function(){return i.XL},toUtf8String:function(){return i.ZN}});var n=r(84867),a=r(49716),i=r(83374);function o(e){var t=(0,i.Y0)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,a.hexlify)((0,a.concat)([t,n.R]).slice(0,32))}function c(e){var t=(0,a.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return(0,i.ZN)(t.slice(0,r))}function s(e,t){t||(t=function(e){return[parseInt(e,16)]});var r=0,n={};return e.split(",").forEach((function(e){var a=e.split(":");r+=parseInt(a[0],16),n[r]=t(a[1])})),n}function f(e){var t=0;return e.split(",").map((function(e){var r=e.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:t+parseInt(r[0],16),h:t=parseInt(r[1],16)}}))}function u(e,t){for(var r=0,n=0;n<t.length;n++){var a=t[n];if(e>=(r+=a.l)&&e<=r+a.h&&(e-r)%(a.d||1)===0){if(a.e&&-1!==a.e.indexOf(e-r))continue;return a}}return null}var d=f("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),l="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),h=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],b=s("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),p=s("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),m=s("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!==0)throw new Error("bad data");for(var t=[],r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),x=f("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function g(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();var t,r=(0,i.XL)(e);t=r.map((function(e){if(l.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];var t=function(e){var t=u(e,h);if(t)return[e+t.s];var r=b[e];if(r)return r;var n=p[e];return n?[e+n[0]]:m[e]||null}(e);return t||[e]})),r=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[]),(r=(0,i.XL)((0,i.uu)(r),i.Uj.NFKC)).forEach((function(e){if(u(e,x))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(e){if(u(e,d))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=(0,i.uu)(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}},83374:function(e,t,r){"use strict";r.d(t,{Uj:function(){return n},te:function(){return s},Uw:function(){return a},U$:function(){return l},uu:function(){return h},Y0:function(){return u},XL:function(){return p},ZN:function(){return b}});var n,a,i=r(49716),o=new(r(39502).Logger)("strings/5.7.0");function c(e,t,r,n,i){if(e===a.BAD_PREFIX||e===a.UNEXPECTED_CONTINUE){for(var o=0,c=t+1;c<r.length&&r[c]>>6===2;c++)o++;return o}return e===a.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n||(n={})),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"}(a||(a={}));var s=Object.freeze({error:function(e,t,r,n,a){return o.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:c,replace:function(e,t,r,n,i){return e===a.OVERLONG?(n.push(i),0):(n.push(65533),c(e,t,r))}});function f(e,t){null==t&&(t=s.error),e=(0,i.arrayify)(e);for(var r=[],n=0;n<e.length;){var o=e[n++];if(o>>7!==0){var c=null,f=null;if(192===(224&o))c=1,f=127;else if(224===(240&o))c=2,f=2047;else{if(240!==(248&o)){n+=t(128===(192&o)?a.UNEXPECTED_CONTINUE:a.BAD_PREFIX,n-1,e,r);continue}c=3,f=65535}if(n-1+c>=e.length)n+=t(a.OVERRUN,n-1,e,r);else{for(var u=o&(1<<8-c-1)-1,d=0;d<c;d++){var l=e[n];if(128!=(192&l)){n+=t(a.MISSING_CONTINUE,n,e,r),u=null;break}u=u<<6|63&l,n++}null!==u&&(u>1114111?n+=t(a.OUT_OF_RANGE,n-1-c,e,r,u):u>=55296&&u<=57343?n+=t(a.UTF16_SURROGATE,n-1-c,e,r,u):u<=f?n+=t(a.OVERLONG,n-1-c,e,r,u):r.push(u))}}else r.push(o)}return r}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.current;t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],a=0;a<e.length;a++){var c=e.charCodeAt(a);if(c<128)r.push(c);else if(c<2048)r.push(c>>6|192),r.push(63&c|128);else if(55296==(64512&c)){a++;var s=e.charCodeAt(a);if(a>=e.length||56320!==(64512&s))throw new Error("invalid utf-8 string");var f=65536+((1023&c)<<10)+(1023&s);r.push(f>>18|240),r.push(f>>12&63|128),r.push(f>>6&63|128),r.push(63&f|128)}else r.push(c>>12|224),r.push(c>>6&63|128),r.push(63&c|128)}return(0,i.arrayify)(r)}function d(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function l(e,t){return'"'+f(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?d(e):d(55296+((e-=65536)>>10&1023))+d(56320+(1023&e))})).join("")+'"'}function h(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function b(e,t){return h(f(e,t))}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.current;return f(u(e,t))}},25452:function(e,t,r){"use strict";r.r(t),r.d(t,{TransactionTypes:function(){return n},accessListify:function(){return M},computeAddress:function(){return g},parse:function(){return _},recoverAddress:function(){return v},serialize:function(){return E}});var n,a=r(97419),i=r(2257),o=r(49716),c=r(75422),s=r(88062),f=r(30520),u=r(17986),d=r(78865),l=r(39502),h=new l.Logger("transactions/5.7.0");function b(e){return"0x"===e?null:(0,a.getAddress)(e)}function p(e){return"0x"===e?c._Y:i.O$.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(n||(n={}));var m=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],x={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function g(e){var t=(0,d.computePublicKey)(e);return(0,a.getAddress)((0,o.hexDataSlice)((0,s.keccak256)((0,o.hexDataSlice)(t,1)),12))}function v(e,t){return g((0,d.recoverPublicKey)((0,o.arrayify)(e),t))}function y(e,t){var r=(0,o.stripZeros)(i.O$.from(e).toHexString());return r.length>32&&h.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function w(e,t){return{address:(0,a.getAddress)(e),storageKeys:(t||[]).map((function(t,r){return 32!==(0,o.hexDataLength)(t)&&h.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function M(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&h.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),w(e[0],e[1])):w(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var r=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return w(t,Object.keys(r).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function k(e){return M(e).map((function(e){return[e.address,e.storageKeys]}))}function A(e,t){if(null!=e.gasPrice){var r=i.O$.from(e.gasPrice),n=i.O$.from(e.maxFeePerGas||0);r.eq(n)||h.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var c=[y(e.chainId||0,"chainId"),y(e.nonce||0,"nonce"),y(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),y(e.maxFeePerGas||0,"maxFeePerGas"),y(e.gasLimit||0,"gasLimit"),null!=e.to?(0,a.getAddress)(e.to):"0x",y(e.value||0,"value"),e.data||"0x",k(e.accessList||[])];if(t){var s=(0,o.splitSignature)(t);c.push(y(s.recoveryParam,"recoveryParam")),c.push((0,o.stripZeros)(s.r)),c.push((0,o.stripZeros)(s.s))}return(0,o.hexConcat)(["0x02",u.encode(c)])}function I(e,t){var r=[y(e.chainId||0,"chainId"),y(e.nonce||0,"nonce"),y(e.gasPrice||0,"gasPrice"),y(e.gasLimit||0,"gasLimit"),null!=e.to?(0,a.getAddress)(e.to):"0x",y(e.value||0,"value"),e.data||"0x",k(e.accessList||[])];if(t){var n=(0,o.splitSignature)(t);r.push(y(n.recoveryParam,"recoveryParam")),r.push((0,o.stripZeros)(n.r)),r.push((0,o.stripZeros)(n.s))}return(0,o.hexConcat)(["0x01",u.encode(r)])}function E(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&h.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,f.checkProperties)(e,x);var r=[];m.forEach((function(t){var n=e[t.name]||[],a={};t.numeric&&(a.hexPad="left"),n=(0,o.arrayify)((0,o.hexlify)(n,a)),t.length&&n.length!==t.length&&n.length>0&&h.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,o.stripZeros)(n)).length>t.maxLength&&h.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push((0,o.hexlify)(n))}));var n=0;if(null!=e.chainId?"number"!==typeof(n=e.chainId)&&h.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!(0,o.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,o.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return u.encode(r);var a=(0,o.splitSignature)(t),i=27+a.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),i+=2*n+8,a.v>28&&a.v!==i&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):a.v!==i&&h.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,o.hexlify)(i)),r.push((0,o.stripZeros)((0,o.arrayify)(a.r))),r.push((0,o.stripZeros)((0,o.arrayify)(a.s))),u.encode(r)}(e,t);switch(e.type){case 1:return I(e,t);case 2:return A(e,t)}return h.throwError("unsupported transaction type: ".concat(e.type),l.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function S(e,t,r){try{var n=p(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(i){h.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,o.hexZeroPad)(t[1],32),e.s=(0,o.hexZeroPad)(t[2],32);try{var a=(0,s.keccak256)(r(e));e.from=v(a,{r:e.r,s:e.s,recoveryParam:e.v})}catch(i){}}function _(e){var t=(0,o.arrayify)(e);if(t[0]>127)return function(e){var t=u.decode(e);9!==t.length&&6!==t.length&&h.throwArgumentError("invalid raw transaction","rawTransaction",e);var r={nonce:p(t[0]).toNumber(),gasPrice:p(t[1]),gasLimit:p(t[2]),to:b(t[3]),value:p(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=i.O$.from(t[6]).toNumber()}catch(f){return r}if(r.r=(0,o.hexZeroPad)(t[7],32),r.s=(0,o.hexZeroPad)(t[8],32),i.O$.from(r.r).isZero()&&i.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,a=t.slice(0,6);0!==r.chainId&&(a.push((0,o.hexlify)(r.chainId)),a.push("0x"),a.push("0x"),n-=2*r.chainId+8);var c=(0,s.keccak256)(u.encode(a));try{r.from=v(c,{r:(0,o.hexlify)(r.r),s:(0,o.hexlify)(r.s),recoveryParam:n})}catch(f){}r.hash=(0,s.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){var t=u.decode(e.slice(1));8!==t.length&&11!==t.length&&h.throwArgumentError("invalid component count for transaction type: 1","payload",(0,o.hexlify)(e));var r={type:1,chainId:p(t[0]).toNumber(),nonce:p(t[1]).toNumber(),gasPrice:p(t[2]),gasLimit:p(t[3]),to:b(t[4]),value:p(t[5]),data:t[6],accessList:M(t[7])};return 8===t.length||(r.hash=(0,s.keccak256)(e),S(r,t.slice(8),I)),r}(t);case 2:return function(e){var t=u.decode(e.slice(1));9!==t.length&&12!==t.length&&h.throwArgumentError("invalid component count for transaction type: 2","payload",(0,o.hexlify)(e));var r=p(t[2]),n=p(t[3]),a={type:2,chainId:p(t[0]).toNumber(),nonce:p(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:p(t[4]),to:b(t[5]),value:p(t[6]),data:t[7],accessList:M(t[8])};return 9===t.length||(a.hash=(0,s.keccak256)(e),S(a,t.slice(9),A)),a}(t)}return h.throwError("unsupported transaction type: ".concat(t[0]),l.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},6222:function(e,t,r){"use strict";r.r(t),r.d(t,{commify:function(){return o},formatEther:function(){return f},formatUnits:function(){return c},parseEther:function(){return u},parseUnits:function(){return s}});var n=r(1503),a=new(r(39502).Logger)("units/5.7.0"),i=["wei","kwei","mwei","gwei","szabo","finney","ether"];function o(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&a.throwArgumentError("invalid value","value",e);var r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var c=r.length-3;o.unshift(r.substring(c)),r=r.substring(0,c)}return n+o.join(",")+i}function c(e,t){if("string"===typeof t){var r=i.indexOf(t);-1!==r&&(t=3*r)}return(0,n.S5)(e,null!=t?t:18)}function s(e,t){if("string"!==typeof e&&a.throwArgumentError("value must be a string","value",e),"string"===typeof t){var r=i.indexOf(t);-1!==r&&(t=3*r)}return(0,n.Ox)(e,null!=t?t:18)}function f(e){return c(e,18)}function u(e){return s(e,18)}},22876:function(e,t,r){"use strict";r.r(t),r.d(t,{Wallet:function(){return E},verifyMessage:function(){return S},verifyTypedData:function(){return _}});var n=r(27166),a=r(27853),i=r(84531),o=r(6148),c=r(81020),s=r(18992),f=r(97419),u=r(69745),d=r(68408),l=r(49716),h=r(2273),b=r(35992),p=r(50117),m=r(88062),x=r(30520),g=r(15244),v=r(78865),y=r(31529),w=r(13463),M=r(25452),k=r(39502),A=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},I=new k.Logger("wallet/5.7.0");var E=function(e){(0,c.Z)(r,e);var t=(0,s.Z)(r);function r(e,n){var i,c;if((0,a.Z)(this,r),i=t.call(this),null!=(c=e)&&(0,l.isHexString)(c.privateKey,32)&&null!=c.address){var s=new v.SigningKey(e.privateKey);if((0,x.defineReadOnly)((0,o.Z)(i),"_signingKey",(function(){return s})),(0,x.defineReadOnly)((0,o.Z)(i),"address",(0,M.computeAddress)(i.publicKey)),i.address!==(0,f.getAddress)(e.address)&&I.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){var t=e.mnemonic;return t&&t.phrase}(e)){var d=e.mnemonic;(0,x.defineReadOnly)((0,o.Z)(i),"_mnemonic",(function(){return{phrase:d.phrase,path:d.path||p.defaultPath,locale:d.locale||"en"}}));var h=i.mnemonic,b=p.HDNode.fromMnemonic(h.phrase,null,h.locale).derivePath(h.path);(0,M.computeAddress)(b.privateKey)!==i.address&&I.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,x.defineReadOnly)((0,o.Z)(i),"_mnemonic",(function(){return null}))}else{if(v.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&I.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,x.defineReadOnly)((0,o.Z)(i),"_signingKey",(function(){return e}));else{"string"===typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);var m=new v.SigningKey(e);(0,x.defineReadOnly)((0,o.Z)(i),"_signingKey",(function(){return m}))}(0,x.defineReadOnly)((0,o.Z)(i),"_mnemonic",(function(){return null})),(0,x.defineReadOnly)((0,o.Z)(i),"address",(0,M.computeAddress)(i.publicKey))}return n&&!u.zt.isProvider(n)&&I.throwArgumentError("invalid provider","provider",n),(0,x.defineReadOnly)((0,o.Z)(i),"provider",n||null),i}return(0,i.Z)(r,[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(e){return new r(this,e)}},{key:"signTransaction",value:function(e){var t=this;return(0,x.resolveProperties)(e).then((function(r){null!=r.from&&((0,f.getAddress)(r.from)!==t.address&&I.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);var n=t._signingKey().signDigest((0,m.keccak256)((0,M.serialize)(r)));return(0,M.serialize)(r,n)}))}},{key:"signMessage",value:function(e){return A(this,void 0,void 0,(0,n.Z)().mark((function t(){return(0,n.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,l.joinSignature)(this._signingKey().signDigest((0,h.r)(e))));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,r){return A(this,void 0,void 0,(0,n.Z)().mark((function a(){var i,o=this;return(0,n.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,b.E.resolveNames(e,t,r,(function(e){return null==o.provider&&I.throwError("cannot resolve ENS names without a provider",k.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),o.provider.resolveName(e)}));case 2:return i=n.sent,n.abrupt("return",(0,l.joinSignature)(this._signingKey().signDigest(b.E.hash(i.domain,t,i.value))));case 4:case"end":return n.stop()}}),a,this)})))}},{key:"encrypt",value:function(e,t,r){if("function"!==typeof t||r||(r=t,t={}),r&&"function"!==typeof r)throw new Error("invalid callback");return t||(t={}),(0,w.HI)(this,e,t,r)}}],[{key:"createRandom",value:function(e){var t=(0,g.O)(16);e||(e={}),e.extraEntropy&&(t=(0,l.arrayify)((0,l.hexDataSlice)((0,m.keccak256)((0,l.concat)([t,e.extraEntropy])),0,16)));var n=(0,p.entropyToMnemonic)(t,e.locale);return r.fromMnemonic(n,e.path,e.locale)}},{key:"fromEncryptedJson",value:function(e,t,n){return(0,y.decryptJsonWallet)(e,t,n).then((function(e){return new r(e)}))}},{key:"fromEncryptedJsonSync",value:function(e,t){return new r((0,y.decryptJsonWalletSync)(e,t))}},{key:"fromMnemonic",value:function(e,t,n){return t||(t=p.defaultPath),new r(p.HDNode.fromMnemonic(e,null,n).derivePath(t))}}]),r}(d.Signer);function S(e,t){return(0,M.recoverAddress)((0,h.r)(e),t)}function _(e,t,r,n){return(0,M.recoverAddress)(b.E.hash(e,t,r),n)}},65889:function(e,t,r){"use strict";r.r(t),r.d(t,{_fetchData:function(){return p},fetchJson:function(){return m},poll:function(){return x}});var n=r(27166),a=r(87354),i=r(49716),o=r(30520),c=r(83374),s=r(39502),f=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))};function u(e,t){return f(this,void 0,void 0,(0,n.Z)().mark((function r(){var a,o,c,s,f;return(0,n.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t={}),a={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(a.mode="cors",a.cache="no-cache",a.credentials="same-origin",a.redirect="follow",a.referrer="client"),null!=t.fetchOptions&&((o=t.fetchOptions).mode&&(a.mode=o.mode),o.cache&&(a.cache=o.cache),o.credentials&&(a.credentials=o.credentials),o.redirect&&(a.redirect=o.redirect),o.referrer&&(a.referrer=o.referrer)),r.next=7,fetch(e,a);case 7:return c=r.sent,r.next=10,c.arrayBuffer();case 10:return s=r.sent,f={},c.headers.forEach?c.headers.forEach((function(e,t){f[t.toLowerCase()]=e})):c.headers.keys().forEach((function(e){f[e.toLowerCase()]=c.headers.get(e)})),r.abrupt("return",{headers:f,statusCode:c.status,statusMessage:c.statusText,body:(0,i.arrayify)(new Uint8Array(s))});case 14:case"end":return r.stop()}}),r)})))}var d=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{s(n.next(e))}catch(t){i(t)}}function c(e){try{s(n.throw(e))}catch(t){i(t)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((n=n.apply(e,t||[])).next())}))},l=new s.Logger("web/5.7.1");function h(e){return new Promise((function(t){setTimeout(t,e)}))}function b(e,t){if(null==e)return null;if("string"===typeof e)return e;if((0,i.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,c.ZN)(e)}catch(r){}return(0,i.hexlify)(e)}return e}function p(e,t,r){var i="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;l.assertArgument(i>0&&i%1===0,"invalid connection throttle limit","connection.throttleLimit",i);var f="object"===typeof e?e.throttleCallback:null,p="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;l.assertArgument(p>0&&p%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",p);var m="object"===typeof e&&!!e.errorPassThrough,x={},g=null,v={method:"GET"},y=!1,w=12e4;if("string"===typeof e)g=e;else if("object"===typeof e){if(null!=e&&null!=e.url||l.throwArgumentError("missing URL","connection.url",e),g=e.url,"number"===typeof e.timeout&&e.timeout>0&&(w=e.timeout),e.headers)for(var M in e.headers)x[M.toLowerCase()]={key:M,value:String(e.headers[M])},["if-none-match","if-modified-since"].indexOf(M.toLowerCase())>=0&&(y=!0);if(v.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==g.substring(0,6)&&!0!==e.allowInsecureAuthentication&&l.throwError("basic authentication requires a secure https url",s.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:g,user:e.user,password:"[REDACTED]"});var k=e.user+":"+e.password;x.authorization={key:"Authorization",value:"Basic "+(0,a.c)((0,c.Y0)(k))}}null!=e.skipFetchSetup&&(v.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(v.fetchOptions=(0,o.shallowCopy)(e.fetchOptions))}var A,I=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),E=g?g.match(I):null;if(E)try{var S={statusCode:200,statusMessage:"OK",headers:{"content-type":E[1]||"text/plain"},body:E[2]?(0,a.J)(E[3]):(A=E[3],(0,c.Y0)(A.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},_=S.body;return r&&(_=r(S.body,S)),Promise.resolve(_)}catch(T){l.throwError("processing response error",s.Logger.errors.SERVER_ERROR,{body:b(E[1],E[2]),error:T,requestBody:null,requestMethod:"GET",url:g})}t&&(v.method="POST",v.body=t,null==x["content-type"]&&(x["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==x["content-length"]&&(x["content-length"]={key:"Content-Length",value:String(t.length)}));var N={};Object.keys(x).forEach((function(e){var t=x[e];N[t.key]=t.value})),v.headers=N;var j=function(){var e=null;return{promise:new Promise((function(t,r){w&&(e=setTimeout((function(){null!=e&&(e=null,r(l.makeError("timeout",s.Logger.errors.TIMEOUT,{requestBody:b(v.body,N["content-type"]),requestMethod:v.method,timeout:w,url:g})))}),w))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),C=function(){return d(this,void 0,void 0,(0,n.Z)().mark((function e(){var t,a,o,c,d,x,w,M,k,A;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<i)){e.next=65;break}return a=null,e.prev=3,e.next=6,u(g,v);case 6:if(a=e.sent,!(t<i)){e.next=28;break}if(301!==a.statusCode&&302!==a.statusCode){e.next=15;break}if(o=a.headers.location||"","GET"!==v.method||!o.match(/^https:/)){e.next=13;break}return g=a.headers.location,e.abrupt("continue",62);case 13:e.next=28;break;case 15:if(429!==a.statusCode){e.next=28;break}if(c=!0,!f){e.next=21;break}return e.next=20,f(t,g);case 20:c=e.sent;case 21:if(!c){e.next=28;break}return d=0,x=a.headers["retry-after"],d="string"===typeof x&&x.match(/^[1-9][0-9]*$/)?1e3*parseInt(x):p*parseInt(String(Math.random()*Math.pow(2,t))),e.next=27,h(d);case 27:return e.abrupt("continue",62);case 28:e.next=34;break;case 30:e.prev=30,e.t0=e.catch(3),null==(a=e.t0.response)&&(j.cancel(),l.throwError("missing response",s.Logger.errors.SERVER_ERROR,{requestBody:b(v.body,N["content-type"]),requestMethod:v.method,serverError:e.t0,url:g}));case 34:if(w=a.body,y&&304===a.statusCode?w=null:!m&&(a.statusCode<200||a.statusCode>=300)&&(j.cancel(),l.throwError("bad response",s.Logger.errors.SERVER_ERROR,{status:a.statusCode,headers:a.headers,body:b(w,a.headers?a.headers["content-type"]:null),requestBody:b(v.body,N["content-type"]),requestMethod:v.method,url:g})),!r){e.next=60;break}return e.prev=37,e.next=40,r(w,a);case 40:return M=e.sent,j.cancel(),e.abrupt("return",M);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&t<i)){e.next=58;break}if(k=!0,!f){e.next=53;break}return e.next=52,f(t,g);case 52:k=e.sent;case 53:if(!k){e.next=58;break}return A=p*parseInt(String(Math.random()*Math.pow(2,t))),e.next=57,h(A);case 57:return e.abrupt("continue",62);case 58:j.cancel(),l.throwError("processing response error",s.Logger.errors.SERVER_ERROR,{body:b(w,a.headers?a.headers["content-type"]:null),error:e.t1,requestBody:b(v.body,N["content-type"]),requestMethod:v.method,url:g});case 60:return j.cancel(),e.abrupt("return",w);case 62:t++,e.next=1;break;case 65:return e.abrupt("return",l.throwError("failed response",s.Logger.errors.SERVER_ERROR,{requestBody:b(v.body,N["content-type"]),requestMethod:v.method,url:g}));case 66:case"end":return e.stop()}}),e,null,[[3,30],[37,45]])})))}();return Promise.race([j.promise,C])}function m(e,t,r){var n=null;if(null!=t){n=(0,c.Y0)(t);var a="string"===typeof e?{url:e}:(0,o.shallowCopy)(e);if(a.headers)0!==Object.keys(a.headers).filter((function(e){return"content-type"===e.toLowerCase()})).length||(a.headers=(0,o.shallowCopy)(a.headers),a.headers["content-type"]="application/json");else a.headers={"content-type":"application/json"};e=a}return p(e,n,(function(e,t){var n=null;if(null!=e)try{n=JSON.parse((0,c.ZN)(e))}catch(a){l.throwError("invalid JSON",s.Logger.errors.SERVER_ERROR,{body:e,error:a})}return r&&(n=r(n,t)),n}))}function x(e,t){return t||(t={}),null==(t=(0,o.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){var a=null,i=!1,o=function(){return!i&&(i=!0,a&&clearTimeout(a),!0)};t.timeout&&(a=setTimeout((function(){o()&&n(new Error("timeout"))}),t.timeout));var c=t.retryLimit,s=0;!function a(){return e().then((function(e){if(void 0!==e)o()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",a);else if(t.onceBlock)t.onceBlock.once("block",a);else if(!i){if(++s>c)return void(o()&&n(new Error("retry limit reached")));var f=t.interval*parseInt(String(Math.random()*Math.pow(2,s)));f<t.floor&&(f=t.floor),f>t.ceiling&&(f=t.ceiling),setTimeout(a,f)}return null}),(function(e){o()&&n(e)}))}()}))}},57561:function(e,t,r){"use strict";r.r(t),r.d(t,{Wordlist:function(){return n.D},logger:function(){return n.k},wordlists:function(){return a.E}});var n=r(75760),a=r(42646)},75760:function(e,t,r){"use strict";r.d(t,{D:function(){return f},k:function(){return s}});var n=r(27853),a=r(84531),i=r(51583),o=r(30520),c=r(39502),s=new c.Logger("wordlists/5.7.0"),f=function(){function e(t){(0,n.Z)(this,e),s.checkAbstract(this instanceof e?this.constructor:void 0,e),(0,o.defineReadOnly)(this,"locale",t)}return(0,a.Z)(e,[{key:"split",value:function(e){return e.toLowerCase().split(/ +/g)}},{key:"join",value:function(e){return e.join(" ")}}],[{key:"check",value:function(e){for(var t=[],r=0;r<2048;r++){var n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return(0,i.id)(t.join("\n")+"\n")}},{key:"register",value:function(e,t){t||(t=e.locale)}}]),e}()},42646:function(e,t,r){"use strict";r.d(t,{E:function(){return d}});var n=r(27853),a=r(84531),i=r(81020),o=r(18992),c=r(75760),s=null;function f(e){if(null==s&&(s="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==c.D.check(e)))throw s=null,new Error("BIP39 Wordlist for en (English) FAILED")}var u=new(function(e){(0,i.Z)(r,e);var t=(0,o.Z)(r);function r(){return(0,n.Z)(this,r),t.call(this,"en")}return(0,a.Z)(r,[{key:"getWord",value:function(e){return f(this),s[e]}},{key:"getWordIndex",value:function(e){return f(this),s.indexOf(e)}}]),r}(c.D));c.D.register(u);var d={en:u}},67109:function(e,t,r){"use strict";var n=r(48064).default,a=r(18231).default,i=r(89137).default,o=r(53744).default;function c(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout((function(){throw n}))}}function s(e){for(var t=e.length,r=new Array(t),n=0;n<t;n+=1)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var f=function(e){i(r,e);var t=o(r);function r(){return n(this,r),t.apply(this,arguments)}return a(r,[{key:"emit",value:function(e){var t="error"===e,r=this._events;if(void 0!==r)t=t&&void 0===r.error;else if(!t)return!1;for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];if(t){var o;if(a.length>0&&(o=a[0]),o instanceof Error)throw o;var f=new Error("Unhandled error.".concat(o?" (".concat(o.message,")"):""));throw f.context=o,f}var u=r[e];if(void 0===u)return!1;if("function"===typeof u)c(u,this,a);else for(var d=u.length,l=s(u),h=0;h<d;h+=1)c(l[h],this,a);return!0}}]),r}(r(47465).EventEmitter);t.default=f},7767:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,o){if("function"!==typeof n)throw new TypeError("The listener must be a function");var c=new a(n,i||e,o),s=r?r+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],c]:e._events[s].push(c):(e._events[s]=c,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function c(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),c.prototype.eventNames=function(){var e,n,a=[];if(0===this._eventsCount)return a;for(n in e=this._events)t.call(e,n)&&a.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,i=n.length,o=new Array(i);a<i;a++)o[a]=n[a].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,a,i,o){var c=r?r+e:e;if(!this._events[c])return!1;var s,f,u=this._events[c],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,a),!0;case 5:return u.fn.call(u.context,t,n,a,i),!0;case 6:return u.fn.call(u.context,t,n,a,i,o),!0}for(f=1,s=new Array(d-1);f<d;f++)s[f-1]=arguments[f];u.fn.apply(u.context,s)}else{var l,h=u.length;for(f=0;f<h;f++)switch(u[f].once&&this.removeListener(e,u[f].fn,void 0,!0),d){case 1:u[f].fn.call(u[f].context);break;case 2:u[f].fn.call(u[f].context,t);break;case 3:u[f].fn.call(u[f].context,t,n);break;case 4:u[f].fn.call(u[f].context,t,n,a);break;default:if(!s)for(l=1,s=new Array(d-1);l<d;l++)s[l-1]=arguments[l];u[f].fn.apply(u[f].context,s)}}return!0},c.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},c.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},c.prototype.removeListener=function(e,t,n,a){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return o(this,i),this;var c=this._events[i];if(c.fn)c.fn!==t||a&&!c.once||n&&c.context!==n||o(this,i);else{for(var s=0,f=[],u=c.length;s<u;s++)(c[s].fn!==t||a&&!c[s].once||n&&c[s].context!==n)&&f.push(c[s]);f.length?this._events[i]=1===f.length?f[0]:f:o(this,i)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,e.exports=c},69191:function(e,t,r){"use strict";r.r(t),r.d(t,{detectEnv:function(){return g},detectOS:function(){return v},formatIOSMobile:function(){return H},formatMobileRegistry:function(){return $},formatMobileRegistryEntry:function(){return X},getClientMeta:function(){return R},getCrypto:function(){return D},getCryptoOrThrow:function(){return L},getDappRegistryUrl:function(){return K},getDocument:function(){return _},getDocumentOrThrow:function(){return S},getFromWindow:function(){return I},getFromWindowOrThrow:function(){return E},getLocal:function(){return F},getLocalStorage:function(){return P},getLocalStorageOrThrow:function(){return O},getLocation:function(){return T},getLocationOrThrow:function(){return C},getMobileLinkRegistry:function(){return Q},getMobileRegistryEntry:function(){return q},getNavigator:function(){return j},getNavigatorOrThrow:function(){return N},getWalletRegistryUrl:function(){return J},isAndroid:function(){return y},isBrowser:function(){return A},isIOS:function(){return w},isMobile:function(){return M},isNode:function(){return k},mobileLinkChoiceKey:function(){return G},removeLocal:function(){return Y},safeJsonParse:function(){return z},safeJsonStringify:function(){return U},saveMobileLinkInfo:function(){return W},setLocal:function(){return Z}});var n=r(37296),a=r(29808),i=r(1426),o=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var i=arguments[t],o=0,c=i.length;o<c;o++,a++)n[a]=i[o];return n},c=function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"},s=function(e){this.version=e,this.type="node",this.name="node",this.os=i.platform},f=function(e,t,r,n){this.name=e,this.version=t,this.os=r,this.bot=n,this.type="bot-device"},u=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},d=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},l=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,h=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],b=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function p(e){return e?x(e):"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product?new d:"undefined"!==typeof navigator?x(navigator.userAgent):"undefined"!==typeof i&&i.version?new s(i.version.slice(1)):null}function m(e){return""!==e&&h.reduce((function(t,r){var n=r[0],a=r[1];if(t)return t;var i=a.exec(e);return!!i&&[n,i]}),!1)}function x(e){var t=m(e);if(!t)return null;var r=t[0],n=t[1];if("searchbot"===r)return new u;var a=n[1]&&n[1].split(/[._]/).slice(0,3);a?a.length<3&&(a=o(a,function(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}(3-a.length))):a=[];var i=a.join("."),s=function(e){for(var t=0,r=b.length;t<r;t++){var n=b[t],a=n[0];if(n[1].exec(e))return a}return null}(e),d=l.exec(e);return d&&d[1]?new f(r,i,s,d[1]):new c(r,i,s)}function g(e){return p(e)}function v(){var e=g();return e&&e.os?e.os:void 0}function y(){var e=v();return!!e&&e.toLowerCase().includes("android")}function w(){var e=v();return!!e&&(e.toLowerCase().includes("ios")||e.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}function M(){return!!v()&&(y()||w())}function k(){var e=g();return!(!e||!e.name)&&"node"===e.name.toLowerCase()}function A(){return!k()&&!!j()}var I=a.getFromWindow,E=a.getFromWindowOrThrow,S=a.getDocumentOrThrow,_=a.getDocument,N=a.getNavigatorOrThrow,j=a.getNavigator,C=a.getLocationOrThrow,T=a.getLocation,L=a.getCryptoOrThrow,D=a.getCrypto,O=a.getLocalStorageOrThrow,P=a.getLocalStorage;function R(){return n.D()}var B=r(75457),z=B.D,U=B.u;function Z(e,t){var r=U(t),n=P();n&&n.setItem(e,r)}function F(e){var t=null,r=P();return r&&(t=r.getItem(e)),t?z(t):t}function Y(e){var t=P();t&&t.removeItem(e)}var G="WALLETCONNECT_DEEPLINK_CHOICE";function H(e,t){var r=encodeURIComponent(e);return t.universalLink?"".concat(t.universalLink,"/wc?uri=").concat(r):t.deepLink?"".concat(t.deepLink).concat(t.deepLink.endsWith(":")?"//":"/","wc?uri=").concat(r):""}function W(e){var t=e.href.split("?")[0];Z(G,Object.assign(Object.assign({},e),{href:t}))}function q(e,t){return e.filter((function(e){return e.name.toLowerCase().includes(t.toLowerCase())}))[0]}function Q(e,t){var r=e;return t&&(r=t.map((function(t){return q(e,t)})).filter(Boolean)),r}var V="https://registry.walletconnect.com";function J(){return V+"/api/v2/wallets"}function K(){return V+"/api/v2/dapps"}function X(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mobile";return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:null!==(t=e.image_url.sm)&&void 0!==t?t:"",universalLink:e[r].universal||"",deepLink:e[r].native||""}}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mobile";return Object.values(e).filter((function(e){return!!e[t].universal||!!e[t].native})).map((function(e){return X(e,t)}))}},9122:function(e,t,r){"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function a(){var e=n();return e.subtle||e.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=a,t.isBrowserCryptoAvailable=function(){return!!n()&&!!a()}},54683:function(e,t,r){"use strict";var n=r(1426);function a(){return"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product}function i(){return"undefined"!==typeof n&&"undefined"!==typeof n.versions&&"undefined"!==typeof n.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=a,t.isNode=i,t.isBrowser=function(){return!a()&&!i()}},67323:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),a(r(9122),t),a(r(54683),t)},42163:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return lt}});var n={};r.r(n),r.d(n,{decrypt:function(){return it},encrypt:function(){return nt},generateKey:function(){return $e},verifyHmac:function(){return tt}});var a=r(27166),i=r(33032),o=r(27853),c=r(84531),s=r(14042),f=r.n(s),u=r(81020),d=r(18992),l=r(47465),h=r(28477),b=function(e){(0,u.Z)(r,e);var t=(0,d.Z)(r);function r(e){var n;return(0,o.Z)(this,r),(n=t.call(this,e)).events=new l.EventEmitter,n.hasRegisteredEventListeners=!1,n.connection=n.setConnection(e),n.connection.connected&&n.registerEventListeners(),n}return(0,c.Z)(r,[{key:"connect",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(){var t,r=arguments;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[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,a.Z)().mark((function e(){return(0,a.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,a.Z)().mark((function e(t,r){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.requestStrict((0,h.formatJsonRpcRequest)(t.method,t.params||[]),r));case 1:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"requestStrict",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t,r){var n=this;return(0,a.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,a.Z)().mark((function e(i,o){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.connection.connected){e.next=9;break}return e.prev=1,e.next=4,n.open();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),o(e.t0);case 9:return n.events.on("".concat(t.id),(function(e){(0,h.isJsonRpcError)(e)?o(e.error):i(e.result)})),e.prev=10,e.next=13,n.connection.send(t,r);case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(10),o(e.t1);case 18:case"end":return e.stop()}}),e,null,[[1,6],[10,15]])})));return function(t,r){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"setConnection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.connection;return e}},{key:"onPayload",value:function(e){this.events.emit("payload",e),(0,h.isJsonRpcResponse)(e)?this.events.emit("".concat(e.id),e):this.events.emit("message",{type:e.method,data:e.params})}},{key:"open",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(){var t,r=arguments;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.length>0&&void 0!==r[0]?r[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,a.Z)().mark((function e(){return(0,a.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(){return e.events.emit("disconnect")})),this.connection.on("error",(function(t){return e.events.emit("error",t)})),this.hasRegisteredEventListeners=!0)}}]),r}(h.IJsonRpcProvider),p=r(68524),m=r.n(p),x=r(75457),g={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},v=function(){function e(t){if((0,o.Z)(this,e),this.url=t,this.events=new l.EventEmitter,this.isAvailable=!1,this.registering=!1,!(0,h.isHttpUrl)(t))throw new Error("Provided URL is not compatible with HTTP connection: ".concat(t));this.url=t}return(0,c.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,a.Z)().mark((function e(){var t,r=arguments;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[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,a.Z)().mark((function e(){return(0,a.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,a.Z)().mark((function e(t,r){var n,i,o;return(0,a.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,n=(0,x.u)(t),e.next=7,m()(this.url,Object.assign(Object.assign({},g),{body:n}));case 7:return i=e.sent,e.next=10,i.json();case 10:o=e.sent,this.onPayload({data:o}),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,r){return e.apply(this,arguments)}}()},{key:"register",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(){var t,r,n,i,o=this,c=arguments;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:this.url,(0,h.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 r=this.events.getMaxListeners(),(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),e.abrupt("return",new Promise((function(e,t){o.events.once("register_error",(function(e){o.resetMaxListeners(),t(e)})),o.events.once("open",(function(){if(o.resetMaxListeners(),"undefined"===typeof o.isAvailable)return t(new Error("HTTP connection is missing or invalid"));e()}))})));case 7:return this.url=t,this.registering=!0,e.prev=9,n=(0,x.u)({id:1,jsonrpc:"2.0",method:"test",params:[]}),e.next=13,m()(t,Object.assign(Object.assign({},g),{body:n}));case 13:this.onOpen(),e.next=22;break;case 16:throw e.prev=16,e.t0=e.catch(9),i=this.parseError(e.t0),this.events.emit("register_error",i),this.onClose(),i;case 22:case"end":return e.stop()}}),e,this,[[9,16]])})));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,x.D)(e.data):e.data;this.events.emit("payload",t)}}},{key:"onError",value:function(e,t){var r=this.parseError(t),n=r.message||r.toString(),a=(0,h.formatJsonRpcError)(e,n);this.events.emit("payload",a)}},{key:"parseError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.url;return(0,h.parseConnectionError)(e,t,"HTTP")}},{key:"resetMaxListeners",value:function(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}]),e}(),y=r(69191),w=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],M=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],k={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"},A=r(54734),I=r.n(A),E=r(35531),S=(r(75520),r(16758)),_=r.n(S),N=r(19778).Buffer,j="hex",C="utf8",T="0";function L(e){return new Uint8Array(e)}function D(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.toString(j);return t?V(r):r}function O(e){return e.toString(C)}function P(e){return _()(e)}function R(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return D(P(e),t)}function B(e){return O(P(e))}function z(e){return N.from(Q(e),j)}function U(e){return L(z(e))}function Z(e){return N.from(e,C)}function F(e){return L(Z(e))}function Y(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function G(){for(var e=[],t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.forEach((function(t){return e=e.concat(Array.from(t))})),new Uint8Array((0,E.Z)(e))}function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=e%t;return r?(e-r)/t*t+t:e}function W(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T;return q(e,H(e.length,t),r)}function q(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T;return K(e,t,!0,r)}function Q(e){return e.replace(/^0x/,"")}function V(e){return e.startsWith("0x")?e:"0x".concat(e)}function J(e){return(e=W(e=Q(e),2))&&(e=V(e)),e}function K(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:T,a=t-e.length,i=e;if(a>0){var o=n.repeat(a);i=r?o+e:e+o}return i}function X(e){return P(new Uint8Array(e))}function $(e){return L(e).buffer}function ee(e,t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return D(Z(e),t)}(e,!t)}function te(e,t){var r=Q(J(new(I())(e).toString(16)));return t?r:V(r)}var re=r(27898);function ne(e){return J(e)}function ae(e){return function(e){var t=e.startsWith("0x");return e=(e=Q(e)).startsWith(T)?e.substring(1):e,t?V(e):e}(V(e))}var ie=h.payloadId;function oe(){return function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t}()}function ce(e,t){var r,n=function(e,t){var r,n=k[e];return n&&(r="https://".concat(n,".infura.io/v3/").concat(t)),r}(e,t.infuraId);return t.custom&&t.custom[e]?r=t.custom[e]:n&&(r=n),r}function se(e,t){return Y(e,t)}function fe(e){return"undefined"!==typeof e.result}function ue(e){return"undefined"!==typeof e.error}function de(e){return"undefined"!==typeof e.event}function le(e){return!!e.method.startsWith("wc_")||!M.includes(e.method)}function he(e){e=Q(e.toLowerCase());for(var t=Q((0,re.keccak_256)(Z(e))),r="",n=0;n<e.length;n++)parseInt(t[n],16)>7?r+=e[n].toUpperCase():r+=e[n];return V(r)}function be(e){var t;return(t=e)&&t.length&&!se(e[0])&&(e[0]=ee(e[0])),e}function pe(e){if("undefined"!==typeof e.type&&"0"!==e.type)return e;if("undefined"===typeof e.from||(!(t=e.from)||"0x"!==t.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(t)||!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t)&&t!==he(t)))throw new Error("Transaction object must include a valid 'from' value.");var t;function r(e){var t=e;return("number"===typeof e||"string"===typeof e&&!function(e){return""===e||"string"===typeof e&&""===e.trim()}(e))&&(se(e)?"string"===typeof e&&(t=ne(e)):t=te(e)),"string"===typeof t&&(t=ae(t)),t}var n={from:ne(e.from),to:"undefined"===typeof e.to?void 0:ne(e.to),gasPrice:"undefined"===typeof e.gasPrice?"":r(e.gasPrice),gas:"undefined"===typeof e.gas?"undefined"===typeof e.gasLimit?"":r(e.gasLimit):r(e.gas),value:"undefined"===typeof e.value?"":r(e.value),nonce:"undefined"===typeof e.nonce?"":r(e.nonce),data:"undefined"===typeof e.data?"":ne(e.data)||"0x"},a=["gasPrice","gas","value","nonce"];return Object.keys(n).forEach((function(e){("undefined"===typeof n[e]||"string"===typeof n[e]&&!n[e].trim().length)&&a.includes(e)&&delete n[e]})),n}var me=r(21750);function xe(e,t){var r=ge(e);return e=function(e){return me.stringify(e)}(r=Object.assign(Object.assign({},r),t))}function ge(e){return me.parse(e)}var ve=r(79725),ye=r.n(ve),we=function(){function e(){var t=this;(0,o.Z)(this,e),this._eventEmitters=[],"undefined"!==typeof window&&"undefined"!==typeof window.addEventListener&&(window.addEventListener("online",(function(){return t.trigger("online")})),window.addEventListener("offline",(function(){return t.trigger("offline")})))}return(0,c.Z)(e,[{key:"on",value:function(e,t){this._eventEmitters.push({event:e,callback:t})}},{key:"trigger",value:function(e){var t=[];e&&(t=this._eventEmitters.filter((function(t){return t.event===e}))),t.forEach((function(e){e.callback()}))}}]),e}(),Me="undefined"!==typeof r.g.WebSocket?r.g.WebSocket:r(21143),ke=function(){function e(t){var r=this;if((0,o.Z)(this,e),this.opts=t,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=t.protocol,this._version=t.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new we,!t.url||"string"!==typeof t.url)throw new Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",(function(){return r._socketCreate()}))}return(0,c.Z)(e,[{key:"readyState",get:function(){return this._socket?this._socket.readyState:-1},set:function(e){}},{key:"connecting",get:function(){return 0===this.readyState},set:function(e){}},{key:"connected",get:function(){return 1===this.readyState},set:function(e){}},{key:"closing",get:function(){return 2===this.readyState},set:function(e){}},{key:"closed",get:function(){return 3===this.readyState},set:function(e){}},{key:"open",value:function(){this._socketCreate()}},{key:"close",value:function(){this._socketClose()}},{key:"send",value:function(e,t,r){if(!t||"string"!==typeof t)throw new Error("Missing or invalid topic field");this._socketSend({topic:t,type:"pub",payload:e,silent:!!r})}},{key:"subscribe",value:function(e){this._socketSend({topic:e,type:"sub",payload:"",silent:!0})}},{key:"on",value:function(e,t){this._events.push({event:e,callback:t})}},{key:"_socketCreate",value:function(){var e=this;if(!this._nextSocket){var t=function(e,t,r){var n,a,i=(e.startsWith("https")?e.replace("https","wss"):e.startsWith("http")?e.replace("http","ws"):e).split("?"),o=(0,y.isBrowser)()?{protocol:t,version:r,env:"browser",host:(null===(n=(0,y.getLocation)())||void 0===n?void 0:n.host)||""}:{protocol:t,version:r,env:(null===(a=(0,y.detectEnv)())||void 0===a?void 0:a.name)||""},c=xe(function(e){var t=-1!==e.indexOf("?")?e.indexOf("?"):void 0;return"undefined"!==typeof t?e.substr(t):""}(i[1]||""),o);return i[0]+"?"+c}(this._url,this._protocol,this._version);if(this._nextSocket=new Me(t),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=function(t){return e._socketReceive(t)},this._nextSocket.onopen=function(){return e._socketOpen()},this._nextSocket.onerror=function(t){return e._socketError(t)},this._nextSocket.onclose=function(){setTimeout((function(){e._nextSocket=null,e._socketCreate()}),1e3)}}}},{key:"_socketOpen",value:function(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}},{key:"_socketClose",value:function(){this._socket&&(this._socket.onclose=function(){},this._socket.close())}},{key:"_socketSend",value:function(e){var t=JSON.stringify(e);this._socket&&1===this._socket.readyState?this._socket.send(t):(this._setToQueue(e),this._socketCreate())}},{key:"_socketReceive",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,r=JSON.parse(t.data),e.next=7;break;case 4:return e.prev=4,e.t0=e.catch(0),e.abrupt("return");case 7:this._socketSend({topic:r.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState&&(n=this._events.filter((function(e){return"message"===e.event})),n&&n.length&&n.forEach((function(e){return e.callback(r)})));case 9:case"end":return e.stop()}}),e,this,[[0,4]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_socketError",value:function(e){var t=this._events.filter((function(e){return"error"===e.event}));t&&t.length&&t.forEach((function(t){return t.callback(e)}))}},{key:"_queueSubscriptions",value:function(){var e=this;this._subscriptions.forEach((function(t){return e._queue.push({topic:t,type:"sub",payload:"",silent:!0})})),this._subscriptions=this.opts.subscriptions||[]}},{key:"_setToQueue",value:function(e){this._queue.push(e)}},{key:"_pushQueue",value:function(){var e=this;this._queue.forEach((function(t){return e._socketSend(t)})),this._queue=[]}}]),e}();var Ae=ke,Ie="Session currently connected",Ee="Session currently disconnected",Se="JSON RPC response format is invalid",_e="User close QRCode Modal",Ne=function(){function e(){(0,o.Z)(this,e),this._eventEmitters=[]}return(0,c.Z)(e,[{key:"subscribe",value:function(e){this._eventEmitters.push(e)}},{key:"unsubscribe",value:function(e){this._eventEmitters=this._eventEmitters.filter((function(t){return t.event!==e}))}},{key:"trigger",value:function(e){var t,r=[];(t="undefined"!==typeof e.method?e.method:fe(e)||ue(e)?"response:".concat(e.id):de(e)?e.event:"")&&(r=this._eventEmitters.filter((function(e){return e.event===t}))),r&&r.length||function(e){return w.includes(e)||e.startsWith("wc_")}(t)||de(t)||(r=this._eventEmitters.filter((function(e){return"call_request"===e.event}))),r.forEach((function(t){if(ue(e)){var r=new Error(e.error.message);t.callback(r,null)}else t.callback(null,e)}))}}]),e}(),je=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"walletconnect";(0,o.Z)(this,e),this.storageId=t}return(0,c.Z)(e,[{key:"getSession",value:function(){var e=null,t=(0,y.getLocal)(this.storageId);return t&&"undefined"!==typeof t.bridge&&(e=t),e}},{key:"setSession",value:function(e){return(0,y.setLocal)(this.storageId,e),e}},{key:"removeSession",value:function(){(0,y.removeLocal)(this.storageId)}}]),e}(),Ce=je,Te="abcdefghijklmnopqrstuvwxyz0123456789".split("").map((function(e){return"https://".concat(e,".bridge.walletconnect.org")}));function Le(){return Te[Math.floor(Math.random()*Te.length)]}var De=function(){function e(t){if((0,o.Z)(this,e),this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new Ne,this._clientMeta=(0,y.getClientMeta)()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new Ce(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[].concat((0,E.Z)(M),(0,E.Z)(t.connectorOpts.signingMethods||[])),!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error("Missing one of the required parameters: bridge / uri / session");var r;t.connectorOpts.bridge&&(this.bridge=function(e){return"walletconnect.org"===function(e){return function(e){var t=e.indexOf("//")>-1?e.split("/")[2]:e.split("/")[0];return(t=t.split(":")[0]).split("?")[0]}(e).split(".").slice(-2).join(".")}(e)}(r=t.connectorOpts.bridge)?Le():r),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);var n=t.connectorOpts.session||this._getStorageSession();n&&(this.session=n),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new Ae({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}return(0,c.Z)(e,[{key:"bridge",get:function(){return this._bridge},set:function(e){e&&(this._bridge=e)}},{key:"key",get:function(){var e,t;return this._key?(e=this._key,t=!0,R(new Uint8Array(e),!t)):""},set:function(e){if(e){var t=U(e).buffer;this._key=t}}},{key:"clientId",get:function(){var e=this._clientId;return e||(e=this._clientId=oe()),this._clientId},set:function(e){e&&(this._clientId=e)}},{key:"peerId",get:function(){return this._peerId},set:function(e){e&&(this._peerId=e)}},{key:"clientMeta",get:function(){var e=this._clientMeta;return e||(e=this._clientMeta=(0,y.getClientMeta)()),e},set:function(e){}},{key:"peerMeta",get:function(){return this._peerMeta},set:function(e){this._peerMeta=e}},{key:"handshakeTopic",get:function(){return this._handshakeTopic},set:function(e){e&&(this._handshakeTopic=e)}},{key:"handshakeId",get:function(){return this._handshakeId},set:function(e){e&&(this._handshakeId=e)}},{key:"uri",get:function(){return this._formatUri()},set:function(e){if(e){var t=this._parseUri(e),r=t.handshakeTopic,n=t.bridge,a=t.key;this.handshakeTopic=r,this.bridge=n,this.key=a}}},{key:"chainId",get:function(){return this._chainId},set:function(e){this._chainId=e}},{key:"networkId",get:function(){return this._networkId},set:function(e){this._networkId=e}},{key:"accounts",get:function(){return this._accounts},set:function(e){this._accounts=e}},{key:"rpcUrl",get:function(){return this._rpcUrl},set:function(e){this._rpcUrl=e}},{key:"connected",get:function(){return this._connected},set:function(e){}},{key:"pending",get:function(){return!!this._handshakeTopic},set:function(e){}},{key:"session",get:function(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}},set:function(e){e&&(this._connected=e.connected,this.accounts=e.accounts,this.chainId=e.chainId,this.bridge=e.bridge,this.key=e.key,this.clientId=e.clientId,this.clientMeta=e.clientMeta,this.peerId=e.peerId,this.peerMeta=e.peerMeta,this.handshakeId=e.handshakeId,this.handshakeTopic=e.handshakeTopic)}},{key:"on",value:function(e,t){var r={event:e,callback:t};this._eventManager.subscribe(r)}},{key:"off",value:function(e){this._eventManager.unsubscribe(e)}},{key:"createInstantRequest",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n,i,o=this;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._generateKey();case 2:return this._key=e.sent,r=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]}),this.handshakeId=r.id,this.handshakeTopic=oe(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",(function(){throw new Error(_e)})),n=function(){o.killSession()},e.prev=9,e.next=12,this._sendCallRequest(r);case 12:return(i=e.sent)&&n(),e.abrupt("return",i);case 17:throw e.prev=17,e.t0=e.catch(9),n(),e.t0;case 21:case"end":return e.stop()}}),e,this,[[9,17]])})));return function(t){return e.apply(this,arguments)}}()},{key:"connect",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r=this;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._qrcodeModal){e.next=2;break}throw new Error("QRCode Modal not provided");case 2:if(!this.connected){e.next=4;break}return e.abrupt("return",{chainId:this.chainId,accounts:this.accounts});case 4:return e.next=6,this.createSession(t);case 6:return e.abrupt("return",new Promise(function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t,n){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.on("modal_closed",(function(){return n(new Error(_e))})),r.on("connect",(function(e,r){if(e)return n(e);t(r.params[0])}));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"createSession",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._connected){e.next=2;break}throw new Error(Ie);case 2:if(!this.pending){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._generateKey();case 6:this._key=e.sent,r=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]}),this.handshakeId=r.id,this.handshakeTopic=oe(),this._sendSessionRequest(r,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]});case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"approveSession",value:function(e){if(this._connected)throw new Error(Ie);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";var t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},r={id:this.handshakeId,jsonrpc:"2.0",result:t};this._sendResponse(r),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}},{key:"rejectSession",value:function(e){if(this._connected)throw new Error(Ie);var t=e&&e.message?e.message:"Session Rejected",r=this._formatResponse({id:this.handshakeId,error:{message:t}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession()}},{key:"updateSession",value:function(e){if(!this._connected)throw new Error(Ee);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";var t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},r=this._formatRequest({method:"wc_sessionUpdate",params:[t]});this._sendSessionRequest(r,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}},{key:"killSession",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t?t.message:"Session Disconnected",n={approved:!1,chainId:null,networkId:null,accounts:null},i=this._formatRequest({method:"wc_sessionUpdate",params:[n]}),e.next=5,this._sendRequest(i);case 5:this._handleSessionDisconnect(r);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendTransaction",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error(Ee);case 2:return r=pe(t),n=this._formatRequest({method:"eth_sendTransaction",params:[r]}),e.next=6,this._sendCallRequest(n);case 6:return i=e.sent,e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signTransaction",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error(Ee);case 2:return r=pe(t),n=this._formatRequest({method:"eth_signTransaction",params:[r]}),e.next=6,this._sendCallRequest(n);case 6:return i=e.sent,e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signMessage",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error(Ee);case 2:return r=this._formatRequest({method:"eth_sign",params:t}),e.next=5,this._sendCallRequest(r);case 5:return n=e.sent,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signPersonalMessage",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error(Ee);case 2:return t=be(t),r=this._formatRequest({method:"personal_sign",params:t}),e.next=6,this._sendCallRequest(r);case 6:return n=e.sent,e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"signTypedData",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error(Ee);case 2:return r=this._formatRequest({method:"eth_signTypedData",params:t}),e.next=5,this._sendCallRequest(r);case 5:return n=e.sent,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"updateChain",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error("Session currently disconnected");case 2:return r=this._formatRequest({method:"wallet_updateChain",params:[t]}),e.next=5,this._sendCallRequest(r);case 5:return n=e.sent,e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unsafeSend",value:function(e,t){var r=this;return this._sendRequest(e,t),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:t}]}),new Promise((function(t,n){r._subscribeToResponse(e.id,(function(e,r){if(e)n(e);else{if(!r)throw new Error("Missing JSON RPC response");t(r)}}))}))}},{key:"sendCustomRequest",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t,r){var n,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._connected){e.next=2;break}throw new Error(Ee);case 2:e.t0=t.method,e.next="eth_accounts"===e.t0?5:"eth_chainId"===e.t0?6:"eth_sendTransaction"===e.t0||"eth_signTransaction"===e.t0?7:"personal_sign"===e.t0?9:11;break;case 5:return e.abrupt("return",this.accounts);case 6:return e.abrupt("return",te(this.chainId));case 7:return t.params&&(t.params[0]=pe(t.params[0])),e.abrupt("break",12);case 9:return t.params&&(t.params=be(t.params)),e.abrupt("break",12);case 11:return e.abrupt("break",12);case 12:return n=this._formatRequest(t),e.next=15,this._sendCallRequest(n,r);case 15:return i=e.sent,e.abrupt("return",i);case 17:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"approveRequest",value:function(e){if(!fe(e))throw new Error('JSON-RPC success response must include "result" field');var t=this._formatResponse(e);this._sendResponse(t)}},{key:"rejectRequest",value:function(e){if(!ue(e))throw new Error('JSON-RPC error response must include "error" field');var t=this._formatResponse(e);this._sendResponse(t)}},{key:"transportClose",value:function(){this._transport.close()}},{key:"_sendRequest",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t,r){var n,i,o,c,s;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._formatRequest(t),e.next=3,this._encrypt(n);case 3:i=e.sent,o="undefined"!==typeof(null===r||void 0===r?void 0:r.topic)?r.topic:this.peerId,c=JSON.stringify(i),s="undefined"!==typeof(null===r||void 0===r?void 0:r.forcePushNotification)?!r.forcePushNotification:le(n),this._transport.send(c,o,s);case 8:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"_sendResponse",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t){var r,n,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._encrypt(t);case 2:r=e.sent,n=this.peerId,i=JSON.stringify(r),!0,this._transport.send(i,n,true);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"_sendSessionRequest",value:function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t,r,n){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._sendRequest(t,n),this._subscribeToSessionResponse(t.id,r);case 2:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"_sendCallRequest",value:function(e,t){return this._sendRequest(e,t),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:t}]}),this._subscribeToCallResponse(e.id)}},{key:"_formatRequest",value:function(e){if("undefined"===typeof e.method)throw new Error('JSON RPC request must have valid "method" value');return{id:"undefined"===typeof e.id?ie():e.id,jsonrpc:"2.0",method:e.method,params:"undefined"===typeof e.params?[]:e.params}}},{key:"_formatResponse",value:function(e){if("undefined"===typeof e.id)throw new Error('JSON RPC request must have valid "id" value');var t={id:e.id,jsonrpc:"2.0"};if(ue(e)){var r=function(e){var t=e.message||"Failed or Rejected Request",r=-32e3;if(e&&!e.code)switch(t){case"Parse error":r=-32700;break;case"Invalid request":r=-32600;break;case"Method not found":r=-32601;break;case"Invalid params":r=-32602;break;case"Internal error":r=-32603;break;default:r=-32e3}var n={code:r,message:t};return e.data&&(n.data=e.data),n}(e.error);return Object.assign(Object.assign(Object.assign({},t),e),{error:r})}if(fe(e))return Object.assign(Object.assign({},t),e);throw new Error(Se)}},{key:"_handleSessionDisconnect",value:function(e){var t=e||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),(0,y.removeLocal)(y.mobileLinkChoiceKey)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession(),this.transportClose()}},{key:"_handleSessionResponse",value:function(e,t){t&&t.approved?(this._connected?(t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),t.peerId&&!this.peerId&&(this.peerId=t.peerId),t.peerMeta&&!this.peerMeta&&(this.peerMeta=t.peerMeta),this._eventManager.trigger({event:"connect",params:[{pe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment